Skip to content

SampritiMitra/event_api

Repository files navigation

event_api

Events Controller

Event Management system using Laravel framework

URI Method Function Purpose
/ GET index Viewing your events, Admin can see all events
/mems GET showMems Viewing the members of events you are invited to, Admin can see members of all events
/register POST register Register yourself as an user
/inv/{e_id} POST invite Invite another user to an event, cannot invite if already present
/create POST create Create an event when authenticated as an user
/show GET show Shows your profile
/accept/{e_id} PATCH accept Accept/Reject an invitation
/update/{e_id} PUT update Update an event
/delete DELETE destroy Delete an event
/remove/{id} DELETE remove Remove a member

@eventsController

@index

  • you may only see your events which you have created and events you are invited to unless you are admin
  • find events you are a part of, show their information and whther they are accepted, rejected or pending

@create

  • validate and create the event
  • once you have created an event, you are also going to be added to the list of pending invitees
  • need the record of the latest event created by the current user so that we can set its status to pending in the invite_status table

@accept

  • you may only accept the events you have been invited to unless you are admin
  • Admin requires a user_id request to know which member's status to alter
  • Check whether the event exists
  • Check if Admin is making changes
  • Check if the required user is invited to the event=>current user in case of non-admin
  • Update status and send mail to the required user

@invite

  • email of user required for invitation
  • Check if event exists
  • Is the user an admin or did the user create the event?
  • Does the user being invited exist?
  • Is the user already a member or an invitee of this current event?
  • Send email and invite

@showMems

  • Show all members of every event if user is Admin
  • Show members of all events user is a part of if user is non Admin

@remove

  • Email of member to be removed is required
  • Check if the event exists
  • Check if the event was created by the current user, or if the current user is an Admin
  • Check if the user to be deleted exists
  • Check if the user to be deleted is a part of the event

@update

  • Check if the event exists
  • Check if the event was created by the current user, or if the current user is an Admin
  • Mail everyone who is a member

@destroy

  • Check if the event exists
  • Check if the event was created by the current user, or if the current user is an Admin
  • Mail everyone who is a member and delete the event

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published