Implement store credit tracking and enforcement
Introduced StoreCreditMovement entity and migration to track store credit usage and settlements. Updated payment flow to enforce credit limits and record credit movements. Modified outstanding balance calculation to use credit movements. Enhanced frontend to display real-time credit info and prevent over-credit payments. Updated API types, seed data, and DI registrations accordingly.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class StoreCreditMovement : Template
|
||||
{
|
||||
public Guid FK_StoreId { get; set; }
|
||||
[ForeignKey("FK_StoreId")]
|
||||
public Store? Store { get; set; }
|
||||
|
||||
public StoreCreditMovementDirection Direction { get; set; }
|
||||
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
public Guid? FK_InvoiceId { get; set; }
|
||||
[ForeignKey("FK_InvoiceId")]
|
||||
public Invoice? Invoice { get; set; }
|
||||
|
||||
public Guid? FK_PaymentId { get; set; }
|
||||
[ForeignKey("FK_PaymentId")]
|
||||
public Payment? Payment { get; set; }
|
||||
|
||||
public DateTime OccurredAt { get; set; } = DateTime.Now;
|
||||
public Guid? RecordedBy { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user