Edit view for Pull Payments (#4016)

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
Davide Oggioni
2022-08-11 14:30:42 +02:00
committed by GitHub
parent 7f41a1ef09
commit 8c8a5a4f5e
6 changed files with 246 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc.Rendering;
using BTCPayServer.Payments;
using BTCPayServer.Client.Models;
using BTCPayServer.Data;
namespace BTCPayServer.Models.WalletViewModels
{
@@ -70,4 +71,37 @@ namespace BTCPayServer.Models.WalletViewModels
[Display(Name = "Automatically approve claims")]
public bool AutoApproveClaims { get; set; } = false;
}
public class UpdatePullPaymentModel
{
public string Id { get; set; }
public UpdatePullPaymentModel()
{
}
public UpdatePullPaymentModel(Data.PullPaymentData data)
{
if (data == null)
{
return;
}
Id = data.Id;
var blob = data.GetBlob();
Name = blob.Name;
Description = blob.Description;
CustomCSSLink = blob.View.CustomCSSLink;
EmbeddedCSS = blob.View.EmbeddedCSS;
}
[MaxLength(30)]
public string Name { get; set; }
public string Description { get; set; }
[Display(Name = "Custom CSS URL")]
public string CustomCSSLink { get; set; }
[Display(Name = "Custom CSS Code")]
public string EmbeddedCSS { get; set; }
}
}