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:
2026-09-29 13:02:52 +05:30
parent bffc9b1686
commit 7d8a8478ff
39 changed files with 1596 additions and 678 deletions
+22 -1
View File
@@ -4,11 +4,19 @@ namespace Fitness_core_BE.DTOs.Facility
{
public Guid FacilityId { get; set; }
public string Name { get; set; } = string.Empty;
public string FacilityType { get; set; } = string.Empty;
/// <summary>"Scheduled" | "AdHoc".</summary>
public string BookingMode { get; set; } = "Scheduled";
public string? Description { get; set; }
public int DefaultCapacity { get; set; }
public int NumberOfUnits { get; set; }
public decimal PricePerHour { get; set; }
public bool IsActive { get; set; }
public DateTime CreatedAt { get; set; }
// Absorbed from the old PlaceDto -- at most one for now, see AccessDevice.FKFacilityId.
public Guid? DeviceId { get; set; }
public string? DeviceName { get; set; }
}
public class FacilitySessionDto
@@ -22,4 +30,17 @@ namespace Fitness_core_BE.DTOs.Facility
public int BookedCount { get; set; }
public bool IsCancelled { get; set; }
}
/// <summary>GET api/client/facilities/availability -- how much room is left for a requested
/// window, uniformly across both booking modes (TotalUnits/UnitsFree mean NumberOfUnits/
/// overlap-count for AdHoc, DefaultCapacity/free-session-spots for Scheduled).</summary>
public class FacilityAvailabilityDto
{
public Guid FacilityId { get; set; }
public string FacilityName { get; set; } = string.Empty;
public string BookingMode { get; set; } = string.Empty;
public int TotalUnits { get; set; }
public int UnitsFree { get; set; }
public decimal PricePerHour { get; set; }
}
}