Package Master — Add/Edit Form

By Engineering Team•October 9, 2026•3 min read

Package Master add/edit form, showing the dimension and weight sections

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 as DRAFT.
  • Update (editing) calls PUT /inventory/admin/api/v1/package-masters/:id.
  • Publish (primary button, while DRAFT) follows the PUT with a separate POST /inventory/admin/api/v1/package-masters/:id/publish call.
  • 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.