import '../entities/customer.dart'; import '../entities/transaction.dart'; abstract class TransactionRepository { /// Persists a completed sale as one atomic unit. /// /// The bill, the stock it consumed and the shopper's loyalty movement either /// all land or none do, so a failure part-way through can never leave a /// persisted bill that the cashier believes failed. Future commitSale({ required SaleTransaction transaction, required Map stockMovements, Customer? updatedCustomer, }); Future> history({int limit = 50}); Future findByInvoice(String invoiceNumber); /// Next invoice sequence for the current month. Future nextInvoiceSequence(); Future park(ParkedBill bill); Future> parkedBills(); Future removeParked(String id); Future salesTotalForDay(DateTime day); }