Giter VIP home page Giter VIP logo

car_rental's Introduction

Car_Rental

This is a simple project for car rental which contains API backend (Java, Spring and Hibernate) and database (SQLite).

Database

Database contains three tables: Cars, Clients and Rents. Database schema presented below:
db_diagram

Endpoints

  • GET /car returns the list of all cars with status 200

  • GET /car/{id} returns the car specified by id with status 200 or status 400 if car is not found

  • POST /car adds the car with parameters brand, model and available given in body, returns 201 if created, 400 otherwise

  • PUT /car/{id} updates existing car specified by given id with parameters brand, model and available given in body, returns 200 if updated, 400 otherwise

  • DELETE /car/{id} deletes existing car specified by givem id, returns 200 if deleted, 400 otherwise

  • GET /client returns the list of all clients with status 200

  • GET /client/{id} returns the client specified by id with status 200 or status 400 if client is not found

  • POST /client adds the client with parameters firstname and lastname given in body, returns 201 if created, 400 otherwise

  • PUT /client/{id} updates existing client specified by given id with parameters firstname and lastname given in body, returns 200 if updated, 400 otherwise

  • DELETE /client/{id} deletes existing client specified by givem id, returns 200 if deleted, 400 otherwise

  • GET /rent returns the list of all rents with status 200

  • GET /rent/{id} returns the rent specified by id with status 200 or status 400 if rent is not found

  • POST /rent adds the rent with parameters car_id and client_id given in body, returns 201 if created, 400 otherwise

  • PATCH /rent/{id} sets the rent specified by id as returned: sets returndate to current time and sets car as available; returns 200 if updated, 400 otherwise

  • PUT /rent/{id} updates existing rent specified by given id with parameters car_id and client_id given in body, returns 200 if updated, 400 otherwise

  • DELETE /rent/{id} deletes existing rent specified by givem id, returns 200 if deleted, 400 otherwise

Run in Postman

car_rental's People

Contributors

konigin144 avatar

Stargazers

Mateo Adan  avatar Rick Gao avatar  avatar  avatar

Watchers

 avatar

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.