Files
Core_Be/Models/SubscriptionInstallment.cs
T
Dhananjaya99 bffc9b1686 first commit
2026-09-28 11:44:26 +05:30

35 lines
1.2 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Fitness_core_BE.Models
{
/// <summary>
/// One scheduled part of a subscription's price (mostly-equal split, e.g. a
/// Rs. 6000 six-month plan → 6 monthly rows of Rs. 1000; the last row absorbs
/// rounding). Payments are allocated to installments in InstallmentNo order.
/// InstallmentCount = 1 plans get a single row due at onboarding.
/// </summary>
public class SubscriptionInstallment
{
[Key]
public Guid SubscriptionInstallmentId { get; set; }
public Guid FKSubscriptionId { get; set; }
[ForeignKey("FKSubscriptionId")]
public virtual CustomerSubscription Subscription { get; set; }
/// <summary>1-based position in the schedule.</summary>
public int InstallmentNo { get; set; }
public DateTime DueDate { get; set; }
public decimal Amount { get; set; }
public decimal PaidAmount { get; set; } = 0m;
/// <summary>"Pending" | "Partial" | "Paid".</summary>
public string Status { get; set; } = "Pending";
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}