Files
ERP_Distribution/Distribution/Models/SchemeRedemption.cs
T
Kalana B. Thilakarathna 93f2f1bd3b Refactor sales pipeline: ShopPO, Invoice, SysConfig models
Major refactor replacing Sale/Order with ShopPO → Invoice → LoadingSheet flow. Removed legacy Sale/Order models and features; introduced ShopPO, ShopPOItem, Invoice, LoadingSheetOrder, and SysConfig models. Updated related entities, enums, repositories, and controllers. Added new migrations for schema changes and system config. Overhauled business logic and DI registrations. Updated documentation with migration plan.
2026-09-17 10:03:22 +05:30

37 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations.Schema;
namespace Distribution.Models
{
public class SchemeRedemption
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid FK_SchemeId { get; set; }
[ForeignKey("FK_SchemeId")]
public Scheme Scheme { get; set; }
public Guid? FK_ShopPOId { get; set; }
[ForeignKey("FK_ShopPOId")]
public ShopPO? ShopPO { get; set; }
/// <summary>Placeholder for the future field-invoice module — no FieldInvoice entity exists yet.</summary>
public Guid? FieldInvoiceId { get; set; }
public decimal? DiscountAmount { get; set; }
public Guid? FK_FreeItemId { get; set; }
[ForeignKey("FK_FreeItemId")]
public Item? FreeItem { get; set; }
public decimal? FreeQty { get; set; }
/// <summary>
/// Cost price of the free item snapshotted at redemption time, so getSchemeROI stays
/// accurate even after the item's cost price later changes.
/// </summary>
public decimal? FreeItemCostValue { get; set; }
public DateTime RedeemedAt { get; set; } = DateTime.Now;
}
}