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 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); /// Every CheckedIn booking for this client whose EndTime has passed and hasn't /// been checked out yet, with its RfidTag eagerly loaded so the caller can complete + /// release the tag on the same tracked graph in one SaveChanges. Task> GetOverdueCheckedInBookingsAsync(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); } }