Package Master — Add/Edit Form

What the admin sees
pages/PackageMasterFormPage.tsx, built on the shared MasterFormPage shell. Fields are grouped into four sections:
- Basic Info — Package Code, Package Name (both required text), Material Type (a dropdown: Box / Flyer / Poly Bag / Wrapper, defaults to Box).
- External Dimensions (CM) — Length, Width, Height — three required numeric fields.
- Internal Dimensions (CM) — Length, Width, Height — three required numeric fields.
- Weight & Capacity (KG) — Tare Weight, Max Weight — two required numeric fields.
The primary button’s label follows the same convention as Warehouse Master: “Create Draft” on a new package type, “Publish” when editing a DRAFT entry, “Save Changes” once PUBLISHED/ARCHIVED. A secondary “Save Draft” button appears only while editing a DRAFT entry.
What the admin does here
Submitting validates all eleven fields non-empty, then checks each of the eight dimension/weight fields parses to a non-negative number — every one of them (except Tare Weight) must additionally be greater than zero; Tare Weight alone may be 0. The same full validation runs for both Save Draft and Publish — no lighter draft-only tier. Unlike Warehouse Master, this validation set is matched exactly on the backend (inventory-service’s own domain validation), not client-only.
- Create calls
POST /inventory/admin/api/v1/package-masters, always inserted asDRAFT. - Update (editing) calls
PUT /inventory/admin/api/v1/package-masters/:id. - Publish (primary button, while
DRAFT) follows the PUT with a separatePOST /inventory/admin/api/v1/package-masters/:id/publishcall. - Archive / Republish / Delete are offered as lifecycle actions depending on current status, identical rules to Warehouse Master.
Edit-mode pre-fill does a fresh GET /inventory/admin/api/v1/package-masters/:id, since the list response omits internal dimensions and tare weight.
Unlike Warehouse Master, every field here is fully local to inventory-service — there is no pii-service round-trip, since a packaging type carries no personal data.
Related Documents
- SR-023 FR-02 – FR-12 — field rules, lifecycle, downstream consumers (product-catalog Step 8, checkout volumetric calc)
- ADR-00037 — Draft/Published/Archived Lifecycle for Admin Master Data
- Architecture — Package Master Administration Console
- Technical Debt — Package Master Gaps — missing DB
CHECKconstraint on material type - Microservices: inventory-service, product-catalog
- Previous: Package Master List — Status Filter & Search