Management: add new inventory item modal on stok page #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
There is no UI to create inventory items. The only write entry point is the stock adjustment modal. Staff must use the API or SQL to add new products, which is not practical for day-to-day catalog management.
Target
apps/management/app/(dashboard)/stok/page.tsxapps/management/app/(dashboard)/stok/add-inventory-modal.tsxChange
AddInventoryModalclient component (add-inventory-modal.tsx) that opens aFormDialogwith fields:createInventoryserver action; on success close dialog, callrouter.refresh(), toast success; on error toast the error message.page.tsxalongside the existingAdjustmentModalin the pageactionprop — use anAdd01Icontrigger button consistent with the pattern in other pages (e.g. pelanggan, order).Patterns to follow
AdjustmentModalfor component shape.FormDialog,FormField,FormInput,FormSelectfrom@/components/ui/form-field.createInventoryfrom@/lib/inventory/actions.Acceptance
createInventory.is_published: truewithout slug is disabled in the UI.tsc --noEmitandbiome checkpass.stok/.