Check in rewards NSD & payment

This commit is contained in:
2025-05-15 22:03:51 +08:00
parent d7d4fde06a
commit 0db003abc2
16 changed files with 6968 additions and 53 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddCustomAppsAndSecrets : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "issuer_app_id",
table: "payment_orders",
type: "uuid",
nullable: true);
migrationBuilder.CreateTable(
name: "custom_app_secrets",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
secret = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
remarks = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
app_id = table.Column<Guid>(type: "uuid", nullable: false),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_custom_app_secrets", x => x.id);
table.ForeignKey(
name: "fk_custom_app_secrets_custom_apps_app_id",
column: x => x.app_id,
principalTable: "custom_apps",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_payment_orders_issuer_app_id",
table: "payment_orders",
column: "issuer_app_id");
migrationBuilder.CreateIndex(
name: "ix_custom_app_secrets_app_id",
table: "custom_app_secrets",
column: "app_id");
migrationBuilder.AddForeignKey(
name: "fk_payment_orders_custom_apps_issuer_app_id",
table: "payment_orders",
column: "issuer_app_id",
principalTable: "custom_apps",
principalColumn: "id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_payment_orders_custom_apps_issuer_app_id",
table: "payment_orders");
migrationBuilder.DropTable(
name: "custom_app_secrets");
migrationBuilder.DropIndex(
name: "ix_payment_orders_issuer_app_id",
table: "payment_orders");
migrationBuilder.DropColumn(
name: "issuer_app_id",
table: "payment_orders");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddRewardToCheckIn : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "reward_experience",
table: "account_check_in_results",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "reward_points",
table: "account_check_in_results",
type: "numeric",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "reward_experience",
table: "account_check_in_results");
migrationBuilder.DropColumn(
name: "reward_points",
table: "account_check_in_results");
}
}
}

View File

@ -249,6 +249,14 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("integer")
.HasColumnName("level");
b.Property<int?>("RewardExperience")
.HasColumnType("integer")
.HasColumnName("reward_experience");
b.Property<decimal?>("RewardPoints")
.HasColumnType("numeric")
.HasColumnName("reward_points");
b.Property<ICollection<FortuneTip>>("Tips")
.IsRequired()
.HasColumnType("jsonb")
@ -1197,6 +1205,53 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("custom_apps", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomAppSecret", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<Guid>("AppId")
.HasColumnType("uuid")
.HasColumnName("app_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>("Remarks")
.HasMaxLength(4096)
.HasColumnType("character varying(4096)")
.HasColumnName("remarks");
b.Property<string>("Secret")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("secret");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_custom_app_secrets");
b.HasIndex("AppId")
.HasDatabaseName("ix_custom_app_secrets_app_id");
b.ToTable("custom_app_secrets", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b =>
{
b.Property<Guid>("Id")
@ -2177,6 +2232,10 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("expired_at");
b.Property<Guid?>("IssuerAppId")
.HasColumnType("uuid")
.HasColumnName("issuer_app_id");
b.Property<Guid>("PayeeWalletId")
.HasColumnType("uuid")
.HasColumnName("payee_wallet_id");
@ -2201,6 +2260,9 @@ namespace DysonNetwork.Sphere.Migrations
b.HasKey("Id")
.HasName("pk_payment_orders");
b.HasIndex("IssuerAppId")
.HasDatabaseName("ix_payment_orders_issuer_app_id");
b.HasIndex("PayeeWalletId")
.HasDatabaseName("ix_payment_orders_payee_wallet_id");
@ -2742,6 +2804,18 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Developer");
});
modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomAppSecret", b =>
{
b.HasOne("DysonNetwork.Sphere.Developer.CustomApp", "App")
.WithMany()
.HasForeignKey("AppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_custom_app_secrets_custom_apps_app_id");
b.Navigation("App");
});
modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b =>
{
b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group")
@ -3021,6 +3095,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Wallet.Order", b =>
{
b.HasOne("DysonNetwork.Sphere.Developer.CustomApp", "IssuerApp")
.WithMany()
.HasForeignKey("IssuerAppId")
.HasConstraintName("fk_payment_orders_custom_apps_issuer_app_id");
b.HasOne("DysonNetwork.Sphere.Wallet.Wallet", "PayeeWallet")
.WithMany()
.HasForeignKey("PayeeWalletId")
@ -3033,6 +3112,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasForeignKey("TransactionId")
.HasConstraintName("fk_payment_orders_payment_transactions_transaction_id");
b.Navigation("IssuerApp");
b.Navigation("PayeeWallet");
b.Navigation("Transaction");