namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Models;

public class CustomerCreditModel
{
    public int CustomerId        { get; set; }
    public string CustomerEmail  { get; set; } = string.Empty;
    public string CustomerName   { get; set; } = string.Empty;

    // Credit record
    public int CreditId          { get; set; }
    public decimal CreditLimit   { get; set; }
    public string? Comment       { get; set; }
    public bool HasCreditLimit   { get; set; }

    // Calculated
    public decimal OutstandingBalance { get; set; }
    public decimal? RemainingCredit  { get; set; }

    // Unpaid orders table
    public List<CustomerCreditOrderRow> UnpaidOrders { get; set; } = new();
}

public class CustomerCreditOrderRow
{
    public int OrderId           { get; set; }
    public decimal OrderTotal    { get; set; }
    public DateTime CreatedOnUtc { get; set; }
    public string OrderStatus    { get; set; } = string.Empty;
    public string PaymentStatus  { get; set; } = string.Empty;
}
