[Refactor] Move SQL classes in their own assembly

This commit is contained in:
nicolas.dorier
2019-08-30 00:24:42 +09:00
parent 5b4e78f8d1
commit f257f9f91d
127 changed files with 896 additions and 787 deletions

View File

@@ -8,9 +8,6 @@ using BTCPayServer.Services.Invoices;
using BTCPayServer.Services.Stores;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
using NBitcoin;
using NBXplorer;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Services.PaymentRequests
{
@@ -204,61 +201,4 @@ namespace BTCPayServer.Services.PaymentRequests
public int? Skip { get; set; }
public int? Count { get; set; }
}
public class PaymentRequestData
{
public string Id { get; set; }
public DateTimeOffset Created
{
get; set;
}
public string StoreDataId { get; set; }
public StoreData StoreData { get; set; }
public PaymentRequestStatus Status { get; set; }
public byte[] Blob { get; set; }
public PaymentRequestBlob GetBlob()
{
var result = Blob == null
? new PaymentRequestBlob()
: JObject.Parse(ZipUtils.Unzip(Blob)).ToObject<PaymentRequestBlob>();
return result;
}
public bool SetBlob(PaymentRequestBlob blob)
{
var original = new Serializer(Network.Main).ToString(GetBlob());
var newBlob = new Serializer(Network.Main).ToString(blob);
if (original == newBlob)
return false;
Blob = ZipUtils.Zip(newBlob);
return true;
}
public class PaymentRequestBlob
{
public decimal Amount { get; set; }
public string Currency { get; set; }
public DateTime? ExpiryDate { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Email { get; set; }
public string EmbeddedCSS { get; set; }
public string CustomCSSLink { get; set; }
public bool AllowCustomPaymentAmounts { get; set; }
}
public enum PaymentRequestStatus
{
Pending = 0,
Completed = 1,
Expired = 2
}
}
}