2020-06-28 21:44:35 -05:00
|
|
|
using System;
|
2020-06-27 21:55:16 +09:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2017-10-25 01:41:01 +09:00
|
|
|
|
|
|
|
namespace BTCPayServer.Data
|
|
|
|
{
|
|
|
|
public class HistoricalAddressInvoiceData
|
|
|
|
{
|
2017-10-27 17:53:04 +09:00
|
|
|
public string InvoiceDataId
|
|
|
|
{
|
|
|
|
get; set;
|
|
|
|
}
|
2017-10-25 01:41:01 +09:00
|
|
|
|
2018-07-19 19:31:17 +09:00
|
|
|
public InvoiceData InvoiceData
|
|
|
|
{
|
|
|
|
get; set;
|
|
|
|
}
|
|
|
|
|
2018-01-09 01:56:37 +09:00
|
|
|
/// <summary>
|
|
|
|
/// Some crypto currencies share same address prefix
|
|
|
|
/// For not having exceptions thrown by two address on different network, we suffix by "#CRYPTOCODE"
|
|
|
|
/// </summary>
|
|
|
|
[Obsolete("Use GetCryptoCode instead")]
|
2017-10-27 17:53:04 +09:00
|
|
|
public string Address
|
|
|
|
{
|
|
|
|
get; set;
|
|
|
|
}
|
2017-10-25 01:41:01 +09:00
|
|
|
|
2017-12-21 15:52:04 +09:00
|
|
|
|
|
|
|
[Obsolete("Use GetCryptoCode instead")]
|
|
|
|
public string CryptoCode { get; set; }
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public DateTimeOffset Assigned
|
|
|
|
{
|
|
|
|
get; set;
|
|
|
|
}
|
2017-10-25 01:41:01 +09:00
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public DateTimeOffset? UnAssigned
|
|
|
|
{
|
|
|
|
get; set;
|
|
|
|
}
|
2020-06-27 21:55:16 +09:00
|
|
|
|
|
|
|
internal static void OnModelCreating(ModelBuilder builder)
|
|
|
|
{
|
|
|
|
builder.Entity<HistoricalAddressInvoiceData>()
|
|
|
|
.HasOne(o => o.InvoiceData)
|
|
|
|
.WithMany(i => i.HistoricalAddressInvoices).OnDelete(DeleteBehavior.Cascade);
|
|
|
|
builder.Entity<HistoricalAddressInvoiceData>()
|
|
|
|
.HasKey(o => new
|
|
|
|
{
|
|
|
|
o.InvoiceDataId,
|
|
|
|
#pragma warning disable CS0618
|
|
|
|
o.Address
|
|
|
|
#pragma warning restore CS0618
|
|
|
|
});
|
|
|
|
}
|
2017-10-27 17:53:04 +09:00
|
|
|
}
|
2017-10-25 01:41:01 +09:00
|
|
|
}
|