Skip to main content

Booking

Overview#

A booking is the physical booking slot of the venue. A booking is only created when a booking request is approved.

The booking is a confirmed slot of the venue that has been taken by a certain user.

Booking Schema#

keytypedescriptionisUniquedefaultValue
idObjectIdAlphaNumeric ID given by mongodbfalseGiven
emailStringEmail of the booking requestfalseNone
venueObjectIdAlphaNumeric ID of the venuefalseNone
dateNumberUnix time stamp date that the use wants to bookfalseNone
timingSlotNumbertime slot user has bookedfalseNone
notesStringDetails about the booking the user want to let the admin knowfalseNone

User API Resources#

Get Booking of Venue#

Description
Get the booked slots of the venue given a range of dates

Request

Method - GET

Route - /api/v1/booking/get

Example Request - /api/v1/booking/get?venueId=6106db0948fdff1f8d065588&startDate=20210808&endDate=20211225

Query Parameters

paramtypedescription
venueIdObjectIdID of the booking request
startDateStringStart Date of the range of search in the format YYYYMMDD
endDateStringEnd Date of the range of search in the format YYYYMMDD

Response

Description - Array of time slots that are booking tagged to the date

Code - 200 OK

Example Response

{  "bookings": {    "20210808": [1, 2]  }}

Details - The queried venue is booked on time slot 1 and 2 on 2021/08/08