2023-06-30 09:13:15 +09:00
|
|
|
using System;
|
2023-05-23 02:18:57 +02:00
|
|
|
using System.Collections.Generic;
|
2021-07-23 03:57:19 -07:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
2023-06-30 09:13:15 +09:00
|
|
|
using System.Linq;
|
2024-11-05 03:49:30 +01:00
|
|
|
using BTCPayServer.Client.Models;
|
2023-12-01 16:13:44 +01:00
|
|
|
using BTCPayServer.Models;
|
2023-06-30 09:13:15 +09:00
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
2018-04-03 11:50:41 +09:00
|
|
|
|
2022-07-18 20:51:53 +02:00
|
|
|
namespace BTCPayServer.Plugins.PointOfSale.Models
|
2018-04-03 11:50:41 +09:00
|
|
|
{
|
|
|
|
public class ViewPointOfSaleViewModel
|
|
|
|
{
|
2018-12-04 13:04:26 +09:00
|
|
|
public class CurrencyInfoData
|
|
|
|
{
|
|
|
|
public bool Prefixed { get; set; }
|
|
|
|
public string CurrencySymbol { get; set; }
|
|
|
|
public string ThousandSeparator { get; set; }
|
|
|
|
public string DecimalSeparator { get; set; }
|
2018-12-18 00:25:17 +09:00
|
|
|
public int Divisibility { get; set; }
|
|
|
|
public bool SymbolSpace { get; set; }
|
2018-12-04 13:04:26 +09:00
|
|
|
}
|
|
|
|
|
2023-12-01 16:13:44 +01:00
|
|
|
public StoreBrandingViewModel StoreBranding { get; set; }
|
2023-01-30 09:23:49 +01:00
|
|
|
public string StoreName { get; set; }
|
2018-12-04 13:04:26 +09:00
|
|
|
public CurrencyInfoData CurrencyInfo { get; set; }
|
2020-05-26 17:38:30 +02:00
|
|
|
public PosViewType ViewType { get; set; }
|
2024-03-14 11:11:54 +01:00
|
|
|
public bool ShowItems { get; set; }
|
2018-04-26 22:09:18 +09:00
|
|
|
public bool ShowCustomAmount { get; set; }
|
2019-02-25 14:11:03 +08:00
|
|
|
public bool ShowDiscount { get; set; }
|
2023-11-13 13:59:14 +01:00
|
|
|
public bool ShowSearch { get; set; } = true;
|
|
|
|
public bool ShowCategories { get; set; } = true;
|
2019-02-25 14:11:03 +08:00
|
|
|
public bool EnableTips { get; set; }
|
2018-04-26 22:09:18 +09:00
|
|
|
public string Step { get; set; }
|
2018-04-03 11:50:41 +09:00
|
|
|
public string Title { get; set; }
|
2024-11-05 03:49:30 +01:00
|
|
|
AppItem[] _Items;
|
|
|
|
public AppItem[] Items
|
2023-06-30 09:13:15 +09:00
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return _Items;
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
_Items = value;
|
|
|
|
UpdateGroups();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void UpdateGroups()
|
|
|
|
{
|
|
|
|
AllCategories = null;
|
|
|
|
if (Items is null)
|
|
|
|
return;
|
|
|
|
var groups = Items.SelectMany(g => g.Categories ?? Array.Empty<string>())
|
|
|
|
.ToHashSet()
|
|
|
|
.Select(o => new KeyValuePair<string, string>(o, o))
|
|
|
|
.ToList();
|
|
|
|
if (groups.Count == 0)
|
|
|
|
return;
|
2023-07-22 14:15:41 +02:00
|
|
|
groups.Insert(0, new KeyValuePair<string, string>("All", "*"));
|
2023-06-30 09:13:15 +09:00
|
|
|
AllCategories = new SelectList(groups, "Value", "Key", "*");
|
|
|
|
}
|
|
|
|
|
2018-12-01 12:59:45 +08:00
|
|
|
public string CurrencyCode { get; set; }
|
2018-11-15 21:31:38 -06:00
|
|
|
public string CurrencySymbol { get; set; }
|
2018-12-04 13:04:26 +09:00
|
|
|
public string AppId { get; set; }
|
2018-11-16 20:39:43 -06:00
|
|
|
public string ButtonText { get; set; }
|
|
|
|
public string CustomButtonText { get; set; }
|
2018-11-27 14:14:32 +08:00
|
|
|
public string CustomTipText { get; set; }
|
2018-12-19 14:07:05 +08:00
|
|
|
public int[] CustomTipPercentages { get; set; }
|
2019-08-19 07:13:42 +02:00
|
|
|
public string Description { get; set; }
|
2023-06-30 09:13:15 +09:00
|
|
|
public SelectList AllCategories { get; set; }
|
2022-05-27 16:26:31 +09:00
|
|
|
public string StoreId { get; set; }
|
2018-04-03 11:50:41 +09:00
|
|
|
}
|
2021-09-05 15:19:27 -07:00
|
|
|
}
|