feat: add low-stock threshold field to EditItemModal (#67)

This commit is contained in:
Pantry Lead Agent
2026-02-25 01:23:40 +00:00
parent 1ed51c3667
commit bd000649e3

View File

@@ -55,6 +55,21 @@
/>
</UFormGroup>
<!-- Low Stock Threshold -->
<UFormGroup
label="Low Stock Alert"
hint="Optional - Alert when quantity falls below this"
>
<UInput
v-model.number="form.low_stock_threshold"
type="number"
min="0"
step="0.1"
placeholder="e.g. 2"
size="lg"
/>
</UFormGroup>
<!-- Notes -->
<UFormGroup label="Notes" hint="Optional">
<UTextarea
@@ -112,6 +127,7 @@ const form = reactive({
quantity: 1,
unit_id: '',
expiry_date: '',
low_stock_threshold: null as number | null,
notes: ''
})
@@ -136,6 +152,7 @@ watch(() => props.item, (newItem) => {
form.quantity = Number(newItem.quantity)
form.unit_id = newItem.unit_id
form.expiry_date = newItem.expiry_date || ''
form.low_stock_threshold = newItem.low_stock_threshold || null
form.notes = newItem.notes || ''
isOpen.value = true
}
@@ -168,6 +185,7 @@ const handleSubmit = async () => {
quantity: form.quantity,
unit_id: form.unit_id,
expiry_date: form.expiry_date || null,
low_stock_threshold: form.low_stock_threshold,
notes: form.notes.trim() || null
})