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 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 PullPaymentState ActiveState { get; set; } = PullPaymentState.Active;
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
public class NewPullPaymentModel
|
|
|
|
{
|
|
|
|
[MaxLength(30)]
|
2024-10-25 15:48:53 +02:00
|
|
|
[Display(Name = "Name")]
|
2020-06-24 10:34:09 +09:00
|
|
|
public string Name { get; set; }
|
2024-10-25 15:48:53 +02:00
|
|
|
|
|
|
|
[Display(Name = "Description")]
|
2022-02-09 21:54:00 -08:00
|
|
|
public string Description { get; set; }
|
2024-10-25 15:48:53 +02:00
|
|
|
|
2020-06-24 10:34:09 +09:00
|
|
|
[Required]
|
2024-10-25 15:48:53 +02:00
|
|
|
[Display(Name = "Amount")]
|
|
|
|
public decimal Amount { get; set; }
|
|
|
|
|
2020-06-24 10:34:09 +09:00
|
|
|
[Required]
|
|
|
|
[ReadOnly(true)]
|
2024-10-25 15:48:53 +02:00
|
|
|
[Display(Name = "Currency")]
|
2020-06-24 10:34:09 +09:00
|
|
|
public string Currency { get; set; }
|
2021-10-18 05:37:59 +02:00
|
|
|
|
2024-05-01 10:22:07 +09:00
|
|
|
[Display(Name = "Payout Methods")]
|
|
|
|
public IEnumerable<string> PayoutMethods { get; set; }
|
|
|
|
public IEnumerable<SelectListItem> PayoutMethodsItem { 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")]
|
2024-10-25 15:48:53 +02:00
|
|
|
public bool AutoApproveClaims { get; set; }
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|
2022-08-11 14:30:42 +02:00
|
|
|
|
|
|
|
public class UpdatePullPaymentModel
|
|
|
|
{
|
2024-10-25 15:48:53 +02:00
|
|
|
[Display(Name = "Id")]
|
2022-08-11 14:30:42 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
[MaxLength(30)]
|
2024-10-25 15:48:53 +02:00
|
|
|
[Display(Name = "Name")]
|
2022-08-11 14:30:42 +02:00
|
|
|
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; }
|
|
|
|
}
|
2020-06-24 10:34:09 +09:00
|
|
|
}
|