This is Flurn Company Assignment this is for booking seats.
git clone https://github.com/Amanmandal-M/Flurn_Booking_System_Backend.git
npm i -g nodemon
npm install / npm i
node index.js
nodemon index.js
Note : You can use any of them
├── index.js
├── configs
| └── db.js
├── models
| └── seatsModel.js
| └── seatsPricingModel.js
├── routes
| └── seatRouter.js
| └── bookingRouter.js
├──controllers
| └── dataConverterController.js
| └── seatController.js
Note:
- Before doing anything first create
.env
file and putPORT
,MONGO_URI
PORT
is for listening the server.MONGO_URI
is for running database and store your data in database so put your mongo link.
{
_id: ObjectId,
id: {
type: String,
required: true
},
seat_identifier: {
type: String,
required: true
},
seat_class: {
type: String,
required: true
},
is_booked : {
type: Boolean,
required: false
}
}
{
_id: ObjectId,
id: {
type: String,
required: true
},
seat_identifier: {
type: String,
required: true
},
seat_class: {
type: String,
required: true
},
is_booked : {
type: Boolean,
required: false
}
}
{
_id: ObjectId,
id: {
type: String,
required: true,
},
seat_class: {
type: String,
required: true,
},
min_price: {
type: String,
default: null,
},
normal_price: {
type: String,
required: true,
},
max_price: {
type: String,
default: null
},
}
{
_id: ObjectId,
id: {
type: String,
required: true,
},
seat_class: {
type: String,
required: true,
},
min_price: {
type: String,
default: null,
},
normal_price: {
type: String,
required: true,
},
max_price: {
type: String,
default: null
},
}
METHOD | ENDPOINT | DESCRIPTION | STATUS CODE |
---|---|---|---|
GET | /api/seats | This endpoint should allow users for retrieving all seats data. | 200 |
GET | /api/seats/:id | This endpoint should allow users to for retrieving a single seats by ID. | 200 |
POST | /api/seats | This endpoint is for for adding new seat data. | 200 |
POST | /api/seatPricing | This endpoint is for for adding new seat pricing data. | 200 |
DELETE | /api/seats/:id | This endpoint is for deleting seats data by ID. | 202 |
DELETE | /api/seatPricing/:id | This endpoint is for deleting seats Pricing data by ID. | 202 |