Skip to content

Latest commit

Β 

History

History
64 lines (48 loc) Β· 1.71 KB

README.md

File metadata and controls

64 lines (48 loc) Β· 1.71 KB

πŸš— πŸ…ΏοΈ Parking Lot API πŸ…ΏοΈ πŸš™

CircleCI codecov

I used H2 database for persistence and Liquibase for schema management.
There is no booking restrictions per Customer.

Requirements

  • Java 11

Building and running the app

Docker

docker build -t edych/parking-lot-api .
docker run -p 8080:8080 edych/parking-lot-api

Maven

./mvnw clean install
java -jar target/parking-0.0.1-SNAPSHOT.jar

Entity Relationship Diagram

alt text

Prepared data

  • There are two ParkingFloors, each with 30 ParkingSpots
  • There is one Customer: id: 1, name: edych
  • H2 Console is available at http://localhost:8080/h2

API

Swagger UI

Documentation available at http://localhost:8080/swagger-ui.html

Postman

There is postman.json collection provided in the root of repository.

Curls

1. Create a new Reservation

curl -X POST 'localhost:8080/reservation' \
-H 'Content-Type: application/json' \
--data-raw '{"customerId": 1,"parkingSpotId": 5}'

2. Delete Reservation

curl -X DELETE 'localhost:8080/reservation/1'

3. Get a list of all Reservations made by Customer

curl -X GET 'localhost:8080/reservations?customerId=1'

4. Get a list of all available ParkingSpots

curl -X GET 'localhost:8080/parking-spot/available'