Wallet, payment, developer apps, feature flags of publishers

♻️ Simplified the permission check of chat room, realm, publishers
This commit is contained in:
2025-05-15 00:26:15 +08:00
parent 9576870373
commit d7d4fde06a
27 changed files with 7468 additions and 124 deletions

View File

@ -1140,6 +1140,63 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("chat_realtime_call", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomApp", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("name");
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("slug");
b.Property<int>("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.Property<string>("VerifiedAs")
.HasMaxLength(4096)
.HasColumnType("character varying(4096)")
.HasColumnName("verified_as");
b.Property<Instant?>("VerifiedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("verified_at");
b.HasKey("Id")
.HasName("pk_custom_apps");
b.HasIndex("PublisherId")
.HasDatabaseName("ix_custom_apps_publisher_id");
b.ToTable("custom_apps", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b =>
{
b.Property<Guid>("Id")
@ -1565,7 +1622,7 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("post_tags", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.Publisher", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@ -1609,14 +1666,14 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("picture_id");
b.Property<int>("PublisherType")
.HasColumnType("integer")
.HasColumnName("publisher_type");
b.Property<Guid?>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<int>("Type")
.HasColumnType("integer")
.HasColumnName("type");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
@ -1643,7 +1700,49 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("publishers", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.PublisherFeature", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<Instant?>("ExpiredAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("expired_at");
b.Property<string>("Flag")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("flag");
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_publisher_features");
b.HasIndex("PublisherId")
.HasDatabaseName("ix_publisher_features_publisher_id");
b.ToTable("publisher_features", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.PublisherMember", b =>
{
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
@ -1682,7 +1781,7 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("publisher_members", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.PublisherSubscription", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@ -2049,6 +2148,200 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("files", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Order", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<decimal>("Amount")
.HasColumnType("numeric")
.HasColumnName("amount");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<string>("Currency")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("currency");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<Instant>("ExpiredAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("expired_at");
b.Property<Guid>("PayeeWalletId")
.HasColumnType("uuid")
.HasColumnName("payee_wallet_id");
b.Property<string>("Remarks")
.HasMaxLength(4096)
.HasColumnType("character varying(4096)")
.HasColumnName("remarks");
b.Property<int>("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property<Guid?>("TransactionId")
.HasColumnType("uuid")
.HasColumnName("transaction_id");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_payment_orders");
b.HasIndex("PayeeWalletId")
.HasDatabaseName("ix_payment_orders_payee_wallet_id");
b.HasIndex("TransactionId")
.HasDatabaseName("ix_payment_orders_transaction_id");
b.ToTable("payment_orders", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Transaction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<decimal>("Amount")
.HasColumnType("numeric")
.HasColumnName("amount");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<string>("Currency")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("currency");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<Guid?>("PayeeWalletId")
.HasColumnType("uuid")
.HasColumnName("payee_wallet_id");
b.Property<Guid?>("PayerWalletId")
.HasColumnType("uuid")
.HasColumnName("payer_wallet_id");
b.Property<string>("Remarks")
.HasMaxLength(4096)
.HasColumnType("character varying(4096)")
.HasColumnName("remarks");
b.Property<int>("Type")
.HasColumnType("integer")
.HasColumnName("type");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_payment_transactions");
b.HasIndex("PayeeWalletId")
.HasDatabaseName("ix_payment_transactions_payee_wallet_id");
b.HasIndex("PayerWalletId")
.HasDatabaseName("ix_payment_transactions_payer_wallet_id");
b.ToTable("payment_transactions", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Wallet", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_wallets");
b.HasIndex("AccountId")
.HasDatabaseName("ix_wallets_account_id");
b.ToTable("wallets", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.WalletPocket", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<decimal>("Amount")
.HasColumnType("numeric")
.HasColumnName("amount");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<string>("Currency")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("currency");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.Property<Guid>("WalletId")
.HasColumnType("uuid")
.HasColumnName("wallet_id");
b.HasKey("Id")
.HasName("pk_wallet_pockets");
b.HasIndex("WalletId")
.HasDatabaseName("ix_wallet_pockets_wallet_id");
b.ToTable("wallet_pockets", (string)null);
});
modelBuilder.Entity("PostPostCategory", b =>
{
b.Property<Guid>("CategoriesId")
@ -2437,6 +2730,18 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Sender");
});
modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomApp", b =>
{
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Developer")
.WithMany()
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_custom_apps_publishers_publisher_id");
b.Navigation("Developer");
});
modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b =>
{
b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group")
@ -2467,7 +2772,7 @@ namespace DysonNetwork.Sphere.Migrations
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("fk_posts_posts_forwarded_post_id");
b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher")
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Publisher")
.WithMany("Posts")
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
@ -2496,7 +2801,7 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher")
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Publisher")
.WithMany("Collections")
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
@ -2527,7 +2832,7 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Post");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.Publisher", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithMany()
@ -2558,7 +2863,19 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Realm");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.PublisherFeature", b =>
{
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Publisher")
.WithMany()
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_publisher_features_publishers_publisher_id");
b.Navigation("Publisher");
});
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.PublisherMember", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithMany()
@ -2567,7 +2884,7 @@ namespace DysonNetwork.Sphere.Migrations
.IsRequired()
.HasConstraintName("fk_publisher_members_accounts_account_id");
b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher")
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Publisher")
.WithMany("Members")
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
@ -2579,7 +2896,7 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Publisher");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.PublisherSubscription", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithMany()
@ -2588,7 +2905,7 @@ namespace DysonNetwork.Sphere.Migrations
.IsRequired()
.HasConstraintName("fk_publisher_subscriptions_accounts_account_id");
b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher")
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Publisher")
.WithMany("Subscriptions")
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
@ -2670,7 +2987,7 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher")
b.HasOne("DysonNetwork.Sphere.Publisher.Publisher", "Publisher")
.WithMany()
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
@ -2702,6 +3019,66 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Account");
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Order", b =>
{
b.HasOne("DysonNetwork.Sphere.Wallet.Wallet", "PayeeWallet")
.WithMany()
.HasForeignKey("PayeeWalletId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_payment_orders_wallets_payee_wallet_id");
b.HasOne("DysonNetwork.Sphere.Wallet.Transaction", "Transaction")
.WithMany()
.HasForeignKey("TransactionId")
.HasConstraintName("fk_payment_orders_payment_transactions_transaction_id");
b.Navigation("PayeeWallet");
b.Navigation("Transaction");
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Transaction", b =>
{
b.HasOne("DysonNetwork.Sphere.Wallet.Wallet", "PayeeWallet")
.WithMany()
.HasForeignKey("PayeeWalletId")
.HasConstraintName("fk_payment_transactions_wallets_payee_wallet_id");
b.HasOne("DysonNetwork.Sphere.Wallet.Wallet", "PayerWallet")
.WithMany()
.HasForeignKey("PayerWalletId")
.HasConstraintName("fk_payment_transactions_wallets_payer_wallet_id");
b.Navigation("PayeeWallet");
b.Navigation("PayerWallet");
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Wallet", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithMany()
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_wallets_accounts_account_id");
b.Navigation("Account");
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.WalletPocket", b =>
{
b.HasOne("DysonNetwork.Sphere.Wallet.Wallet", "Wallet")
.WithMany("Pockets")
.HasForeignKey("WalletId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_wallet_pockets_wallets_wallet_id");
b.Navigation("Wallet");
});
modelBuilder.Entity("PostPostCategory", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null)
@ -2801,7 +3178,7 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Reactions");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
modelBuilder.Entity("DysonNetwork.Sphere.Publisher.Publisher", b =>
{
b.Navigation("Collections");
@ -2818,6 +3195,11 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Members");
});
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Wallet", b =>
{
b.Navigation("Pockets");
});
#pragma warning restore 612, 618
}
}