Skip to content

Pantry CRUD SERVICE - UPDATE and DELETE SINGLE ITEMS  #2

@staticvoidmainmaui

Description

@staticvoidmainmaui

THIS IS part of the BACKEND series:

Add a new pantry item (name, quantity, expiry date)- DONE !
Update an item (quantity, expiry, notes)
Delete a single item

MAYBE: CLEAR ALL ITEMS FROM PANTRY

PART OF BUILD PANTRY MANUAL PATH
(OCR receipt → parse items → build pantry → match recipes)

Implementation Details:

pantry_service.py:

list_items(uid: str) → list[PantryItem]
add_item(uid: str, item: PantryItemCreate) → PantryItem
update_item(uid: str, item_id: str, updates: PantryItemUpdate) → PantryItem
delete_item(uid: str, item_id: str) → None
clear_all(uid: str) → None
pantry.py:

POST /pantry/ → add (201)
PATCH /pantry/{item_id} → update
DELETE /pantry/{item_id} → delete (204)
DELETE /pantry/ → clear all (204)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions