feat: Magic Wallet Phase 6 + Daya restriction + purchase cycle count

- ActivateClubMembershipCommandHandler: block activation in Magic mode
- CheckAndProcessDayaLoansCommandHandler: reject Daya after first cycle
- userwallet.proto: add purchase_cycle_count to GetMagicWalletStatusResponse
- UserWalletService: query ClubMembershipCycles count for cycle info
- EF Migration u21: ClubMembershipCycle table + UserWallet Magic fields
This commit is contained in:
masoodafar-web
2026-02-22 20:04:13 +03:30
parent bdd2c51726
commit 58d419ced3
7 changed files with 5062 additions and 1 deletions
@@ -439,6 +439,71 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.ToTable("ClubMemberships", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Club.ClubMembershipCycle", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
b.Property<long>("ClubMembershipId")
.HasColumnType("bigint");
b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property<int>("CycleNumber")
.HasColumnType("int");
b.Property<bool>("IsCurrentCycle")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime?>("LastModified")
.HasColumnType("datetime2");
b.Property<string>("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("MagicCompletedAt")
.HasColumnType("datetime2");
b.Property<DateTime?>("MagicStartedAt")
.HasColumnType("datetime2");
b.Property<long>("PackageAmount")
.HasColumnType("bigint");
b.Property<DateTime>("PackagePurchasedAt")
.HasColumnType("datetime2");
b.Property<int>("PurchaseMethod")
.HasColumnType("int");
b.Property<long>("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ClubMembershipId");
b.HasIndex("PackagePurchasedAt")
.HasDatabaseName("IX_ClubMembershipCycle_PackagePurchasedAt");
b.HasIndex("UserId", "IsCurrentCycle")
.HasDatabaseName("IX_ClubMembershipCycle_UserId_IsCurrentCycle");
b.ToTable("ClubMembershipCycles", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Club.UserClubFeature", b =>
{
b.Property<long>("Id")
@@ -3576,12 +3641,33 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.Property<string>("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("MagicActivatedAt")
.HasColumnType("datetime2");
b.Property<DateTime?>("MagicCompletedAt")
.HasColumnType("datetime2");
b.Property<long>("MagicTotalCredited")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasDefaultValue(0L);
b.Property<long>("MagicTotalDeposited")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasDefaultValue(0L);
b.Property<long>("NetworkBalance")
.HasColumnType("bigint");
b.Property<long>("UserId")
.HasColumnType("bigint");
b.Property<int>("WalletMode")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(0);
b.HasKey("Id");
b.HasIndex("UserId");
@@ -3871,6 +3957,25 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Club.ClubMembershipCycle", b =>
{
b.HasOne("CMSMicroservice.Domain.Entities.Club.ClubMembership", "ClubMembership")
.WithMany("Cycles")
.HasForeignKey("ClubMembershipId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("CMSMicroservice.Domain.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("ClubMembership");
b.Navigation("User");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Club.UserClubFeature", b =>
{
b.HasOne("CMSMicroservice.Domain.Entities.Club.ClubFeature", "ClubFeature")
@@ -4496,6 +4601,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
{
b.Navigation("ClubMembershipHistories");
b.Navigation("Cycles");
b.Navigation("UserClubFeatures");
});