Inventory Dialogs & Mutations
Inventory write operations are implemented as dialogs that are controlled by the board and own their own form/query/mutation logic.
Dialog collection
InventoryDialogs is a pure “dialog switchboard”
component: - It receives open/close props for each dialog. - It
receives selectedRow from the board. - It receives
isDemo to enforce read-only demo behavior.
Dialogs and workflows
Create / Edit (ItemFormDialog)
- Component:
dialogs/ItemFormDialog/ItemFormDialog.tsx - Mode:
- Create mode when
initialis undefined - Edit mode when
initial.idexists
- Create mode when
Characteristics: - Title and submit button label change based
on mode. - Submission state is tracked
(formState.isSubmitting). - Help is opened via a
hash route (e.g. #/help?section=create_item).
Rename item (EditItemDialog)
- Component:
dialogs/EditItemDialog/EditItemDialog.tsx - Guided workflow:
- select supplier
- search/select item
- enter new name
- submit
Notes: - The code documents it as an ADMIN-only operation; the backend is the source of truth for authorization.
Adjust quantity (QuantityAdjustDialog)
- Component:
dialogs/QuantityAdjustDialog/QuantityAdjustDialog.tsx - Guided workflow:
- select supplier
- select item
- enter new quantity
- choose a reason
- submit
Notes: - The submit button is disabled unless an item is
selected. - The dialog accepts readOnly to block
mutation in demo mode.
Change price (PriceChangeDialog)
- Component:
dialogs/PriceChangeDialog/PriceChangeDialog.tsx - Guided workflow:
- select supplier
- select item
- enter new price
- submit
Notes: - The dialog accepts readOnly to block
mutation in demo mode.
Delete item (DeleteItemDialog)
- Component:
dialogs/DeleteItemDialog/DeleteItemDialog.tsx - Two-step flow:
- Form dialog: supplier → item → reason
- Confirmation dialog: warning + final confirmation
Notes: - Backend requires quantity to be 0
before allowing deletion. - Marked as ADMIN-only in code docs. -
readOnly is supported for demo sessions.
Reload behavior
All dialogs accept a callback (onSaved,
onAdjusted, onPriceChanged,
onItemDeleted, etc.). The board wires these to a
single “reload” handler so the table refreshes after
mutations.