An open API service indexing awesome lists of open source software.

https://github.com/shev0k/parking-system-be


https://github.com/shev0k/parking-system-be

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# DEVELOPMENT SETUP

## Data base setup

1) Download an image from dockerhub:

`docker run --name parking_system -e MYSQL_DATABASE=parking_system_db_dev -e MYSQL_ROOT_PASSWORD=*YOUR_PASSWORD!* -p 3390:3306 -d mysql`

2) Insert your password in application-dev.properties

```properties
spring.datasource.url=jdbc:mysql://localhost:3390/parking_system_db_dev
spring.datasource.username=root
spring.datasource.password=*YOUR_PASSWORD!*
spring.jpa.hibernate.ddl-auto=update
```

3) change active profile to dev in app configuration

## Endpoints

- #### Get appointments paginated (GET)
*Request:*
```
api/appointments/pages
?page=int
&pageSize=int
```
*Response:*
```json
{
"content": [
{
"id": 5,
"datetime": "2024-04-11T11:16:00",
"guest": "Danila Solovenko",
"employee": "Cooler Solovenko",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "smth",
"carPlateNumber": "DEF451"
}
],
"pageable": {
"pageNumber": 1,
"pageSize": 1,
"sort": {
"empty": true,
"sorted": false,
"unsorted": true
},
"offset": 1,
"paged": true,
"unpaged": false
},
"last": false,
"totalElements": 4,
"totalPages": 4,
"size": 1,
"number": 1,
"sort": {
"empty": true,
"sorted": false,
"unsorted": true
},
"first": false,
"numberOfElements": 1,
"empty": false
}
```

- #### Get appointments for a specific month (GET)
*Request:*
```
api/appointments/calendar_overview
?year=int
&month=int
```
*Response:*
```json
[
{
"id": 5,
"datetime": "2024-04-11T11:16:00",
"guest": "Danila Solovenko",
"employee": "Cooler Solovenko",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "smth",
"carPlateNumber": "DEF451"
}
]
```

- #### Get a specific appointment (GET)
*Request:*
```
api/appointments/5
```
*Response:*
```json
{
"id": 3,
"datetime": "2024-04-11T11:15:00",
"guest": "Eva Garcia",
"employee": "Michael Clark",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "Tire rotation",
"carPlateNumber": "DEF456"
}
```

- #### Create an appointment (POST)
*Request:*
```
api/appointments
```
*Body:*
```json
{
"datetime": "2024-04-11T11:18:00",
"guest": "Danila Solovenko",
"employee": "Cooler Solovenko",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "smth",
"carPlateNumber": "DEF451"
}
```
*Response:*
```json
6
```

- #### Edit an appointment (PUT)
*Request:*
```
api/appointments/5
```
*Response:*
```json

```

- #### Delete an appointment (DELETE)
*Request:*
```
api/appointments/5
```
*Response:*
```json

```