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:
@@ -78,6 +78,10 @@ namespace Fitness_core_BE
|
||||
// TimeBankCard's own, unrelated RfidTagId string field.
|
||||
public DbSet<RfidTag> RfidTags => Set<RfidTag>();
|
||||
|
||||
// Snapshot receipt created whenever a Booking's payment is recorded -- see
|
||||
// Models/BookingInvoice.cs. Deliberately separate from CustomerInvoice (membership-only).
|
||||
public DbSet<BookingInvoice> BookingInvoices => Set<BookingInvoice>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
@@ -184,6 +188,7 @@ namespace Fitness_core_BE
|
||||
modelBuilder.Entity<Facility>().Ignore(f => f.Client);
|
||||
modelBuilder.Entity<FacilitySession>().Ignore(s => s.Client);
|
||||
modelBuilder.Entity<Booking>().Ignore(b => b.Client);
|
||||
modelBuilder.Entity<BookingInvoice>().Ignore(i => i.Client);
|
||||
modelBuilder.Entity<TimeBankCard>().Ignore(t => t.Client);
|
||||
modelBuilder.Entity<TimeBankCardUsageLog>().Ignore(l => l.Client);
|
||||
|
||||
@@ -278,6 +283,9 @@ namespace Fitness_core_BE
|
||||
modelBuilder.Entity<Booking>()
|
||||
.HasIndex(b => new { b.FKFacilityId, b.StartTime, b.EndTime });
|
||||
|
||||
modelBuilder.Entity<BookingInvoice>()
|
||||
.HasIndex(i => new { i.FKClientId, i.IssuedAt });
|
||||
|
||||
modelBuilder.Entity<UnlinkedDeviceEnrollment>()
|
||||
.HasIndex(e => new { e.FKDeviceId, e.DeviceEmployeeNo, e.LinkedAt });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user