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

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

View File

@@ -57,6 +57,21 @@
/> />
</UFormGroup> </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 --> <!-- Notes -->
<UFormGroup label="Notes" hint="Optional"> <UFormGroup label="Notes" hint="Optional">
<UTextarea <UTextarea
@@ -121,6 +136,7 @@ const form = reactive({
quantity: 1, quantity: 1,
unit_id: '', unit_id: '',
expiry_date: '', expiry_date: '',
low_stock_threshold: null as number | null,
notes: '' notes: ''
}) })
@@ -210,6 +226,7 @@ const handleSubmit = async () => {
quantity: form.quantity, quantity: form.quantity,
unit_id: form.unit_id, unit_id: form.unit_id,
expiry_date: form.expiry_date || null, expiry_date: form.expiry_date || null,
low_stock_threshold: form.low_stock_threshold,
notes: form.notes.trim() || null notes: form.notes.trim() || null
}) })