From 76c08855e4dc57f7979c5d930714a5190103e2ac Mon Sep 17 00:00:00 2001 From: DeepnaPooja Date: Wed, 16 Sep 2026 16:26:05 +0530 Subject: [PATCH] Add invoice model --- Distribution/Models/Invoice.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Distribution/Models/Invoice.cs diff --git a/Distribution/Models/Invoice.cs b/Distribution/Models/Invoice.cs new file mode 100644 index 0000000..d0de571 --- /dev/null +++ b/Distribution/Models/Invoice.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace Distribution.Models +{ + public class Invoice : Template + { + public Guid FK_OrderId { get; set; } + [ForeignKey("FK_OrderId")] + public Order Order { get; set; } + + public InvoiceStatus Status { get; set; } = InvoiceStatus.Draft; + + public Guid CreatedByUserId { get; set; } + [ForeignKey("CreatedByUserId")] + public User CreatedByUser { get; set; } + + public DateTime? PrintedAt { get; set; } + public Guid? PrintedByUserId { get; set; } + [ForeignKey("PrintedByUserId")] + public User? PrintedByUser { get; set; } + + public DateTime? FinalizedAt { get; set; } + public Guid? FinalizedByUserId { get; set; } + [ForeignKey("FinalizedByUserId")] + public User? FinalizedByUser { get; set; } + + /// Reflects current PO line items through Draft/Printed; locked at Finalized. + public decimal TotalAmount { get; set; } + } +}