using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Fitness_core_BE.Models
{
///
/// 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.
///
public class SubscriptionInstallment
{
[Key]
public Guid SubscriptionInstallmentId { get; set; }
public Guid FKSubscriptionId { get; set; }
[ForeignKey("FKSubscriptionId")]
public virtual CustomerSubscription Subscription { get; set; }
/// 1-based position in the schedule.
public int InstallmentNo { get; set; }
public DateTime DueDate { get; set; }
public decimal Amount { get; set; }
public decimal PaidAmount { get; set; } = 0m;
/// "Pending" | "Partial" | "Paid".
public string Status { get; set; } = "Pending";
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}