mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
ff79a31066
* 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
36 lines
903 B
C#
36 lines
903 B
C#
using System.Collections.Generic;
|
|
using BTCPayServer.JsonConverters;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
namespace BTCPayServer.Client.Models;
|
|
|
|
public enum AppItemPriceType
|
|
{
|
|
Fixed,
|
|
Topup,
|
|
Minimum
|
|
}
|
|
|
|
public class AppItem
|
|
{
|
|
public string Id { get; set; }
|
|
public string Title { get; set; }
|
|
public bool Disabled { get; set; }
|
|
public string Description { get; set; }
|
|
public string[] Categories { get; set; }
|
|
public string Image { get; set; }
|
|
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public AppItemPriceType PriceType { get; set; }
|
|
|
|
[JsonConverter(typeof(NumericStringJsonConverter))]
|
|
public decimal? Price { get; set; }
|
|
public string BuyButtonText { get; set; }
|
|
public int? Inventory { get; set; }
|
|
|
|
[JsonExtensionData]
|
|
public Dictionary<string, JToken> AdditionalData { get; set; }
|
|
}
|