34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Fitness_core_BE.Models
|
|
{
|
|
public class CustomerInvoice
|
|
{
|
|
[Key]
|
|
public Guid CustomerInvoiceId { get; set; }
|
|
public Guid FKCustomerSubscriptionId { get; set; }
|
|
[ForeignKey("FKCustomerSubscriptionId")]
|
|
public virtual CustomerSubscription CustomerSubscription { get; set; }
|
|
|
|
public Guid FKClientId { get; set; }
|
|
[ForeignKey("FKClientId")]
|
|
public virtual Client Client { get; set; }
|
|
|
|
public Guid FKUserId { get; set; }
|
|
[ForeignKey("FKUserId")]
|
|
public virtual User User { get; set; }
|
|
|
|
public decimal Amount { get; set; }
|
|
public string Status { get; set; } = "Pending";
|
|
|
|
// Approval gate for the renewal workflow: false means this invoice was auto-generated by
|
|
// the daily renewal sweep and is awaiting staff approve/change-plan/reject. Independent of
|
|
// Status and of CustomerSubscription.IsActive. Defaults true so every other invoice-
|
|
// creation path (onboarding, plan change, manual billing) is unaffected.
|
|
public bool IsActive { get; set; } = true;
|
|
|
|
public DateTime CustomerInvoiceDate { get; set; } = DateTime.UtcNow;
|
|
}
|
|
}
|