2020-06-28 21:44:35 -05:00
|
|
|
using System;
|
2020-06-24 10:34:09 +09:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ComponentModel;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-02-17 01:13:28 -08:00
|
|
|
using BTCPayServer.Client.Models;
|
2022-08-11 14:30:42 +02:00
|
|
|
using BTCPayServer.Data;
|
2023-01-06 14:18:07 +01:00
|
|
|
using BTCPayServer.Payments;
|
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
2020-06-24 10:34:09 +09:00
|
|
|
|
|
|
|
namespace BTCPayServer.Models.WalletViewModels
|
|
|
|
{
|
2021-12-31 16:59:02 +09:00
|
|
|
public class PullPaymentsModel : BasePagingViewModel
|
2020-06-24 10:34:09 +09:00
|
|
|
{
|
|
|
|
public class PullPaymentModel
|
|
|
|
{
|
|
|
|
public class ProgressModel
|
|
|
|
{
|
|
|
|
public int CompletedPercent { get; set; }
|
|
|
|
public int AwaitingPercent { get; set; }
|
2022-06-28 16:02:17 +02:00
|
|
|
public string CompletedFormatted { get; set; }
|
|
|
|
public string AwaitingFormatted { get; set; }
|
|
|
|
public string LimitFormatted { get; set; }
|
2020-06-24 10:34:09 +09:00
|
|
|
public string ResetIn { get; set; }
|
|
|
|
public string EndIn { get; set; }
|
2022-06-28 16:02:17 +02:00
|
|
|
public decimal Awaiting { get; set; }
|
|
|
|
public decimal Completed { get; set; }
|
|
|
|
public decimal Limit { get; set; }
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|
|
|
|
public string Id { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string ProgressText { get; set; }
|
|
|
|
public ProgressModel Progress { get; set; }
|
|
|
|
public DateTimeOffset StartDate { get; set; }
|
|
|
|
public DateTimeOffset? EndDate { get; set; }
|
2022-04-28 02:51:04 +02:00
|
|
|
public bool AutoApproveClaims { get; set; }
|
2022-02-17 01:13:28 -08:00
|
|
|
public bool Archived { get; set; } = false;
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
public List<PullPaymentModel> PullPayments { get; set; } = new List<PullPaymentModel>();
|
2022-05-02 16:35:28 +09:00
|
|
|
public override int CurrentPageCount => PullPayments.Count;
|
2022-02-17 01:13:28 -08:00
|
|
|
public string PaymentMethodId { get; set; }
|
|
|
|
public IEnumerable<PaymentMethodId> PaymentMethods { get; set; }
|
|
|
|
public PullPaymentState ActiveState { get; set; } = PullPaymentState.Active;
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
public class NewPullPaymentModel
|
|
|
|
{
|
|
|
|
[MaxLength(30)]
|
|
|
|
public string Name { get; set; }
|
2022-02-09 21:54:00 -08:00
|
|
|
public string Description { get; set; }
|
2020-06-24 10:34:09 +09:00
|
|
|
[Required]
|
|
|
|
public decimal Amount
|
|
|
|
{
|
|
|
|
get; set;
|
|
|
|
}
|
|
|
|
[Required]
|
|
|
|
[ReadOnly(true)]
|
|
|
|
public string Currency { get; set; }
|
2020-12-07 20:04:50 -08:00
|
|
|
[MaxLength(500)]
|
2021-07-23 03:57:19 -07:00
|
|
|
[Display(Name = "Custom CSS URL")]
|
2020-12-07 20:04:50 -08:00
|
|
|
public string CustomCSSLink { get; set; }
|
|
|
|
[Display(Name = "Custom CSS Code")]
|
|
|
|
public string EmbeddedCSS { get; set; }
|
2021-10-18 05:37:59 +02:00
|
|
|
|
2021-11-15 19:58:17 -08:00
|
|
|
[Display(Name = "Payment Methods")]
|
2021-10-18 05:37:59 +02:00
|
|
|
public IEnumerable<string> PaymentMethods { get; set; }
|
|
|
|
public IEnumerable<SelectListItem> PaymentMethodItems { get; set; }
|
2022-01-24 20:17:09 +09:00
|
|
|
[Display(Name = "Minimum acceptable expiration time for BOLT11 for refunds")]
|
2023-04-06 08:54:19 +02:00
|
|
|
[Range(0, 365 * 10)]
|
2022-01-24 20:17:09 +09:00
|
|
|
public long BOLT11Expiration { get; set; } = 30;
|
2022-04-28 02:51:04 +02:00
|
|
|
[Display(Name = "Automatically approve claims")]
|
|
|
|
public bool AutoApproveClaims { get; set; } = false;
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|
2022-08-11 14:30:42 +02:00
|
|
|
|
|
|
|
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; }
|
2023-11-20 02:45:43 +01:00
|
|
|
|
|
|
|
[Display(Name = "Memo")]
|
2022-08-11 14:30:42 +02:00
|
|
|
public string Description { get; set; }
|
2023-11-20 02:45:43 +01:00
|
|
|
|
2022-08-11 14:30:42 +02:00
|
|
|
[Display(Name = "Custom CSS URL")]
|
|
|
|
public string CustomCSSLink { get; set; }
|
2023-11-20 02:45:43 +01:00
|
|
|
|
2022-08-11 14:30:42 +02:00
|
|
|
[Display(Name = "Custom CSS Code")]
|
|
|
|
public string EmbeddedCSS { get; set; }
|
|
|
|
}
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|