docker-compose up -d
docker exec -it saas-pos-mysql-db mysql -u root -p
root
show databases;
use saas-pos
show tables;+------------------------------------+
| Tables_in_saas-pos |
+------------------------------------+
| branch_working_days |
| branches |
| categories |
| customers |
| inventories |
| order_items |
| orders |
| products |
| refunds |
| shift_reports |
| shift_reports_recent_orders |
| shift_reports_top_selling_products |
| stores |
| users |
+------------------------------------+
https://app.eraser.io/workspace/9n9DiRjGqNB2LPjV5IOh?diagram=zr4EsE6GvrSx5F-okKjdIBase URL: api/v2
- Auth APIs
- User APIs
- Store APIs
- Branch APIs
- Product APIs
- Category APIs
- Inventory APIs
- Customer APIs
- Employee APIs
- Order APIs
- Refund APIs
- Shift Report APIs
- Enums
- Models
POSTMAN URI [Req to access]
https://crimson-comet-847628.postman.co/workspace/springBoot-fitness~3624bf6f-c3b5-4845-b04e-6d7f7fcd62fc/collection/25455646-5af24c3a-29fb-4d4a-b20e-681bdb72e7a0?action=share&source=copy-link&creator=25455646Base Path: api/v2/auth
Request Body (UserDto):
{
"fullName": "string (required, max 100)",
"password": "string (required, min 8, max 100)",
"phone": "string (required, 10-15 digits)",
"email": "string (required, valid emaiAdmin registration is not allowed.l)",
"role": "ROLE_ADMIN | ROLE_STORE_MANAGER | ROLE_BRANCH_MANAGER | ROLE_CASHIER | ROLE_CLIENT (required)",
"storeId": "number (optional)",
"branchId": "number (optional)"
},
{
"fullName": "Arya",
"password": "StrongPass123",
"phone": "9983340545",
"email": "arya1889@gmail.com",
"storeId": 1, //should be present already
"branchId": 2, // should be present already
"role": "ROLE_CLIENT" // not Role_admin
}- NOTE : ROLE_ADMIN :- Admin registration is not allowed.
Response (
AuthResponse):
{
"jwt": "string",
"message": "string",
"user": {
"id": 1,
"fullName": "string",
"phone": "string",
"email": "string",
"storeId": 1,
"branchId": 1,
"role": "ROLE_ADMIN",
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00",
"lastLogin": "2025-01-01T00:00:00"
}
},
{
"jwt": "eyJhbGc......rrBJFRdsOMlk6G4q4RZjUYmE7DZWA",
"message": "User registered successfully",
"user": {
"id": 3,
"fullName": "Arya",
"password": null,
"phone": "9983340545",
"email": "arya1889@gmail.com",
"storeId": null,
"branchId": null,
"role": "ROLE_CLIENT",
"createdAt": "2026-03-11T21:43:57.242135",
"updatedAt": null, // why are NULL
"lastLogin": null
}
}[IMPORTANT] Event createdAt updatedAt lastLogin Signup now null null First Login same null now Profile Update same now lastLogin
Request Body (UserDto):
{
"email": "string (required)",
"password": "string (required)"
},
{
"email": "arya1889@gmail.com",
"password": "StrongPass123"
}Response (AuthResponse):
{
"jwt": "string",
"message": "string",
"user": {
"id": 1,
"fullName": "string",
"email": "string",
"phone": "string",
"role": "ROLE_ADMIN",
"storeId": 1,
"branchId": 1,
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00",
"lastLogin": "2025-01-01T00:00:00"
}
},
{
"jwt": "ey........4g8pfp-npl2WSe9aSU9hbLLOwE",
"message": "Login successful",
"user": {
"id": 3,
"fullName": "Arya",
"password": null,
"phone": "9983340545",
"email": "arya1889@gmail.com",
"storeId": null,
"branchId": null,
"role": "ROLE_CLIENT",
"createdAt": "2026-03-11T21:43:57.242135",
"updatedAt": "2026-03-11T22:02:27.089861",
"lastLogin": "2026-03-11T22:02:27.061277"
}
}Base Path: api/v2/user/
Headers: Authorization: Bearer <jwt>
Response (UserDto):
{
"id": 1,
"fullName": "string",
"phone": "string",
"email": "string",
"storeId": 1,
"branchId": 1,
"role": "ROLE_ADMIN",
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00",
"lastLogin": "2025-01-01T00:00:00"
},
{
"id": 3,
"fullName": "Arya",
"password": null,
"phone": "9983340545",
"email": "arya1889@gmail.com",
"storeId": null,
"branchId": null,
"role": "ROLE_CLIENT",
"createdAt": "2026-03-11T21:43:57.242135",
"updatedAt": "2026-03-11T22:02:27.089861",
"lastLogin": "2026-03-11T22:02:27.061277"
}Headers: Authorization: Bearer <jwt>
Response (UserDto): Same as above.
Access: ROLE_ADMIN only
Path Params: id (Long) - User ID
Response (UserDto): Same as above.
Access: ROLE_ADMIN only
Path Params: email (String)
Response (UserDto): Same as above.
Access: ROLE_ADMIN only
Response (List<UserDto>):
[
{
"id": 1,
"fullName": "string",
"phone": "string",
"email": "string",
"storeId": 1,
"branchId": 1,
"role": "ROLE_ADMIN",
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00",
"lastLogin": "2025-01-01T00:00:00"
}
]Base Path: api/v2/store
Headers: Authorization: Bearer <jwt>
Request Body (StoreDto):
{
"brand": "string (required)",
"storeType": "string (required)",
"description": "string (optional)",
"contact": {
"address": "string",
"phone": "string",
"email": "string"
}
}
{
"brand": "Arya Retail",
"storeAdminId": 3,
"storeType": "RETAIL",
"description": "Electronics and mobile accessories store",
"status": "ACTIVE",
"contact": {
"phone": "9983340125",
"email": "support@aryaretail.com",
"address": "Jaipur, Rajasthan, India"
}
}Response (StoreDto):
{
"id": 1,
"branch": "string",
"brand": "string",
"storeType": "string",
"description": "string",
"status": "ACTIVE",
"contact": {
"address": "string",
"phone": "string",
"email": "string"
},
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00"
}{
"id": 1,
"brand": "Arya Retail",
"storeAdminId": 3,
"storeType": "RETAIL",
"description": "Electronics and mobile accessories store",
"status": "PENDING",
"contact": {
"address": "Jaipur, Rajasthan, India",
"phone": "9983340125",
"email": "support@aryaretail.com"
},
"createdAt": "2026-03-23T13:53:31.865488",
"updatedAt": null
}Path Params: id (Long) - Store ID
Response (StoreDto): Same as above.
Response (List<StoreDto>): Array of StoreDto objects.
Headers: Authorization: Bearer <jwt>
Response (Store): Full Store entity object.
{
"id": 1,
"brand": "Arya Retail",
"storeAdmin": {
"id": 3,
"fullName": "Arya",
"password": "$2a$10$o6Cei6e7o1v0eySknXHB5.s92CIyg24VxBCba4kWQOHHPhVR49DYW",
"phone": "9983340545",
"email": "arya1889@gmail.com",
"store": null,
"branch": null,
"role": "ROLE_CLIENT",
"createdAt": "2026-03-11T21:43:57.242135",
"updatedAt": "2026-03-23T13:45:39.09478",
"lastLogin": "2026-03-23T13:45:39.075244"
},
"storeType": "RETAIL",
"description": "Electronics and mobile accessories store",
"status": "PENDING",
"contact": {
"address": "Jaipur, Rajasthan, India",
"phone": "9983340125",
"email": "support@aryaretail.com"
},
"createdAt": "2026-03-23T13:53:31.865488",
"updatedAt": null
}Headers: Authorization: Bearer <jwt>
Response (StoreDto): Same as StoreDto above.
{
"id": 5,
"brand": "Aryaans Retail",
"storeAdminId": 5,
"storeType": "RETAIL",
"description": "Electronics and mobile accessories store",
"status": "PENDING",
"contact": {
"address": "Jaipur, Rajasthan, India",
"phone": "9983340125",
"email": "support@aryaretail.com"
},
"createdAt": "2026-03-23T14:20:36.723342",
"updatedAt": null
}Path Params: id (Long) - Store ID
Request Body (StoreDto):
{
"branch": "string",
"brand": "string",
"storeType": "string",
"description": "string",
"contact": {
"address": "string",
"phone": "string",
"email": "string"
}
}Response (StoreDto): Updated store object.
Path Params: id (Long) - Store ID
Query Params: storeStatus - One of: ACTIVE, CLOSED, OPEN, BLOCKED, PENDING
Response (StoreDto): Updated store object with new status.
Path Params: id (Long) - Store ID
Response (StoreDto): Soft-deleted store object.
Headers: Authorization: Bearer <jwt>
Response: void (200 OK)
Base Path: api/v2/branch
Headers: Authorization: Bearer <jwt>
Request Body (BranchDto):
{
"name": "Main Branch",
"address": "123 MG Road, Bangalore",
"phone": "+91-9876543210",
"email": "mainbranch@example.com",
"workingDays": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY"
],
"openTime": "09:00:00",
"closeTime": "21:00:00"
}Response (BranchDto) - Status 201 CREATED:
{
"id": 1,
"name": "Main Branch-0000",
"address": "123 MG Road, Bangalore",
"phone": "+91-98765433440",
"email": "mainbranch1111@example.com",
"workingDays": [
"MONDAY",
"TUESDAY"
],
"openTime": "09:00:00",
"closeTime": "21:00:00",
"storeId": 1,
"managerId": 2,
"createdAt": "2026-03-24T20:51:34.88703",
"updatedAt": null
}Path Params: id (Long) - Branch ID
Request Body (BranchDto): Same as create request.
Response (BranchDto):
{
"id": 1,
"name": "Main Branch-0000",
"address": "123 MG Road, Bangalore",
"phone": "+91-98765433440",
"email": "mainbranch1111@example.com",
"workingDays": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY"
],
"openTime": "09:00:00",
"closeTime": "21:00:00",
"storeId": 1,
"managerId": 2,
"createdAt": "2026-03-24T20:51:34.88703",
"updatedAt": "2026-03-24T20:59:19.419873"
}Path Params: id (Long) - Branch ID
Response: "Branch deleted successfully" (200 OK)
Path Params: storeId (Long)
Response (List<BranchDto>):
[
{
"id": 1,
"name": "Main Branch-0000",
"address": "123 MG Road, Bangalore",
"phone": "+91-98765433440",
"email": "mainbranch1111@example.com",
"workingDays": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY"
],
"openTime": "09:00:00",
"closeTime": "21:00:00",
"storeId": 1,
"managerId": 2,
"createdAt": "2026-03-24T20:51:34.88703",
"updatedAt": "2026-03-24T20:59:19.419873"
}
]Path Params: id (Long) - Branch ID
Response (BranchDto): Single branch object.
Base Path: api/v2/products
Headers: Authorization: Bearer <jwt>
Request Body (ProductDto):
{
"name": "Demim Jeam spuaker",
"sku": "IPH15-128-JEN_SPK",
"description": "Latest Apple iPhone with A16 chip",
"mrp": 8000,
"sellingPrice": 7500,
"brand": "Apple",
"imageUri": "https://example.com/images/iphone15.png",
"storeId": 1,
"categoryId": 2
}Response (ProductDto):
{
"id": 2,
"name": "Demim Jeam spuaker",
"sku": "IPH15-128-JEN_SPK",
"description": "Latest Apple iPhone with A16 chip",
"mrp": 8000.0,
"sellingPrice": 7500.0,
"brand": "Apple",
"imageUri": "https://example.com/images/iphone15.png",
"storeId": 1,
"categoryId": 2,
"createdAt": "2026-03-24T22:07:45.79708",
"updatedAt": null
}Headers: Authorization: Bearer <jwt>
Path Params: id (Long) - Product ID
Request Body (ProductDto): Same as create request.
Response (ProductDto): Updated product object.
Headers: Authorization: Bearer <jwt>
Path Params: id (Long) - Product ID
Response: void (200 OK)
Path Params: storeId (Long)
Response (List<ProductDto>): Array of product objects.
[
{
"id": 1,
"name": "iPhone 15",
"sku": "IPH15-128-BLK",
"description": "Latest Apple iPhone with A16 chip",
"mrp": 80000.0,
"sellingPrice": 75000.0,
"brand": "Apple",
"imageUri": "https://example.com/images/iphone15.png",
"storeId": 1,
"categoryId": 1,
"createdAt": "2026-03-24T22:06:30.791294",
"updatedAt": null
},
{
"id": 2,
"name": "Demim Jeam spuaker",
"sku": "15-128-JEN_SPK",
"description": "Latest Deniem light blue",
"mrp": 8000.0,
"sellingPrice": 7500.0,
"brand": "Spyker",
"imageUri": "https://example.com/images/jenas03.png",
"storeId": 1,
"categoryId": 2,
"createdAt": "2026-03-24T22:07:45.79708",
"updatedAt": "2026-03-24T22:09:58.157634"
}
]Query Params:
| Param | Type | Description |
|---|---|---|
storeId |
Long | Store ID |
keyword |
String | Search keyword |
Response (List<ProductDto>): Array of matching product objects.
'http://localhost:8990/api/v2/products/search?storeId=1&keyword=128'Base Path: api/v2/categories
Headers: Authorization: Bearer <jwt>
Request Body (CategoryDto):
{
"name":"Fastions"
}Response (CategoryDto):
{
"id": 2,
"name": "Fastions",
"storeId": 1,
"createdAt": "2026-03-24T21:54:52.10756",
"updatedAt": "2026-03-24T21:54:52.107566"
}Path Params: storeId (Long)
Response (List<CategoryDto>):
[
{
"id": 1,
"name": "Electronics",
"storeId": 1,
"createdAt": "2026-03-24T21:54:26.429807",
"updatedAt": "2026-03-24T21:54:26.429818"
},
{
"id": 2,
"name": "Fastion",
"storeId": 1,
"createdAt": "2026-03-24T21:54:52.10756",
"updatedAt": "2026-03-24T21:54:52.107566"
}
]Headers: Authorization: Bearer <jwt>
Path Params: id (Long) - Category ID
Request Body (CategoryDto):
{
"name": "string",
"storeId": 1
}Response (CategoryDto): Updated category object.
Headers: Authorization: Bearer <jwt>
Path Params: id (Long) - Category ID
Response: void (200 OK)
Base Path: api/v2/inventory
Request Body (InventoryDto):
{
"branchId": 1,
"productId": 1,
"quantity": 100
}Response (InventoryDto) - Status 201 CREATED:
{
"id": 3,
"branchId": 1,
"productId": 2,
"quantity": 400,
"createdAt": "2026-03-25T19:54:15.797382",
"lastUpdated": "2026-03-25T19:55:02.012226"
}Path Params: id (Long) - Inventory ID
Request Body (InventoryDto):
{
"branchId": 1,
"productId": 1,
"quantity": 150
}Response (InventoryDto): Updated inventory object.
Path Params: id (Long) - Inventory ID
Response: void (204 No Content)
Path Params: id (Long) - Inventory ID
Response (InventoryDto): Single inventory object.
Query Params:
| Param | Type | Description |
|---|---|---|
productId |
Long | Product ID |
branchId |
Long | Branch ID |
Response (InventoryDto): Matching inventory object.
http://localhost:8990/api/v2/inventory/search?productId=2&branchId=1Path Params: branchId (Long)
Response (List<InventoryDto>): Array of inventory objects for the branch.
[
{
"id": 1,
"branchId": 1,
"productId": 1,
"quantity": 500,
"createdAt": null,
"lastUpdated": "2026-03-25T19:53:58.254156"
},
{
"id": 3,
"branchId": 1,
"productId": 2,
"quantity": 400,
"createdAt": "2026-03-25T19:54:15.797382",
"lastUpdated": "2026-03-25T19:55:02.012226"
}
]Base Path: api/v2/customer
Request Body (CustomerDto):
{
"fullName": "Vikas Arya",
"email": "vikasarya1889@gmail.com",
"phone": "+91-99833401454"
}Response (CustomerDto):
{
"id": 1,
"fullName": "Vikas Arya",
"email": "vikasarya1889@gmail.com",
"phone": "+91-99833401454",
"createdAt": "2026-03-25T19:26:04.664839",
"updatedAt": "2026-03-25T19:27:09.212938"
}Path Params: customerId (Long)
Request Body (CustomerDto): Same as create request.
Response (CustomerDto): Updated customer object.
Path Params: customerId (Long)
Response: void (200 OK)
Path Params: customerId (Long)
Response (CustomerDto): Single customer object.
Response (List<CustomerDto>): Array of customer objects.
Query Params:
| Param | Type | Description |
|---|---|---|
keyword |
String | Search keyword |
Response (List<CustomerDto>): Array of matching customer objects.
Base Path: api/v2/employees
Path Params: storeId (Long)
Request Body (UserDto):
{
"fullName": "string (required, max 100)",
"password": "string (required, min 8, max 100)",
"phone": "string (required, 10-15 digits)",
"email": "string (required, valid email)",
"role": "ROLE_STORE_MANAGER | ROLE_BRANCH_MANAGER | ROLE_CASHIER (required)"
}Response (UserDto) - Status 201 CREATED:
{
"id": 1,
"fullName": "string",
"phone": "string",
"email": "string",
"storeId": 1,
"branchId": null,
"role": "ROLE_STORE_MANAGER",
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00",
"lastLogin": null
}Path Params: branchId (Long)
Request Body (UserDto): Same as store employee create request.
Response (UserDto) - Status 201 CREATED: Same as above with branchId populated.
Path Params: id (Long) - Employee (User) ID
Request Body (UserDto): Same as create request.
Response (UserDto): Updated employee object.
Path Params: id (Long) - Employee (User) ID
Response: void (204 No Content)
Path Params: storeId (Long)
Query Params:
| Param | Type | Required | Description |
|---|---|---|---|
role |
UserRole | No | Filter by role |
Response (List<UserDto>): Array of employee objects.
Path Params: branchId (Long)
Query Params:
| Param | Type | Required | Description |
|---|---|---|---|
role |
UserRole | No | Filter by role |
Response (List<UserDto>): Array of employee objects.
Base Path: api/v2/orders
Request Body (OrderDto):
{
"branchId": 1,
"cashierId": 1,
"customerId": 1,
"paymentType": "CASH | CARD | UPI",
"orderStatus": "Pending | Complete",
"items": [
{
"productId": 1,
"quantity": 2,
"price": 90.0
}
]
},
{
"branchId": 1,
"cashierId": 2,
"customerId": 2,
"paymentType": "UPI",
"items": [
{
"productId": 1,
"quantity": 2,
"price": 1500.0
}
]
}Response (OrderDto):
{
"id": 1,
"totalAmount": 180.0,
"createdAt": "2025-01-01T00:00:00",
"branch": { "id": 1, "name": "string" },
"cashier": { "id": 1, "fullName": "string" },
"customer": { "id": 1, "fullName": "string" },
"branchId": 1,
"cashierId": 1,
"customerId": 1,
"paymentType": "CASH",
"orderStatus": "Pending",
"items": [
{
"id": 1,
"quantity": 2,
"price": 90.0,
"productId": 1,
"orderId": 1
}
]
},
{
"id": 52,
"totalAmount": 150000.0,
"createdAt": "2026-03-25T21:35:42.600225",
"branch": null,
"cashier": null,
"customer": null,
"branchId": 1,
"cashierId": 2,
"customerId": 2,
"paymentType": "UPI",
"orderStatus": null,
"items": [
{
"id": 52,
"quantity": 2,
"price": 75000.0,
"product": null,
"productId": 1,
"orderId": 52
}
]
}Path Params: id (Long) - Order ID
Response (OrderDto): Single order object.
Path Params: branchId (Long)
Query Params:
| Param | Type | Required | Description |
|---|---|---|---|
customerId |
Long | No | Filter by customer |
cashierId |
Long | No | Filter by cashier |
paymentType |
PaymentType | No | Filter by payment type |
orderStatus |
OrderStatus | No | Filter by order status |
Response (List<OrderDto>): Array of order objects.
Path Params: cashierId (Long)
Response (List<OrderDto>): Array of order objects.
Path Params: customerId (Long)
Response (List<OrderDto>): Array of order objects.
Path Params: branchId (Long)
Response (List<OrderDto>): Array of today's order objects.
Path Params: branchId (Long)
Response (List<OrderDto>): Array of recent order objects.
Path Params: id (Long) - Order ID
Response: void (200 OK)
Base Path: api/v2/refund
Request Body (RefundDto):
{
"orderId": 1,
"reason": "string",
"amount": 50.0,
"shiftReportId": 1,
"cashierId": 1,
"branchId": 1,
"paymentType": "CASH | CARD | UPI"
}Response (RefundDto):
{
"id": 1,
"order": { "id": 1 },
"orderId": 1,
"reason": "string",
"amount": 50.0,
"shiftReport": { "id": 1 },
"shiftReportId": 1,
"cashier": { "id": 1, "fullName": "string" },
"cashierId": 1,
"branch": { "id": 1, "name": "string" },
"branchId": 1,
"paymentType": "CASH",
"createdAt": "2025-01-01T00:00:00",
"updatedAt": "2025-01-01T00:00:00"
}Response (List<RefundDto>): Array of refund objects.
Path Params: refundId (Long)
Response (RefundDto): Single refund object.
Path Params: cashierId (Long)
Response (List<RefundDto>): Array of refund objects.
Path Params: shiftReportId (Long)
Response (List<RefundDto>): Array of refund objects.
Path Params: branchId (Long)
Response (List<RefundDto>): Array of refund objects.
Path Params: cashierId (Long)
Query Params:
| Param | Type | Description |
|---|---|---|
startDate |
LocalDateTime | Start date (ISO format) |
endDate |
LocalDateTime | End date (ISO format) |
Response (List<RefundDto>): Array of refund objects in the date range.
Path Params: refundId (Long)
Response: void (200 OK)
Base Path: api/v2/shift_reports
Query Params:
| Param | Type | Description |
|---|---|---|
cashierId |
Long | Cashier (User) ID |
branchId |
Long | Branch ID |
shiftStartTime |
LocalDateTime | Shift start time (ISO format) |
http://localhost:8990/api/v2/shift_reports/start?cashierId=2&branchId=1&shiftStartTime=2026-03-25T10:00:00Response (ShiftReportDto):
{
"branch": {
"id": 1,
"name": "Main Branch-0000",
"address": "123 MG Road, Bangalore",
"phone": "+91-98765433440",
"email": "mainbranch1111@example.com",
"workingDays": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY"
],
"openTime": "09:00:00",
"closeTime": "21:00:00",
"storeId": 1,
"managerId": 2,
"createdAt": "2026-03-24T20:51:34.88703",
"updatedAt": "2026-03-24T20:59:19.419873"
},
"branchId": 1,
"cashier": {
"id": 2,
"fullName": "test0",
"password": null,
"phone": "9983340000",
"email": "test0@gmail.com",
"storeId": null,
"branchId": null,
"role": "ROLE_ADMIN",
"createdAt": null,
"updatedAt": null,
"lastLogin": "2026-03-25T19:33:57.893954"
},
"cashierId": 2,
"createdAt": "2026-03-25T20:17:05.209484",
"id": 1,
"netSales": null,
"paymentSummeries": null,
"recentOrders": null,
"refunds": null,
"shiftEnd": null,
"shiftStart": "2026-03-25T20:17:05.112954",
"topSellingProducts": null,
"totalOrders": null,
"totalSales": null,
"updatedAt": null
}Path Params: shiftReportId (Long)
Query Params:
| Param | Type | Description |
|---|---|---|
shiftEndTime |
LocalDateTime | Shift end time (ISO format) |
Response (ShiftReportDto): Completed shift report with calculated totals.
Path Params: id (Long)
Response (ShiftReportDto): Single shift report object.
Response (List<ShiftReportDto>): Array of shift report objects.
Path Params: branchId (Long)
Response (List<ShiftReportDto>): Array of shift report objects.
Path Params: cashierId (Long)
Response (List<ShiftReportDto>): Array of shift report objects.
Path Params: cashierId (Long)
Response (ShiftReportDto): Current active shift report with live data.
Path Params: cashierId (Long)
Query Params:
| Param | Type | Description |
|---|---|---|
date |
LocalDateTime | Date to query (ISO format) |
Response (ShiftReportDto): Shift report for the given date.
| Value | Description |
|---|---|
ROLE_ADMIN |
System administrator |
ROLE_STORE_MANAGER |
Store manager |
ROLE_BRANCH_MANAGER |
Branch manager |
ROLE_CASHIER |
Cashier |
ROLE_CLIENT |
Client |
| Value | Description |
|---|---|
ACTIVE |
Store is active |
CLOSED |
Store is closed |
OPEN |
Store is open |
BLOCKED |
Store is blocked |
PENDING |
Store is pending approval |
| Value | Description |
|---|---|
Pending |
Order is pending |
Complete |
Order is completed |
| Value | Description |
|---|---|
CASH |
Cash payment |
CARD |
Card payment |
UPI |
UPI payment |
Table: users
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
fullName |
String | Required, Max 100 |
password |
String | Required, Min 8, Max 100 |
phone |
String | Required, Unique, 10-15 digits |
email |
String | Required, Unique, Valid email |
role |
UserRole (Enum) | Required |
createdAt |
LocalDateTime | Auto set, Not updatable |
updatedAt |
LocalDateTime | Auto updated |
lastLogin |
LocalDateTime | Nullable |
Relationships:
store→ One-to-One with Storebranch→ Many-to-One with Branch
Table: stores
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
brand |
String | Required |
storeType |
String | Required |
description |
String | Max 500, Optional |
status |
StoreStatus (Enum) | Required, Defaults to PENDING |
contact |
StoreContact (Embedded) | Embedded object |
createdAt |
LocalDateTime | Auto set, Not updatable |
updatedAt |
LocalDateTime | Auto updated |
Relationships:
storeAdmin→ One-to-One with User (Required, Unique)
Embedded in Store
| Field | Type | Constraints |
|---|---|---|
address |
String | Required |
phone |
String | Required, 10-15 digits |
email |
String | Required, Valid email |
Table: branches
Unique Constraint: (name, store_id)
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
name |
String | Required, Max 150 |
address |
String | Required, Max 300 |
phone |
String | Required, Max 20 |
email |
String | Valid email, Optional |
workingDays |
List<String> | Element Collection |
openTime |
LocalTime | Required |
closeTime |
LocalTime | Required |
createdAt |
LocalDateTime | Auto set, Not updatable |
updatedAt |
LocalDateTime | Auto updated |
Relationships:
store→ Many-to-One with Store (Required)manager→ One-to-One with User (Unique, Cascade Remove)
Table: categories
Unique Constraint: (name, store_id)
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
name |
String | Required, Max 100 |
createdAt |
LocalDateTime | Auto set, Not updatable |
updatedAt |
LocalDateTime | Auto updated |
Relationships:
store→ Many-to-One with Store (Required)
Table: products
Unique Constraint: (sku)
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
name |
String | Required, Max 150 |
sku |
String | Required, Unique, Max 100 |
description |
String | Max 500, Optional |
mrp |
Double | Required, Positive |
sellingPrice |
Double | Required, Positive |
brand |
String | Max 100, Optional |
imageUri |
String | Optional |
createdAt |
LocalDateTime | Auto set, Not updatable |
updatedAt |
LocalDateTime | Auto updated |
Relationships:
category→ Many-to-One with Category (Required)store→ Many-to-One with Store (Required)
Table: inventories
Unique Constraint: (branch_id, product_id)
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
quantity |
Integer | Required, Defaults to 0 |
createdAt |
LocalDateTime | Auto set, Not updatable |
lastUpdated |
LocalDateTime | Required, Auto updated |
Relationships:
branch→ Many-to-One with Branch (Required)product→ Many-to-One with Product (Required)
Table: customers
Unique Constraint: (email)
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
fullName |
String | Required |
email |
String | Required, Unique |
phone |
String | Required, Max 15 |
createdAt |
LocalDateTime | Auto set |
updatedAt |
LocalDateTime | Auto updated |
Table: orders
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
totalAmount |
Double | Nullable |
paymentType |
PaymentType (Enum) | Nullable |
orderStatus |
OrderStatus (Enum) | Nullable |
createdAt |
LocalDateTime | Auto set |
Relationships:
branch→ Many-to-One with Branchcashier→ Many-to-One with Usercustomer→ Many-to-One with Customeritems→ One-to-Many with OrderItem (Cascade ALL, Orphan Removal)
Table: order_items
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
quantity |
Integer | Nullable |
price |
Double | Nullable |
Relationships:
product→ Many-to-One with Productorder→ Many-to-One with Order
Table: refunds
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
reason |
String | Nullable |
amount |
Double | Nullable |
paymentType |
PaymentType (Enum) | Nullable |
createdAt |
LocalDateTime | Auto set |
updatedAt |
LocalDateTime | Auto updated |
Relationships:
order→ Many-to-One with OrdershiftReport→ Many-to-One with ShiftReportcashier→ Many-to-One with Userbranch→ Many-to-One with Branch
Table: shift_reports
| Field | Type | Constraints |
|---|---|---|
id |
Long | Primary Key, Auto Generated |
shiftStart |
LocalDateTime | Nullable |
shiftEnd |
LocalDateTime | Nullable |
totalSales |
Double | Nullable |
netSales |
Double | Total sales minus refunds |
totalOrders |
Integer | Nullable |
createdAt |
LocalDateTime | Auto set |
updatedAt |
LocalDateTime | Auto updated |
Relationships:
cashier→ Many-to-One with Userbranch→ Many-to-One with BranchtopSellingProducts→ One-to-Many with ProductrecentOrders→ One-to-Many with Order (Cascade ALL)refunds→ One-to-Many with Refund (Cascade ALL, Mapped byshiftReport)paymentSummeries→ List<PaymentSummery> (Transient, not persisted)
Non-entity (POJO) — used as a transient field in ShiftReport
| Field | Type | Description |
|---|---|---|
type |
PaymentType (Enum) | Payment method |
totalAmount |
Double | Total amount for this type |
transactionCount |
Integer | Number of transactions |
presentage |
Double | Percentage of total |

