feat: Enhance booking functionality with invoice management and dashboard summary
- Added customerId to guest booking requests for better identification. - Implemented new endpoints for managing booking invoices and dashboard summaries. - Created BookingInvoice and BookingDashboardSummary DTOs to support new features. - Updated Booking and BookingInvoice models to include payment method and timestamps. - Enhanced BookingService to handle invoice creation upon payment confirmation. - Modified BookingRepository to support CRUD operations for BookingInvoice. - Updated TenantDbContext to include BookingInvoice DbSet and relevant configurations. - Improved error handling and validation for booking completion and payment processes.
This commit is contained in:
@@ -19,21 +19,31 @@ namespace Fitness_core_BE.Interfaces
|
||||
Task<List<Booking>> 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. ---
|
||||
// top of every check-in AND every checkout instead of a background job -- see
|
||||
// Booking.Status doc comment. ---
|
||||
|
||||
/// <summary>Bulk-flips every Confirmed booking for this client whose EndTime has passed
|
||||
/// to NoShow. Returns the number of rows affected (informational/logging only).</summary>
|
||||
Task<int> MarkOverdueConfirmedAsNoShowAsync(Guid clientId, DateTime now);
|
||||
|
||||
/// <summary>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.</summary>
|
||||
Task<List<Booking>> GetOverdueCheckedInBookingsAsync(Guid clientId, DateTime now);
|
||||
|
||||
/// <summary>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.</summary>
|
||||
Task<bool> TryClaimRfidTagAsync(Guid tagId, DateTime now);
|
||||
|
||||
// --- Booking invoices (snapshot receipts created when a payment is recorded) ---
|
||||
|
||||
Task<BookingInvoice> CreateBookingInvoice(BookingInvoice invoice);
|
||||
|
||||
/// <summary>Listed on their own "Invoices" tab -- deliberately not mixed into the
|
||||
/// membership-based Customer Payments view.</summary>
|
||||
Task<List<BookingInvoice>> GetBookingInvoices(Guid clientId, DateTime? fromUtc, DateTime? toUtc);
|
||||
|
||||
Task<BookingInvoice?> GetBookingInvoiceById(Guid bookingInvoiceId);
|
||||
|
||||
/// <summary>Aggregate counts/sums backing the Bookings page's Dashboard tab.</summary>
|
||||
Task<(int bookingsToday, decimal revenueToday, int checkedInNow, int upcomingConfirmed, decimal outstandingUnpaid)>
|
||||
GetDashboardSummaryAsync(Guid clientId, DateTime now);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user