CRITICAL: bulk-add-by-name always fails — source="shopping" violates DB CHECK constraint #89
Labels
No labels
accessibility
backlog
beta-feedback
bug
duplicate
enhancement
feature-request
help wanted
invalid
needs-design
needs-triage
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/kiwi#89
Loading…
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?
Summary
The
POST /api/v1/inventory/items/bulk-add-by-nameendpoint always fails for all items. The endpoint (and its underlying store call) hardcodessource="shopping"when creating products and inventory items, but the DB CHECK constraint only allows specific source values.DB Constraints
products.source:CHECK (source IN ('openfoodfacts', 'manual', 'receipt_ocr'))inventory_items.source:CHECK (source IN ('barcode_scan', 'manual', 'receipt'))Affected Code
app/api/endpoints/inventory.py—bulk_add_items_by_name():Fix
Change
source="shopping"tosource="manual"in both calls:Verified