import '../entities/pantry_item.dart'; import '../entities/shopping_list_item.dart'; /// Persistence contract for the pantry bounded context: on-hand inventory /// plus the shopping checklist. /// /// The presentation and domain layers depend only on this interface; the /// drift-backed implementation lives in `data/repositories/` so widgets, /// controllers, and use cases remain testable with in-memory fakes. abstract class IPantryRepository { /// Emits pantry stock (alphabetical) whenever it changes. Stream> watchItems(); /// One-shot snapshot of pantry stock (alphabetical). Future> getItems(); /// The inventory row with [id], or `null` when absent. Future getItem(String id); /// Inserts or updates [item] (keyed by `PantryItem.id`). Future saveItem(PantryItem item); /// Removes the inventory row with [id], if present. Future deleteItem(String id); /// Emits the shopping checklist (unchecked rows first) whenever it changes. Stream> watchShoppingList(); /// One-shot snapshot of the shopping checklist (unchecked first). Future> getShoppingList(); /// The checklist row with [id], or `null` when absent. Future getShoppingListItem(String id); /// Inserts or updates [item] (keyed by `ShoppingListItem.id`). Future saveShoppingListItem(ShoppingListItem item); /// Removes the checklist row with [id], if present. Future deleteShoppingListItem(String id); }