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
+31 -3
View File
@@ -7,14 +7,22 @@ namespace Fitness_core_BE.DTOs.Facility
[Required]
public string Name { get; set; } = string.Empty;
/// <summary>"Gym" | "Pool" | "Court" | "Class".</summary>
/// <summary>"Scheduled" | "AdHoc".</summary>
[Required]
public string FacilityType { get; set; } = "Class";
public string BookingMode { get; set; } = "Scheduled";
public string? Description { get; set; }
/// <summary>Required (meaningfully) when BookingMode == "Scheduled".</summary>
[Range(1, int.MaxValue, ErrorMessage = "DefaultCapacity must be at least 1")]
public int DefaultCapacity { get; set; } = 1;
/// <summary>Required (meaningfully) when BookingMode == "AdHoc" -- e.g. 3 for "3 courts".</summary>
[Range(1, int.MaxValue, ErrorMessage = "NumberOfUnits must be at least 1")]
public int NumberOfUnits { get; set; } = 1;
[Range(typeof(decimal), "0", "79228162514264337593543950335", ErrorMessage = "PricePerHour cannot be negative")]
public decimal PricePerHour { get; set; } = 0m;
}
public class UpdateFacilityRequest
@@ -22,9 +30,11 @@ namespace Fitness_core_BE.DTOs.Facility
[Required]
public Guid FacilityId { get; set; }
public string? Name { get; set; }
public string? FacilityType { get; set; }
public string? BookingMode { get; set; }
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; }
}
@@ -48,4 +58,22 @@ namespace Fitness_core_BE.DTOs.Facility
/// <summary>Overrides the facility's default capacity for this specific session.</summary>
public int? Capacity { get; set; }
}
/// <summary>Absorbed from the old AssignPlaceDeviceRequest.</summary>
public class AssignFacilityDeviceRequest
{
// Null unassigns the facility's current device.
public Guid? DeviceId { get; set; }
}
public class GetFacilityAvailabilityRequest
{
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; }
}
}