Master data management Β· features 286-305
πŸ›’οΈ SQL Server Β· MasterDataLabDB
🚦

289Statuses

Statuses of each document type, with color and first / final flags.

Try it

Workflow

Statuses (status_def) and the allowed moves between them (status_transition)
Draft ● β†’ Issue β†’ ISSUEDβ†’ Void β†’ VOID
Issued → Receive all → PAID→ Receive part → PARTIAL→ Void → VOID
Partly paid β†’ Receive rest β†’ PAID
Paid final - no further moves
Void final - no further moves
βœ• Clear
# Document type Code Name Color Sort order First status Final status Status
8 INVOICE DRAFT Draft #64748b 1 βœ“ Active ✏️
9 INVOICE ISSUED Issued #2563eb 2 Active ✏️
10 INVOICE PARTIAL Partly paid #f59e0b 3 Active ✏️
11 INVOICE PAID Paid #16a34a 4 βœ“ Active ✏️
12 INVOICE VOID Void #dc2626 5 βœ“ Active ✏️
1 ORDER DRAFT Draft #64748b 1 βœ“ Active ✏️
2 ORDER SUBMITTED Submitted #2563eb 2 Active ✏️
3 ORDER APPROVED Approved #16a34a 3 Active ✏️
4 ORDER REJECTED Rejected #dc2626 4 Active ✏️
5 ORDER SHIPPED Shipped #0891b2 5 Active ✏️
6 ORDER COMPLETED Completed #15803d 6 βœ“ Active ✏️
7 ORDER CANCELLED Cancelled #475569 7 βœ“ Active ✏️
Showing 1–12 of 12
πŸŽ“ Learn: how this master is built table status_def
  • A composite UNIQUE key (entity_type, code) lets ORDER and INVOICE both have a DRAFT status.
  • StatusService.validateStatus(): only one first status per document type.
Entity
domain/StatusDef.java
Repository
repo/StatusDefRepository.java
Definition
MasterRegistry: "statuses"
Page / form
web/MasterController.java
Try-it panel
templates/tools/workflow.html
REST API
GET /api/status/ORDER/next?from=DRAFT
SELECT entity_type, code, name, initial_status, final_status FROM status_def ORDER BY entity_type, sort_order;