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:
2026-10-01 03:46:03 +05:30
parent 6abef835e8
commit 51f0021e27
16 changed files with 501 additions and 45 deletions
+23
View File
@@ -18,6 +18,11 @@ namespace Fitness_core_BE.DTOs.Booking
[Required]
public string GuestPhone { get; set; } = string.Empty;
/// <summary>Optional link to an existing registered customer (TenantCustomerLinkId) when
/// staff recognizes the walk-in as an already-registered member -- purely for
/// identification/auto-fill, doesn't change payment/membership handling at all.</summary>
public Guid? CustomerId { get; set; }
}
public class CreateAdhocBookingRequest
@@ -57,6 +62,10 @@ namespace Fitness_core_BE.DTOs.Booking
/// the FE pre-fills this from the facility but lets staff adjust it.</summary>
[Range(typeof(decimal), "0", "79228162514264337593543950335", ErrorMessage = "PricePerHour cannot be negative")]
public decimal? PricePerHour { get; set; }
/// <summary>Optional link to an existing registered customer -- see
/// CreateGuestBookingRequest.CustomerId.</summary>
public Guid? CustomerId { get; set; }
}
public class MarkGuestBookingPaidRequest
@@ -67,6 +76,20 @@ namespace Fitness_core_BE.DTOs.Booking
[Required]
[Range(0.01, double.MaxValue, ErrorMessage = "AmountCharged must be greater than zero")]
public decimal AmountCharged { get; set; }
/// <summary>"Cash" | "Bank". Defaults to "Cash" if omitted.</summary>
public string? PaymentMethod { get; set; }
}
/// <summary>Body for POST .../complete. Only required when the booking is a guest booking
/// still Unpaid -- see BookingService.CompleteBooking. Ignored otherwise (member bookings,
/// or a guest booking already Paid).</summary>
public class CompleteBookingRequest
{
public bool? MarkPaid { get; set; }
public decimal? AmountCollected { get; set; }
/// <summary>"Cash" | "Bank". Defaults to "Cash" if omitted.</summary>
public string? PaymentMethod { get; set; }
}
public class CheckInBookingRequest