Architecture — Package Master: Administration Console
By Engineering Team•October 9, 2026•5 min read
| Metadata | Details |
|---|---|
| System | inventory-service — Package Master |
| Document ID | ARCH-2026-INV-004 |
| Author | Engineering Team |
| Status | Approved |
Implements SR-023, per the lifecycle decision in ADR-00037.
Components
| Component | Language/Runtime | Role |
|---|---|---|
PackageMasterPage.tsx |
React (admin UI) | List + filter packaging types |
pages/PackageMasterFormPage.tsx / pages/PackageMasterFormController.ts |
React (admin UI) | Create/edit form (Basic Info, External/Internal Dimensions, Weight & Capacity) |
PackageMasterRepository.ts |
React/Axios (admin UI) | Sole apiClient consumer for this feature |
transport/api/packagemaster/ |
Go (Echo REST) | inventory-service’s package-master controller |
service/packagemaster/ |
Go | Lifecycle transitions and validation orchestration |
repository/packagemaster/ |
Go (PostgreSQL) | "inventory-service".package_master persistence |
product-catalog (consumer) |
Go | Product wizard Step 8 reads published packaging types for sku_box_mapping |
End-to-end flow (A) — Create and publish a packaging type
- Admin fills Basic Info/External Dimensions/Internal Dimensions/Weight & Capacity in
PackageMasterFormPage.tsx(SR-023 FR-02–FR-05) and submits. PackageMasterRepository.tscallsPOST /inventory/admin/api/v1/package-masters.transport/api/packagemaster/maps the request and callsservice/packagemaster/Create, which validates every field viadomain/packagemaster_validation.go(SR-023 FR-06) before inserting the row (status = DRAFT) viarepository/packagemaster/.- Once ready, the admin calls
POST .../:id/publish, transitioningstatustoPUBLISHED(SR-023 FR-09).
End-to-end flow (B) — Archive / Delete
- Archive (
PATCH .../:id/archive): transitions aPUBLISHEDrow toARCHIVED(SR-023 FR-10). - Delete (
DELETE .../:id,DRAFTonly): removes the row entirely (SR-023 FR-11) — no compensating external call is needed, since every field is local to this table.
End-to-end flow (C) — Downstream consumption
product-catalog’s product-setup wizard Step 8 (“Package Map”) readsPUBLISHEDpackaging types and writes the admin’s chosen mapping intosku_box_mapping.box_id(SR-023 FR-12).- At checkout, the volumetric-weight calculation resolves a SKU’s assigned packaging type, computes
(ext_length × ext_width × ext_height) / 5000 + tare_weight, and uses the larger of that result and the SKU’s actual weight for shipping-cost purposes.
Why this is simple, and what it does not yet guarantee
Package Master has no external service dependency — every field it owns is fully local to "inventory-service".package_master, so its create/publish/archive/delete flows are single-service, single-transaction operations with no compensating-write concern the way Warehouse Master’s PII split has.
This flow does not yet guarantee that package_material_type can only ever hold one of its four intended values — that constraint exists only in domain/packagemaster_validation.go, not as a database CHECK constraint, so a write that bypasses this service’s own validation path could persist an unrecognized value. Tracked in Technical Debt — TD-00017.
Related Documents
- BRD-022 — Package Master: Maintaining the Catalog of Shippable Container Types
- SR-023 — Package Master: Administration System Requirements
- ADR-00037 — DRAFT/PUBLISHED/ARCHIVED Lifecycle for Admin-Maintained Master Data
- Architecture — Warehouse Master: Administration Console and PII-Backed Address Storage — the sibling master-data feature sharing the lifecycle this doc’s flow (A)/(B) implement
- Technical Debt — Package Master Gaps
- Admin UI Walkthrough — Package Master
- Microservices: inventory-service