Add PosViewType enum

This commit is contained in:
Umar Bolatov 2022-05-31 22:25:04 -07:00
parent fca066fe52
commit c917aec401
No known key found for this signature in database
GPG Key ID: 2C1F9AEB371D2A28
2 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,16 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace BTCPayServer.Client.Models
{
public enum PosViewType
{
Static,
Cart,
Light,
Print
}
public class CreateAppRequest
{
public string AppName { get; set; }
@ -12,7 +23,8 @@ namespace BTCPayServer.Client.Models
public string Title { get; set; } = null;
public string Description { get; set; } = null;
public string Template { get; set; } = null;
public string DefaultView { get; set; } = null;
[JsonConverter(typeof(StringEnumConverter))]
public PosViewType DefaultView { get; set; }
public bool ShowCustomAmount { get; set; } = true;
public bool ShowDiscount { get; set; } = true;
public bool EnableTips { get; set; } = true;

View File

@ -52,12 +52,10 @@ namespace BTCPayServer.Controllers.Greenfield
AppType = AppType.PointOfSale.ToString()
};
Enum.TryParse(request.DefaultView, out PosViewType defaultView);
appData.SetSettings(new PointOfSaleSettings
{
Title = request.Title,
DefaultView = defaultView,
DefaultView = (Services.Apps.PosViewType)request.DefaultView,
ShowCustomAmount = request.ShowCustomAmount,
ShowDiscount = request.ShowDiscount,
EnableTips = request.EnableTips,