InventoryOrder
The InventoryOrder entity, mapped to the inventory_order table.
| Table | inventory_order |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 7 |
| Relationships | 2 |
| Source | backend/src/main/java/com/motorph/payroll/model/InventoryOrder.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
orderId | Integer | order_id | — | primary key, generated |
orderNo | String | order_no | — | unique |
title | String | title | — | — |
description | String | description | Yes | — |
status | String | status | — | — |
createdAt | LocalDateTime | created_at | — | — |
updatedAt | LocalDateTime | updated_at | — | — |
Plus tenant_id, inherited from TenantOwned. Hibernate stamps it on insert and adds where tenant_id = ? to every query, so it is never written or read by application code.
Relationships
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
createdBy | @ManyToOne | User | created_by | — |
stages | @OneToMany | OrderStage | mapped by order | — |
Referenced by
| Entity | Field | Kind |
|---|---|---|
| OrderStage | order | @ManyToOne |
Neighbourhood
Repository
InventoryOrderRepository
Declared over InventoryOrder with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/InventoryOrderRepository.java
| Method | Returns | Notes |
|---|---|---|
countByCreatedAtBetween(LocalDateTime from, LocalDateTime to) | long | derived |
Reached by
These controllers hold — directly or through a service they depend on — a repository over InventoryOrder.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| OrderController | /api/inventory/orders | 6 | Inventory & Portal |
Generated page
This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.