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

https://github.com/devkiloton/spring-boot-assignment

The guys from Payaut gave me an assignment, that's the result...
https://github.com/devkiloton/spring-boot-assignment

h2 java spring-boot

Last synced: about 2 months ago
JSON representation

The guys from Payaut gave me an assignment, that's the result...

Awesome Lists containing this project

README

          

# REST service spring boot

```mermaid
erDiagram
item {
bigint id PK
timestamp created_at
varchar item_name
enum item_type
enum item_unit
bigint discount_id FK
}

discount {
bigint id PK
enum discount_unit
boolean is_constant_slab
}

discount_slab {
bigint id PK
double discount_amount
bigint units_to_get_discount
bigint discount_id FK
}

discount ||--|{ discount_slab : discount_id
discount |o --|| item : discount_id
```
## Documentation
All the endpoints and possible requests/exceptions are documented in Postman(and many of them in Javadoc). The requisitions are with fulfilled bodies and ready to be tested locally

Run in Postman

## How it works?
Capture d’écran 2024-04-29 à 09 17 59

## The DB
I have used H2 in memory db (100% Java), so if you want to take a look in the tables access `/api/v1/h2` and you will have access to the console (credentials in the application.properties)

https://github.com/devkiloton/Payaut-assignment/assets/78966160/3e8e9065-042d-4fe1-8e80-35f230b6c907

## Item's cheat sheet
Use these identifiers (default data) to interact with the API
| ID | CREATED_AT | ITEM_NAME | ITEM_PRICE | ITEM_TYPE | ITEM_UNIT | DISCOUNT_ID |
|------|---------------------|--------------|--------------|-------------|-------------|---------------|
| 1 | 2024-04-24 10:00:00 | Vegetables | 0.01 | VEGETABLES | GRAM | 1 |
| 2 | 2024-04-24 11:00:00 | Dutch Beer | 0.5 | BEERS | PIECE | 2 |
| 3 | 2024-04-25 11:00:00 | Bread | 1.0 | BREADS | PIECE | 3 |
| 4 | 2024-04-24 11:00:00 | Belgium Beer | 0.75 | BEERS | PIECE | 4 |
| 5 | 2024-04-24 11:00:00 | German Beer | 1.0 | BEERS | PIECE | 5 |

### Other projects you might like
[Laravel ambassador](https://github.com/devkiloton/laravel-ambassador)
A monolith built with PHP, Docker, MySQL and Redis

[Main Chainz API](https://github.com/devkiloton/main-chainz-restful-api)
An open source Nodejs api built with MySQL, Redis, and many other technologies