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
@@ -181,6 +181,9 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
if (wallet == null)
throw new RpcException(new Status(StatusCode.NotFound, "کیف پول یافت نشد"));
var cycleCount = await _context.ClubMembershipCycles
.CountAsync(c => c.UserId == userId, context.CancellationToken);
var response = new GetMagicWalletStatusResponse
{
WalletMode = (int)wallet.WalletMode,
@@ -188,7 +191,8 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
MagicTotalCredited = wallet.MagicTotalCredited,
MagicMaxDeposit = SystemConstants.MagicWalletMaxDeposit,
MagicRemainingDeposit = Math.Max(0, SystemConstants.MagicWalletMaxDeposit - wallet.MagicTotalDeposited),
Balance = wallet.Balance
Balance = wallet.Balance,
PurchaseCycleCount = cycleCount
};
if (wallet.MagicActivatedAt.HasValue)