It was also developped a Unit Test project using MS Test to assure that business rules meets the requirements.
Note: As this app doesn't have database to store data, this get reservation method will works with mock code on BookingBO.cs constructor.
URL example - https://localhost:44314/api/booking/reservations
Parameter: It is not necessarry.
Note: Pass the Start date and End date to know if this date range is available or already booked. Remembering the requirement - "All reservations start at least the next day of booking".
URL example - https://localhost:44314/api/booking/roomstatus
Parameter: JSON
{
"startDate": "2021-04-06T00:00:00",
"endDate": "2021-04-07T00:00:00"
}
Note: The register is saved temporary cause it doesnt have database.
URL example - https://localhost:44314/api/booking/bookreservation
Parameter: JSON:
{
"id": 1,
"customer": {
"id": 1,
"name": "sample string 2",
"dateOfBirth": "2021-04-12T12:02:53.5165882-03:00",
"phone": "sample string 4",
"email": "sample string 5",
"documentNumber": 6
},
"room": {
"id": 1
},
"startDate": "2021-04-12T12:02:53.5173569-03:00",
"endDate": "2021-04-12T12:02:53.5173569-03:00"
}
Note: Pass the Start date and End date to update it.
URL example - https://localhost:44314/api/booking/changereservation
Parameter: JSON
{
"id": 3,
"customer": {
"id": 3,
"name": "Mary Williams",
"dateOfBirth": "1992-02-10T00:00:00",
"phone": "+1 8000-8000",
"email": "joseph@email.com",
"documentNumber": 98765
},
"room": {
"id": 1
},
"startDate": "2021-04-11T00:00:00",
"endDate": "2021-04-13T00:00:00"
}
GET METHOD - To see previous booked date.
PUT METHOD - To update that previous date to a new one.
URL example - https://localhost:44314/api/booking/delete?id=3
Parameter: The id number of the Reservation.