Files
Core_Be/DTOs/Facility/FacilityDtos.cs
T
HarithaRandunu 7d8a8478ff 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.
2026-09-29 13:02:52 +05:30

47 lines
1.8 KiB
C#

namespace Fitness_core_BE.DTOs.Facility
{
public class FacilityDto
{
public Guid FacilityId { get; set; }
public string Name { 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
{
public Guid FacilitySessionId { get; set; }
public Guid FacilityId { get; set; }
public string? FacilityName { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public int Capacity { get; set; }
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; }
}
}