Giter Club home page Giter Club logo

webooking's Introduction

# 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": "[email protected]",
        "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


webooking's People

Contributors

salomao270 avatar

Watchers

 avatar

Forkers

salomao91

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.