5d711bd13e
Implements the facility-classes-booking-dashboard plan (backend): - Facility.BookingMode (single Scheduled/AdHoc choice) replaced with independent SupportsClasses/SupportsBooking flags, so one facility can run a class and accept walk-in bookings; a running class now blocks walk-in booking for its window on both create and reschedule. - CustomerPlan.GrantsGymAccess + CustomerPlanClass join table let a customer hold one gym-access plan plus any number of class-only plans. Replaced the old single-subscription resolution (GetActiveSubscriptionByCustomerId/HasAnyActiveSubscriptionAsync) with gym-access-aware and class-aware resolvers across booking creation/cancellation, plan assignment, and customer self-service. Fixed ChangeMembershipPlan/renewal plan-changes, which resolved "the subscription to replace" by most-recent-created and would have deactivated a member's class subscription instead of their gym one. - New FacilityClass model: recurring class definitions (Daily/Weekly/ Monthly/Custom) with lazy occurrence generation (8-week horizon, race-safe via a unique index) and proper unlimited-capacity handling. "Mark not held" replaces the old bare-cancel: cascades to cancel and refund every confirmed booking on the occurrence through the same core CancelBooking uses, and frees the slot for walk-in booking. Scheduling conflicts (a walk-in booking now overlapping a class) are surfaced for staff to resolve via the existing Reschedule flow. - Renamed the pre-existing "AdHoc" booking-mode terminology to "WalkIn" throughout (routes, methods, DTOs, the stored BookingMode value) for a clearer, simpler name. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
53 lines
2.2 KiB
C#
53 lines
2.2 KiB
C#
namespace Fitness_core_BE.DTOs.Booking
|
|
{
|
|
public class BookingDto
|
|
{
|
|
public Guid BookingId { get; set; }
|
|
|
|
/// <summary>Null for a WalkIn booking (no pre-created session).</summary>
|
|
public Guid? FacilitySessionId { get; set; }
|
|
public Guid FacilityId { get; set; }
|
|
public string? FacilityName { get; set; }
|
|
|
|
/// <summary>"Scheduled" | "WalkIn" -- tells the FE which action set applies (e.g. WalkIn
|
|
/// bookings can be rescheduled to any free time; Scheduled ones only to another
|
|
/// session).</summary>
|
|
public string BookingMode { get; set; } = string.Empty;
|
|
|
|
public DateTime StartTime { get; set; }
|
|
public DateTime EndTime { get; set; }
|
|
|
|
/// <summary>Informational headcount, WalkIn only.</summary>
|
|
public int? PartySize { get; set; }
|
|
|
|
public bool IsGuest { get; set; }
|
|
public Guid? CustomerId { get; set; }
|
|
public string? GuestName { get; set; }
|
|
public string? GuestPhone { get; set; }
|
|
|
|
/// <summary>Only populated in the response right after booking creation -- the
|
|
/// guest's receipt. Never returned by list/lookup endpoints afterward.</summary>
|
|
public string? OtpCode { get; set; }
|
|
public bool OtpVerified { get; set; }
|
|
|
|
public Guid? RfidTagId { get; set; }
|
|
public string? RfidTagLabel { get; set; }
|
|
public DateTime? RfidAssignedAt { get; set; }
|
|
public DateTime? RfidReturnedAt { get; set; }
|
|
|
|
public string PaymentStatus { get; set; } = string.Empty;
|
|
public decimal AmountCharged { get; set; }
|
|
/// <summary>"Cash" | "Bank". Null until PaymentStatus becomes "Paid".</summary>
|
|
public string? PaymentMethod { get; set; }
|
|
public DateTime? PaidAt { get; set; }
|
|
public string Status { get; set; } = string.Empty;
|
|
public DateTime BookedAt { get; set; }
|
|
public DateTime? CheckedInAt { get; set; }
|
|
public DateTime? CheckedOutAt { get; set; }
|
|
|
|
/// <summary>A public, unauthenticated link to this booking's confirmation page --
|
|
/// copy-paste-and-share receipt. Works for both member and guest bookings.</summary>
|
|
public string? ShareUrl { get; set; }
|
|
}
|
|
}
|