using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; namespace BTCPayServer.Data { public class WalletObjectData { public class Types { public const string Label = "label"; public const string Tx = "tx"; public const string Payjoin = "payjoin"; public const string Invoice = "invoice"; public const string PaymentRequest = "payment-request"; public const string App = "app"; public const string PayjoinExposed = "pj-exposed"; public const string Payout = "payout"; public const string PullPayment = "pull-payment"; } public string WalletId { get; set; } public string Type { get; set; } public string Id { get; set; } public string Data { get; set; } public List ChildLinks { get; set; } public List ParentLinks { get; set; } internal static void OnModelCreating(ModelBuilder builder, DatabaseFacade databaseFacade) { builder.Entity().HasKey(o => new { o.WalletId, o.Type, o.Id, }); if (databaseFacade.IsNpgsql()) { builder.Entity() .Property(o => o.Data) .HasColumnType("JSONB"); } } } }