Skip to content

WebAPI project to booking a room in a hotel based on some datetime business rules.

Notifications You must be signed in to change notification settings

salomao91/WeBooking

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# WeBooking

Web API project to book a room in a hotel based on some datetime business rules.

1) UNIT TEST (EXTRA)

It was also developped a Unit Test project using MS Test to assure that business rules meets the requirements.

unitTests


Methods tested using Postman

2) GET - Reservations (EXTRA)

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.

getreservations


3) GET - Room availability

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"
 }

getroomstatus


4) POST - a reservation in a free date

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"
}

post


5) PUT - change a reservation date

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.

put1



PUT METHOD - To update that previous date to a new one.

put2


6) DELETE

URL example - https://localhost:44314/api/booking/delete?id=3
Parameter: The id number of the Reservation.

delete


About

WebAPI project to booking a room in a hotel based on some datetime business rules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 58.7%
  • C# 36.8%
  • HTML 3.8%
  • Other 0.7%