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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user