59 lines
2.4 KiB
C#
59 lines
2.4 KiB
C#
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) ────────────────────────────────────────────────────
|
|
/// <summary>All current customer addresses, flagged with site/default state — feeds the edit modal.</summary>
|
|
public List<CustomerSiteAddressRow> SiteAddresses { get; set; } = new();
|
|
|
|
/// <summary>Number of addresses currently marked as sites.</summary>
|
|
public int SiteCount { get; set; }
|
|
|
|
/// <summary>Display string of the default site, if any.</summary>
|
|
public string? DefaultSiteDisplay { get; set; }
|
|
|
|
// ── License plates (rendszámok) ────────────────────────────────────────────
|
|
/// <summary>The customer's selectable plates — feeds the summary and the edit modal.</summary>
|
|
public List<CustomerLicensePlateRow> LicensePlates { get; set; } = new();
|
|
|
|
public int PlateCount { get; set; }
|
|
|
|
/// <summary>The default plate, if any (auto-assigned to new orders).</summary>
|
|
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; }
|
|
}
|