Base URL: /auth
- Endpoint:
POST /auth/signup
- Description: Registers a new user.
- Request Body:
SignupDto
email
(string, required): User's email address.password
(string, required): User's password.firstName
(string, required): User's first name.lastName
(string, required): User's last name.role
(Role, optional): User's role.
- Response: Returns registration details.
- Endpoint:
POST /auth/signin
- Description: Authenticates a user and returns a token.
- Request Body:
SigninDto
email
(string, required): User's email address.password
(string, required): User's password.
- Response: Returns authentication token and user details.
- Endpoint:
POST /auth/validate
- Description: Validates an authentication token.
- Request Body:
{ "token": "user's token" }
- Response: Returns validation status and user details if valid.
Base URL: /booking
- Endpoint:
GET /booking
- Description: Retrieves all bookings. Access restricted to admin roles.
- Response: Array of
Booking
.
- Endpoint:
GET /booking/:id
- Description: Retrieves a specific booking by ID.
- Request Parameters:
id
(number, required): Booking ID. - Response: Returns details of the specified booking.
- Endpoint:
DELETE /booking/:id
- Description: Deletes a specific booking. Verification required.
- Request Parameters:
id
(number, required): Booking ID. - Response: Confirmation of deletion.
Base URL: /event
- Endpoint:
GET /event
- Description: Retrieves all events.
- Response: Array of event details.
- Endpoint:
GET /event/:id
- Description: Retrieves specific event details.
- Request Parameters:
id
(number, required): Event ID. - Response: Event details.
- Endpoint:
POST /event
- Description: Creates a new event. Admin only.
- Request Body:
EventDto
eventName
(string, required)eventDate
(Date, required)description
(string, required)location
(string, required)isCanceled
(boolean, optional)maxBooking
(number, optional)
- Response: Details of the created event.
- Endpoint:
PATCH /event/:id
- Description: Updates an existing event. Admin only.
- Request Parameters:
id
(number, required): Event ID. - Request Body:
UpdateEventDto
- Response: Updated event details.
- Endpoint:
DELETE /event/:id
- Description: Deletes a specific event. Admin only.
- Request Parameters:
id
(number, required): Event ID. - Response: Confirmation of deletion.
Base URL: /user
- Endpoint:
GET /user/all
- Description: Retrieves all users. Admin only.
- Response: Array of user details.
- Endpoint:
GET /user/:id
- Description: Retrieves details of a specific user. Admin only.
- Request Parameters:
id
(number, required): User ID. - Response: User details.
- Endpoint:
PATCH /user/:id
- Description: Updates a specific user's details. Admin only.
- Request Parameters:
id
(number, required): User ID. - Request Body:
UpdateUserDto
- Response: Updated user details.
- Endpoint:
DELETE /user/:id
- Description: Deletes a specific user. Admin only.
- Request Parameters:
id
(number, required): User ID. - Response: Confirmation of user deletion.
- Endpoint:
GET /user
- Description: Retrieves the profile information of the logged-in user.
- Response: User details of the logged-in user.
- Endpoint:
PATCH /user
- Description: Updates the profile of the logged-in user.
- Request Body:
UpdateUserDto
- Response: Updated details of the logged-in user.
- Endpoint:
DELETE /user
- Description: Deletes the profile of the logged-in user.
- Response: Confirmation of deletion of the logged-in user's profile.
- Endpoint:
POST /user/:id/promote
- Description: Promotes the user to a higher role. Admin only.
- Request Parameters:
id
(number, required): User ID. - Response: Confirmation of user promotion.
- Endpoint:
POST /user/:id/demote
- Description: Demotes the user to a lower role. Admin only.
- Request Parameters:
id
(number, required): User ID. - Response: Confirmation of user demotion.
- Endpoint:
GET /user/booking
- Description: Retrieves all bookings associated with the logged-in user.
- Response: Array of bookings for the logged-in user.
- Endpoint:
GET /user/:id/booking
- Description: Retrieves all bookings associated with a specific user. Admin only.
- Request Parameters:
id
(number, required): User ID. - Response: Array of bookings for the specified user.