Refactor CustomerPlanService to use FacilityRepository, remove PlaceService, and introduce RfidTagService
- Updated CustomerPlanService to replace references to PlaceRepo with FacilityRepository for managing customer plans and associated facilities. - Removed PlaceService and its related methods, consolidating functionality into FacilityService. - Added RfidTagService for managing RFID tags, including methods for creating, updating, and setting statuses of tags. - Updated TenantDbContext to include new DbSet for RfidTags and CustomerPlanFacilities, and adjusted model configurations accordingly. - Enhanced FacilityService to support new booking modes and validation for facility creation and updates.
This commit is contained in:
@@ -3,10 +3,22 @@ namespace Fitness_core_BE.DTOs.Booking
|
||||
public class BookingDto
|
||||
{
|
||||
public Guid BookingId { get; set; }
|
||||
public Guid FacilitySessionId { get; set; }
|
||||
|
||||
/// <summary>Null for an AdHoc booking (no pre-created session).</summary>
|
||||
public Guid? FacilitySessionId { get; set; }
|
||||
public Guid FacilityId { get; set; }
|
||||
public string? FacilityName { get; set; }
|
||||
public DateTime? SessionStartTime { get; set; }
|
||||
public DateTime? SessionEndTime { get; set; }
|
||||
|
||||
/// <summary>"Scheduled" | "AdHoc" -- read off the facility, tells the FE which action set
|
||||
/// applies (e.g. AdHoc 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, AdHoc only.</summary>
|
||||
public int? PartySize { get; set; }
|
||||
|
||||
public bool IsGuest { get; set; }
|
||||
public Guid? CustomerId { get; set; }
|
||||
@@ -18,11 +30,17 @@ namespace Fitness_core_BE.DTOs.Booking
|
||||
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; }
|
||||
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>
|
||||
|
||||
@@ -20,6 +20,40 @@ namespace Fitness_core_BE.DTOs.Booking
|
||||
public string GuestPhone { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class CreateAdhocBookingRequest
|
||||
{
|
||||
[Required]
|
||||
public Guid FacilityId { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime StartTime { get; set; }
|
||||
|
||||
[Required, Range(1, int.MaxValue, ErrorMessage = "DurationMinutes must be at least 1")]
|
||||
public int DurationMinutes { get; set; }
|
||||
|
||||
public int? PartySize { get; set; }
|
||||
}
|
||||
|
||||
public class CreateGuestAdhocBookingRequest
|
||||
{
|
||||
[Required]
|
||||
public Guid FacilityId { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime StartTime { get; set; }
|
||||
|
||||
[Required, Range(1, int.MaxValue, ErrorMessage = "DurationMinutes must be at least 1")]
|
||||
public int DurationMinutes { get; set; }
|
||||
|
||||
[Required]
|
||||
public string GuestName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string GuestPhone { get; set; } = string.Empty;
|
||||
|
||||
public int? PartySize { get; set; }
|
||||
}
|
||||
|
||||
public class MarkGuestBookingPaidRequest
|
||||
{
|
||||
[Required]
|
||||
@@ -34,6 +68,11 @@ namespace Fitness_core_BE.DTOs.Booking
|
||||
{
|
||||
[Required]
|
||||
public string OtpCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>Picked from the club's managed RFID tag pool (GET api/client/rfid-tags?
|
||||
/// status=Available) -- never free-typed. Required in practice for an AdHoc booking's
|
||||
/// check-in; optional for Scheduled bookings that don't hand out a physical tag.</summary>
|
||||
public Guid? RfidTagId { get; set; }
|
||||
}
|
||||
|
||||
public class CancelBookingRequest
|
||||
@@ -41,4 +80,26 @@ namespace Fitness_core_BE.DTOs.Booking
|
||||
[Required]
|
||||
public Guid BookingId { get; set; }
|
||||
}
|
||||
|
||||
public class ReassignBookingRequest
|
||||
{
|
||||
public string? GuestName { get; set; }
|
||||
public string? GuestPhone { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Exactly one shape applies, matching the booking's current BookingMode: AdHoc
|
||||
/// bookings move within the SAME facility to a new StartTime/DurationMinutes; Scheduled
|
||||
/// bookings move to a different FacilitySession (also on the same facility). Only allowed
|
||||
/// while the booking is still Confirmed, and only onto a slot with room -- re-runs the same
|
||||
/// availability check as creation, excluding the booking's own current slot.</summary>
|
||||
public class RescheduleBookingRequest
|
||||
{
|
||||
// AdHoc reschedule.
|
||||
public DateTime? StartTime { get; set; }
|
||||
[Range(1, int.MaxValue, ErrorMessage = "DurationMinutes must be at least 1")]
|
||||
public int? DurationMinutes { get; set; }
|
||||
|
||||
// Scheduled reschedule.
|
||||
public Guid? FacilitySessionId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user