Files
Core_Be/DTOs/CustomerPlan/CreateCustomerPlanRequest.cs
Dhananjaya99 bffc9b1686 first commit
2026-09-28 11:44:26 +05:30

63 lines
2.7 KiB
C#

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; }
}
}