first commit

This commit is contained in:
Dhananjaya99
2026-09-28 11:44:26 +05:30
parent 721743ae6b
commit bffc9b1686
424 changed files with 46474 additions and 0 deletions
@@ -0,0 +1,62 @@
using System.ComponentModel.DataAnnotations;
namespace Fitness_core_BE.DTOs.CustomerPlan
{
public class CreateCustomerPlanRequest
{
[Required]
public string PlanName { get; set; } = string.Empty;
public string? PlanDescription { get; set; }
[Required]
[Range(0, double.MaxValue, ErrorMessage = "Plan price must be a positive value")]
public decimal PlanPrice { get; set; }
public bool? HasOnboardingFee { get; set; }
[Range(0, double.MaxValue, ErrorMessage = "Onboarding fee must be zero or greater")]
public decimal? OnboardingFeeAmount { get; set; }
/// <summary>Required when DurationMode is "Rolling" (validated in the service).</summary>
[Range(1, int.MaxValue, ErrorMessage = "Duration must be at least 1 day")]
public int? DurationInDays { get; set; }
/// <summary>"Individual" (default) | "Group".</summary>
public string? PlanScope { get; set; }
/// <summary>Required >= 2 when PlanScope is "Group".</summary>
public int? MemberLimit { get; set; }
/// <summary>"Rolling" (default) | "FixedRange".</summary>
public string? DurationMode { get; set; }
public DateTime? ValidFrom { get; set; }
public DateTime? ValidTo { get; set; }
public bool? AllowSplitPayments { get; set; }
/// <summary>Number of mostly-equal installments; defaults to plan duration in months when split is enabled.</summary>
public int? InstallmentCount { get; set; }
/// <summary>Null (default) = unlimited-access plan. A number = this plan grants that
/// many bookable Facility sessions per billing cycle (e.g. "4 pool sessions a month").</summary>
[Range(1, int.MaxValue, ErrorMessage = "SessionsPerCycle must be at least 1 when set")]
public int? SessionsPerCycle { get; set; }
/// <summary>"NoRollover" (default) | "GracePeriod". Only meaningful when SessionsPerCycle is set.</summary>
public string? SessionRolloverPolicy { get; set; }
/// <summary>Required (>= 1) when SessionRolloverPolicy is "GracePeriod".</summary>
[Range(0, int.MaxValue, ErrorMessage = "RolloverGraceDays must be zero or greater")]
public int? RolloverGraceDays { get; set; }
/// <summary>"Prepaid" (default, pay before the cycle starts) | "Postpaid" (use first,
/// invoice at cycle end, access suspended if unpaid past due). Asked once per package.</summary>
public string? BillingTiming { get; set; }
/// <summary>Places this plan grants access to. Null/omitted or empty = unrestricted
/// (reaches every active access device, today's behavior).</summary>
public List<Guid>? PlaceIds { get; set; }
}
}
+33
View File
@@ -0,0 +1,33 @@
namespace Fitness_core_BE.DTOs.CustomerPlan
{
public class CustomerPlanDto
{
public Guid CustomerPlanId { get; set; }
public Guid FKClientId { get; set; }
public string? ClientName { get; set; }
public string? PlanName { get; set; }
public string? PlanDescription { get; set; }
public decimal PlanPrice { get; set; }
public bool HasOnboardingFee { get; set; }
public decimal OnboardingFeeAmount { get; set; }
public int DurationInDays { get; set; }
public string PlanScope { get; set; } = "Individual";
public int MemberLimit { get; set; } = 1;
public string DurationMode { get; set; } = "Rolling";
public DateTime? ValidFrom { get; set; }
public DateTime? ValidTo { get; set; }
public bool AllowSplitPayments { get; set; }
public int InstallmentCount { get; set; } = 1;
public int? SessionsPerCycle { get; set; }
public string SessionRolloverPolicy { get; set; } = "NoRollover";
public int RolloverGraceDays { get; set; }
public string BillingTiming { get; set; } = "Prepaid";
public bool IsActive { get; set; }
public DateTime CreatedAt { get; set; }
// Which Places this plan grants access to. Empty = unrestricted (reaches every
// active device) -- see AccessDeviceService's allowed-device resolution.
public List<Guid> PlaceIds { get; set; } = new();
public List<string> PlaceNames { get; set; } = new();
}
}
@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace Fitness_core_BE.DTOs.CustomerPlan
{
/// <summary>
/// Body of PATCH client/plans/{id}/status -- activate or deactivate a membership plan
/// without resending its configuration.
/// </summary>
public class SetCustomerPlanStatusRequest
{
[Required]
public bool IsActive { get; set; }
}
}
@@ -0,0 +1,54 @@
using System.ComponentModel.DataAnnotations;
namespace Fitness_core_BE.DTOs.CustomerPlan
{
public class UpdateCustomerPlanRequest
{
[Required]
public Guid CustomerPlanId { get; set; }
public string? PlanName { get; set; }
public string? PlanDescription { get; set; }
[Range(0, double.MaxValue, ErrorMessage = "Plan price must be a positive value")]
public decimal? PlanPrice { get; set; }
public bool? HasOnboardingFee { get; set; }
[Range(0, double.MaxValue, ErrorMessage = "Onboarding fee must be zero or greater")]
public decimal? OnboardingFeeAmount { get; set; }
[Range(1, int.MaxValue, ErrorMessage = "Duration must be at least 1 day")]
public int? DurationInDays { get; set; }
public string? PlanScope { get; set; }
public int? MemberLimit { get; set; }
public string? DurationMode { get; set; }
public DateTime? ValidFrom { get; set; }
public DateTime? ValidTo { get; set; }
public bool? AllowSplitPayments { get; set; }
public int? InstallmentCount { get; set; }
[Range(1, int.MaxValue, ErrorMessage = "SessionsPerCycle must be at least 1 when set")]
public int? SessionsPerCycle { get; set; }
public string? SessionRolloverPolicy { get; set; }
[Range(0, int.MaxValue, ErrorMessage = "RolloverGraceDays must be zero or greater")]
public int? RolloverGraceDays { get; set; }
public string? BillingTiming { get; set; }
public bool? IsActive { get; set; }
/// <summary>Replaces this plan's place set when provided (empty array clears it back
/// to unrestricted). Omit/null to leave the plan's places unchanged.</summary>
public List<Guid>? PlaceIds { get; set; }
}
}