Mango.Nop.Plugins/Nop.Plugin.Misc.AIPlugin/Models/CustomerCreditWidgetModel.cs

44 lines
1.8 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; }
}
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; }
}