using System.ComponentModel.DataAnnotations.Schema; namespace Distribution.Models { public class SupplierPayment : Template { public Guid FK_SupplierId { get; set; } [ForeignKey("FK_SupplierId")] public Supplier? Supplier { get; set; } public decimal Amount { get; set; } // Only Cash or Cheque are valid for outgoing payments. Credit is rejected at the service layer. public PaymentMethod Method { get; set; } // Cash: required. Null for Cheque. public Guid? FK_BankAccountId { get; set; } [ForeignKey("FK_BankAccountId")] public BankAccount? BankAccount { get; set; } // Cheque: required — the ChequePage this payment issued. Null for Cash. public Guid? FK_ChequePageId { get; set; } [ForeignKey("FK_ChequePageId")] public ChequePage? ChequePage { get; set; } public DateTime PaidAt { get; set; } public Guid? PaidByUserId { get; set; } public string? Notes { get; set; } public ICollection Allocations { get; set; } = []; } }