Status: In-progress (Prototype stage)
Uses Spring boot, JPA with Hibernate, Embedded H2 database, Embedded Tomcat
- Demonstrates basic rest api design (Note: Not all APIs are implemented, however created from demonstration perspective.).
- Demonstrates junit tests with mockito using spring's advanced test features. (Note: tests are for demonstration purpose only and were not written from coverage perspective.)
- Uses 'AuditorAware' to insert the user in invoice record while being updated for auditing purpose.
- Uses locale while throwing error message following any business exception. (Append '?lang=fr|de' to your URL)
- Uses Spring Security to protect APIs both at URI level and at method level.
$ mvn clean install
$ java -jar target/checkout-counter-0.0.1-SNAPSHOT.jar
OR
$ mvn spring-boot:run [-Dspring.profiles.active=dev]
Uses basic auth for authentication
Username | Password | Role |
---|---|---|
admin | admin | ADMIN |
inventory | inventory | INVENTORY_MANAGER |
sales | sales | SALES_MANAGER |
cashier | cashier | CASHIER |
Please refer to src/main/resources/data.sql
-
Create Product: POST /products
-
List Products: GET /products
-
Search Products with criteria: GET /products/search?barcode=123&categories=C1,C2
-
Get Product by Id: GET /products/{productId}
-
Create Category: POST /categories
-
List Categories: GET /categories -
Get Category by Id: GET /categories/{categoryId} -
Update Category: PUT /categories/{categoryId} -
List products assigned to a Category: GET /categories/{categoryId}/products -
Assign/Unassign to/from a Category: POST /categories/{categoryId}/products?action=assign|unassign
-
Generate Invoice (and save): POST /invoices?save=true
-
Get Invoice by InvoiceNo: GET /invoices/{invoiceNo}
** Powered by Open Source initiative **