The service provides endpoints to manage events such as meetings and manages users that can be host of the meeting or a participant of the meeting.
- Create/Update/Delete an event for a single block of time in a day.
- Create/Update/Delete users that can host or participate in those events.
- Add participants to an event from the pool of available users.
- Query the list of events using the following criteria:
- By participant or host user
- By date range.
- Remove participants from an event.
- An event participant may be the host. There can only be a single host for an event.
- A participant can be marked as optional or required.
- A participant can indicate their intention to accept the invitation or decline the invitation.
- POST
/api/users/- Parameters
* request body { "firstName": "string", "lastName": "string", "email": "user@example.com" }
- Response example
* code: 201 * response body { "data": { "_id": "uuid", "firstName": "string", "lastName": "string", "email": "user@example.com", "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 }, "message": "An user was created successfully" }
- Parameters
- GET
/api/users/- Parameters
* No Parameters - Response
* code: 200 * response body { "data": [ { "_id": "uuid", "firstName": "string", "lastName": "string", "email": "user@example.com", "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 } ] }
- Parameters
- GET
/api/users/{id}- Parameters
* path id: uuid(required) - Response
* code: 200 * response body { "data": { "_id": "uuid", "firstName": "string", "lastName": "string", "email": "user@example.com", "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 } }
- Parameters
- PUT
/api/users/{id}- Parameters
* path id: uuid(required) * request body { "firstName": "string", "lastName": "string", "email": "string" }
- Response
* code: 200 * response body { "message": "User was updated successfully." }
- Parameters
- DELETE
/api/users/{id}- Parameters
* path id: uuid(required) - Response
* code: 200 * response body { "message":"User was deleted successfully" }
- Parameters
- POST
/api/events/- Parameters
* request body { "name": "string", "startAt": "datetime", "endAt": "datetime", "participants": [ { "user": "uuid", "isHost": true, "isRequired": true, "isAccepted": true } ] }
- Response example
* code: 201 * response body { "data": { "_id": "uuid", "name": "string", "startAt": "datetime", "endAt": "datetime", "participants": [ { "isRequired": true, "isAccepted": true, "_id": "uuid", "user": "uuid", "isHost": true } ], "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 }
- Parameters
- GET
/api/events/- Parameters
* query from: datetime to: datetime hostId: uuid(id of participant instance) participantId: uuid(id of participant instance) * request body { "detail": true }
- Response example
* code: 200 * response body { "data": [ { "_id": "uuid", "name": "string", "startAt": "datetime", "endAt": "datetime", "participants": [ { "isRequired": false, "isAccepted": false, "_id": "uuid", "user": { "_id": "uuid", "firstName": "string", "lastName": "string", "email": "user@example.com" }, "isHost": false } ], "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 } ] }
- Parameters
- GET
/api/events/{id}- Parameters
* path id: uuid(required) * request body { "detail": true }
- Response example
* code: 200 * response body { "data": { "_id": "uuid", "name": "string", "startAt": "datetime", "endAt": "datetime", "participants": [ { "isRequired": false, "isAccepted": false, "_id": "uuid", "user": { "_id": "uuid", "firstName": "string", "lastName": "string", "email": "user@example.com" }, "isHost": false } ], "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 } }
- Parameters
- PUT
/api/events/{id}- Parameters
* path id: uuid(required) * request body { "name": "string" }
- Response example
* code: 200 * response body { "message": "Event was updated successfully.", "data": { "_id": "uuid", "name": "string", "startAt": "datetime", "endAt": "datetime", "participants": [ { "isRequired": false, "isAccepted": false, "_id": "uuid", "user": "uuid", "isHost": false } ], "createdAt": "datetime", "updatedAt": "datetime", "__v": 0 }
- Parameters
- PUT
/api/events/{id}/add-participants- Parameters
* path id: uuid(required) * request body [ { "isRequired": false, "isAccepted": false, "user": "uuid", "isHost": false } ]
- Response example
* code: 200 * response body { "message": "participants were added successfully." }
- Parameters
- PUT
/api/events/{id}/remove-participants- Parameters
* path id: uuid(required) * request body [ "uuid" ]
- Response example
* code: 200 * response body { "message": "Participants were removed from the event successfully." }
- Parameters
- PUT
/api/events/{id}/update-status- Parameters
* path id: uuid(required) * request body { "user": "uuid", "isAccepted": false, "isRequired": false, "isHost": false }
- Response example
* code: 200 * response body { "message": "User status was updated successfully." }
- Parameters
- DELETE
/api/events/{id}- Parameters
* path id: uuid(required) - Response example
* code: 200 * response body { "message": "Event was deleted successfully." }
- Parameters
Before starting the server, you should start MongoDB server on your local environment
$ npm install$ npm run devServer is running on http://localhost:8080
$ npm run test