using Nop.Web.Framework.Models; using Nop.Web.Framework.Mvc.ModelBinding; namespace Nop.Plugin.Misc.FruitBankPlugin.Models; public record CustomerCreditWidgetModel : BaseNopModel { public int CustomerId { get; set; } public bool HasCreditLimit { get; set; } [NopResourceDisplayName("Plugins.Misc.FruitBankPlugin.CustomerCredit.CreditLimit")] public decimal CreditLimit { get; set; } [NopResourceDisplayName("Plugins.Misc.FruitBankPlugin.CustomerCredit.OutstandingBalance")] public decimal OutstandingBalance { get; set; } [NopResourceDisplayName("Plugins.Misc.FruitBankPlugin.CustomerCredit.RemainingCredit")] public decimal? RemainingCredit { get; set; } public string? Comment { get; set; } // ── Generic attributes block (rendered above the credit card) ────────────── [NopResourceDisplayName("Plugins.Misc.FruitBankPlugin.CustomerAttributes.IsEkaer")] public bool IsEkaer { get; set; } // ── Sites (telephelyek) ──────────────────────────────────────────────────── /// All current customer addresses, flagged with site/default state — feeds the edit modal. public List SiteAddresses { get; set; } = new(); /// Number of addresses currently marked as sites. public int SiteCount { get; set; } /// Display string of the default site, if any. public string? DefaultSiteDisplay { get; set; } // ── License plates (rendszámok) ──────────────────────────────────────────── /// The customer's selectable plates — feeds the summary and the edit modal. public List LicensePlates { get; set; } = new(); public int PlateCount { get; set; } /// The default plate, if any (auto-assigned to new orders). public string? DefaultPlate { get; set; } } public class CustomerSiteAddressRow { public int AddressId { get; set; } public string Display { get; set; } = string.Empty; public bool IsSite { get; set; } public bool IsDefault { get; set; } } public class CustomerLicensePlateRow { public string Plate { get; set; } = string.Empty; public bool IsDefault { get; set; } }