fix: package-based compliance audit — feature DIFF, remove hardcoded fallbacks
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m12s

- ActivateClubMembership: replace GetAllFeatureIds with PackageFeature DIFF (Q20)
- ActivateClubMembership: fix re-activation early return — check current cycle
- AcceptClubMembershipContract: same feature DIFF logic
- VerifyPackagePurchase: remove ?? 2.0m fallback, throw if package null
- PackageService: remove ?? 2.0m fallback for DiscountMultiplier
- UserOrderService: remove ?? 1B fallback for MagicWalletMaxDeposit
- SystemConstants: remove 9 dead [Obsolete] constants (per-package values)
This commit is contained in:
masoodafar-web
2026-02-27 02:35:41 +03:30
parent dcd11351a3
commit 1ac23667e2
6 changed files with 147 additions and 143 deletions
@@ -314,7 +314,9 @@ public class PackageService : PackageContract.PackageContractBase
await _context.SaveChangesAsync(context.CancellationToken);
}
var discountAmount = (long)(purchase.Amount * (double)(purchase.Package?.DiscountMultiplier ?? 2.0m));
var discountMultiplier = purchase.Package?.DiscountMultiplier
?? throw new RpcException(new Status(StatusCode.Internal, "پکیج سفارش یافت نشد"));
var discountAmount = (long)(purchase.Amount * (double)discountMultiplier);
wallet.Balance += purchase.Amount;
wallet.DiscountBalance += discountAmount;