using Fitness_core_BE.Models; namespace Fitness_core_BE.Interfaces { public interface IBookingRepository { Task CreateBooking(Booking booking); Task GetBookingById(Guid bookingId); // "Confirmed" only -- an OTP that's already been used/cancelled shouldn't check anyone in. Task GetActiveBookingByOtp(string otpCode); Task> GetBookingsForSession(Guid facilitySessionId); Task> GetBookingsForCustomer(Guid customerId); Task CustomerHasActiveBookingForSession(Guid facilitySessionId, Guid customerId); /// Unified roster query covering both Scheduled and AdHoc bookings -- backs /// GET api/client/bookings. All filters are optional/AND-combined. Task> GetBookings(Guid clientId, Guid? facilityId, Guid? facilitySessionId, DateTime? fromUtc, DateTime? toUtc, string? status); // --- Lazy overdue reconciliation (BookingService.SweepOverdueBookingsAsync), run at the // top of every check-in AND every checkout instead of a background job -- see // Booking.Status doc comment. --- /// Bulk-flips every Confirmed booking for this client whose EndTime has passed /// to NoShow. Returns the number of rows affected (informational/logging only). Task MarkOverdueConfirmedAsNoShowAsync(Guid clientId, DateTime now); /// Atomically flips a tag from Available to InUse -- the ONE place a real race /// matters (two staff picking the same tag for two different bookings must not both /// win), so this uses a conditional bulk update rather than read-then-write. Returns /// false if the tag was no longer Available. Task TryClaimRfidTagAsync(Guid tagId, DateTime now); // --- Booking invoices (snapshot receipts created when a payment is recorded) --- Task CreateBookingInvoice(BookingInvoice invoice); /// Listed on their own "Invoices" tab -- deliberately not mixed into the /// membership-based Customer Payments view. Task> GetBookingInvoices(Guid clientId, DateTime? fromUtc, DateTime? toUtc); Task GetBookingInvoiceById(Guid bookingInvoiceId); /// Aggregate counts/sums backing the Bookings page's Dashboard tab. Task<(int bookingsToday, decimal revenueToday, int checkedInNow, int upcomingConfirmed, decimal outstandingUnpaid)> GetDashboardSummaryAsync(Guid clientId, DateTime now); } }