- Clone the repository:
git clone https://github.com/SegunCodes/appointment-booking-system.git cd appointment-booking-system
- Install dependencies:
npm install
- Start application:
npm start
POST /auth/register - Register a new user. Request body: { "name": "John Doe", "email": "[email protected]", "password": "password123", "role": "customer" }
POST /auth/login - Login a user. Request body: { "email": "[email protected]", "password": "password123" }
POST /merchant/schedule - Create a merchant schedule. Headers: { "Authorization": "Bearer " } Request body: { "name": "Merchant Name", "email": "[email protected]", "schedule": [{ "day": "Monday", "timeSlots": ["09:00", "10:00"] }] }
GET /merchants - Get a list of all merchants. Headers: { "Authorization": "Bearer " }
POST /bookings/create - Book an appointment. Headers: { "Authorization": "Bearer " } Request body: { "merchantId": "merchantId", "date": "2023-12-12", "timeSlot": "10:00" }
GET /bookings - Get a list of all bookings for the logged-in customer. Headers: { "Authorization": "Bearer " }
GET /merchants/:id/bookings - Get a list of all bookings for a merchant. Headers: { "Authorization": "Bearer " }
PATCH /bookings/:id - Update a booking (date, timeSlot, status). Headers: { "Authorization": "Bearer " }
DELETE /bookings/:id - Delete a booking. Headers: { "Authorization": "Bearer " }