fix: IPG DiscountBalance should be 2× BasePackageAmount (112M not 56M)
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m44s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m44s
Both VerifyBasePackagePayment and VerifyPackagePurchase handlers were charging DiscountBalance with 1× amount instead of 2×. Now consistent with DayaLoan and ManualPayment handlers. - VerifyBasePackagePaymentCommandHandler: DiscountBalance += BasePackageAmount * 2 - VerifyPackagePurchaseCommandHandler: DiscountBalance += order.Amount * 2 - Change logs updated to reflect correct 2× discount value
This commit is contained in:
+2
-2
@@ -133,7 +133,7 @@ public class VerifyBasePackagePaymentCommandHandler : IRequestHandler<VerifyBase
|
|||||||
var oldDiscountBalance = userWallet.DiscountBalance;
|
var oldDiscountBalance = userWallet.DiscountBalance;
|
||||||
|
|
||||||
userWallet.Balance += SystemConstants.BasePackageAmount;
|
userWallet.Balance += SystemConstants.BasePackageAmount;
|
||||||
userWallet.DiscountBalance += SystemConstants.BasePackageAmount;
|
userWallet.DiscountBalance += SystemConstants.BasePackageAmount * 2;
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"Charging wallet for user {UserId}. Balance: {OldBalance} -> {NewBalance}, DiscountBalance: {OldDiscount} -> {NewDiscount}",
|
"Charging wallet for user {UserId}. Balance: {OldBalance} -> {NewBalance}, DiscountBalance: {OldDiscount} -> {NewDiscount}",
|
||||||
@@ -157,7 +157,7 @@ public class VerifyBasePackagePaymentCommandHandler : IRequestHandler<VerifyBase
|
|||||||
CurrentNetworkBalance = userWallet.NetworkBalance,
|
CurrentNetworkBalance = userWallet.NetworkBalance,
|
||||||
ChangeNerworkValue = 0,
|
ChangeNerworkValue = 0,
|
||||||
CurrentDiscountBalance = userWallet.DiscountBalance,
|
CurrentDiscountBalance = userWallet.DiscountBalance,
|
||||||
ChangeDiscountValue = SystemConstants.BasePackageAmount,
|
ChangeDiscountValue = SystemConstants.BasePackageAmount * 2,
|
||||||
IsIncrease = true,
|
IsIncrease = true,
|
||||||
RefrenceId = transaction.Id
|
RefrenceId = transaction.Id
|
||||||
};
|
};
|
||||||
|
|||||||
+4
-4
@@ -99,9 +99,9 @@ public class VerifyPackagePurchaseCommandHandler
|
|||||||
wallet.Balance
|
wallet.Balance
|
||||||
);
|
);
|
||||||
|
|
||||||
// شارژ DiscountBalance (موجودی تخفیف)
|
// شارژ DiscountBalance (موجودی تخفیف) — دو برابر مبلغ سفارش
|
||||||
var oldDiscountBalance = wallet.DiscountBalance;
|
var oldDiscountBalance = wallet.DiscountBalance;
|
||||||
wallet.DiscountBalance += order.Amount;
|
wallet.DiscountBalance += order.Amount * 2;
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"Charging DiscountBalance for UserId {UserId}: {OldBalance} -> {NewBalance}",
|
"Charging DiscountBalance for UserId {UserId}: {OldBalance} -> {NewBalance}",
|
||||||
@@ -132,7 +132,7 @@ public class VerifyPackagePurchaseCommandHandler
|
|||||||
ChangeValue = order.Amount,
|
ChangeValue = order.Amount,
|
||||||
CurrentNetworkBalance = wallet.NetworkBalance,
|
CurrentNetworkBalance = wallet.NetworkBalance,
|
||||||
ChangeNerworkValue = 0,
|
ChangeNerworkValue = 0,
|
||||||
CurrentDiscountBalance = wallet.DiscountBalance - order.Amount, // قبل از شارژ DiscountBalance
|
CurrentDiscountBalance = wallet.DiscountBalance - (order.Amount * 2), // قبل از شارژ DiscountBalance
|
||||||
ChangeDiscountValue = 0,
|
ChangeDiscountValue = 0,
|
||||||
IsIncrease = true,
|
IsIncrease = true,
|
||||||
RefrenceId = transaction.Id
|
RefrenceId = transaction.Id
|
||||||
@@ -148,7 +148,7 @@ public class VerifyPackagePurchaseCommandHandler
|
|||||||
CurrentNetworkBalance = wallet.NetworkBalance,
|
CurrentNetworkBalance = wallet.NetworkBalance,
|
||||||
ChangeNerworkValue = 0,
|
ChangeNerworkValue = 0,
|
||||||
CurrentDiscountBalance = wallet.DiscountBalance,
|
CurrentDiscountBalance = wallet.DiscountBalance,
|
||||||
ChangeDiscountValue = order.Amount,
|
ChangeDiscountValue = order.Amount * 2,
|
||||||
IsIncrease = true,
|
IsIncrease = true,
|
||||||
RefrenceId = transaction.Id
|
RefrenceId = transaction.Id
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user