Files
btcpayserver/BTCPayServer/Models/StoreViewModels/RatesViewModel.cs
Nicolas Dorier 1e79730c6e Implement store templates (#6704)
* Implement store templates

* Use the template for the default rate rules

* Polish messages

* Do not show exchange selection if template has a script
2025-05-09 15:58:24 +09:00

58 lines
1.8 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Rating;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace BTCPayServer.Models.StoreViewModels
{
public class RatesViewModel
{
public class Source
{
public bool ShowScripting { get; set; }
[Display(Name = "Rate Rules")]
[MaxLength(2000)]
public string Script { get; set; }
public string DefaultScript { get; set; }
[Display(Name = "Preferred Price Source")]
public string PreferredExchange { get; set; }
public SelectList Exchanges { get; set; }
public string RateSource { get; set; }
public string PreferredResolvedExchange { get; set; }
public bool IsFallback { get; set; }
public ConfirmModel ScriptingConfirm { get; set; }
}
public class TestResultViewModel
{
public string CurrencyPair { get; set; }
public string Rule { get; set; }
public bool Error { get; set; }
}
public List<TestResultViewModel> TestRateRules { get; set; }
public string Hash { get; set; }
public Source PrimarySource { get; set; }
public Source FallbackSource { get; set; }
[Display(Name = "Enable fallback rates")]
public bool HasFallback { get; set; }
public string ScriptTest { get; set; }
public string DefaultCurrencyPairs { get; set; }
public string StoreId { get; set; }
[Display(Name = "Add Exchange Rate Spread")]
[Range(0.0, 100.0)]
public double Spread { get; set; }
public IEnumerable<RateSourceInfo> AvailableExchanges { get; set; }
}
}