feat: add expiry tracking and low-stock threshold (#63 #67) #70

Merged
makiolaj merged 6 commits from feature/issue-63-67-expiry-lowstock-fields into develop 2026-02-25 01:24:26 +00:00
Showing only changes of commit 8a9f8f7fdd - Show all commits

View File

@@ -72,6 +72,18 @@
{{ expiryText }} {{ expiryText }}
</UBadge> </UBadge>
</div> </div>
<!-- Low Stock Warning -->
<div v-if="isLowStock" class="text-xs">
<UBadge
color="orange"
variant="soft"
class="w-full justify-center"
>
<UIcon name="i-heroicons-exclamation-triangle" class="mr-1" />
Low stock ({{ item.quantity }}/{{ item.low_stock_threshold }})
</UBadge>
</div>
</div> </div>
<!-- Action Buttons --> <!-- Action Buttons -->
@@ -145,4 +157,10 @@ const expiryText = computed(() => {
if (daysUntilExpiry.value === 1) return 'Expires tomorrow' if (daysUntilExpiry.value === 1) return 'Expires tomorrow'
return `Expires in ${daysUntilExpiry.value} days` return `Expires in ${daysUntilExpiry.value} days`
}) })
// Low stock detection
const isLowStock = computed(() => {
if (!props.item.low_stock_threshold) return false
return Number(props.item.quantity) <= Number(props.item.low_stock_threshold)
})
</script> </script>