btcpayserver/BTCPayServer.Client/Models/PointOfSaleAppData.cs
d11n ff79a31066
Refactoring: Move AppItem to Client lib and use the class for item list (#6258)
* Refactoring: Move AppItem to Client lib and use the class for item list

This makes it available for the app, which would otherwise have to replicate the model. Also uses the proper class for the item/perk list of the app models.

* Remove unused app item payment methods property

* Do not ignore nullable values in JSON

* Revert to use Newtonsoft types
2024-11-05 11:49:30 +09:00

46 lines
1.3 KiB
C#

#nullable enable
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace BTCPayServer.Client.Models;
public abstract class PointOfSaleBaseData : AppBaseData
{
public string? Title { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public PosViewType? DefaultView { get; set; }
public bool? ShowItems { get; set; }
public bool? ShowCustomAmount { get; set; }
public bool? ShowDiscount { get; set; }
public bool? ShowSearch { get; set; }
public bool? ShowCategories { get; set; }
public bool? EnableTips { get; set; }
public string? Currency { get; set; }
public string? FixedAmountPayButtonText { get; set; }
public string? CustomAmountPayButtonText { get; set; }
public string? TipText { get; set; }
public string? NotificationUrl { get; set; }
public string? RedirectUrl { get; set; }
public string? Description { get; set; }
public bool? RedirectAutomatically { get; set; }
public int[]? CustomTipPercentages { get; set; }
public string? FormId { get; set; }
}
public class PointOfSaleAppData : PointOfSaleBaseData
{
public AppItem[]? Items { get; set; }
}
public class PointOfSaleAppRequest : PointOfSaleBaseData, IAppRequest
{
public string? Template { get; set; }
}
public enum PosViewType
{
Static,
Cart,
Light,
Print
}