import '../entities/dose_entry.dart'; /// Persistence contract for the medication bounded context. /// /// The presentation layer depends only on this interface; the drift-backed /// implementation lives in `data/repositories/` so widgets and controllers /// remain testable with in-memory fakes. abstract class IMedicationRepository { /// Emits the full dose history (newest first) whenever it changes. Stream> watchDoseEntries({int limit = 500}); /// One-shot snapshot of the dose history (newest first). Future> getDoseEntries({int limit = 500}); /// Persists [entry]; when [DoseEntry.id] is `null` a new row is inserted, /// otherwise the existing row is updated. Returns the stored entry with its /// database-assigned identifier. Future saveDoseEntry(DoseEntry entry); /// Removes the entry with [id], if present. Future deleteDoseEntry(int id); /// Most recent actually-administered dose, or `null` on an empty history. Future getLatestAdministeredDose(); }