galovics commented on code in PR #2845:
URL: https://github.com/apache/fineract/pull/2845#discussion_r1058306504


##########
fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java:
##########
@@ -354,7 +354,7 @@ public InteropQuoteResponseData createQuote(@NotNull 
JsonCommand command) {
 
         final BigDecimal fee;
         if (transactionType.isDebit()) {
-            fee = 
savingsAccount.calculateWithdrawalFee(request.getAmount().getAmount());
+            fee = 
savingsAccount.calculateTransactionFee(request.getAmount().getAmount());

Review Comment:
   This must be an unrelated change, isn't it? If so, let's get rid of it.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeTimeType.java:
##########
@@ -37,7 +37,8 @@ public enum ChargeTimeType {
     SHAREACCOUNT_ACTIVATION(13, "chargeTimeType.activation"), // only for loan
     SHARE_PURCHASE(14, "chargeTimeType.sharespurchase"), SHARE_REDEEM(15, 
"chargeTimeType.sharesredeem"),
 
-    SAVINGS_NOACTIVITY_FEE(16, "chargeTimeType.savingsNoActivityFee");
+    SAVINGS_NOACTIVITY_FEE(16, "chargeTimeType.savingsNoActivityFee"), // only 
for savings

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -6215,7 +6215,8 @@ private ChangedTransactionDetail 
handleRefundTransaction(final LoanTransaction l
     }
 
     public void handleChargebackTransaction(final LoanTransaction 
chargebackTransaction,
-            final LoanLifecycleStateMachine loanLifecycleStateMachine) {
+            final LoanLifecycleStateMachine loanLifecycleStateMachine, final 
List<Long> existingTransactionIds,

Review Comment:
   I don't really like this change because it'll bring side-effects to an 
already complex codebase.
   
   Why can't we just do the findExistingTransactionIds and 
findExistingReversedTransactionIds where this is being called?



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java:
##########
@@ -223,12 +223,12 @@ private Charge(final String name, final BigDecimal 
amount, final String currency
                         
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.calculation.type.for.savings");
             }
 
-            if (!(ChargeTimeType.fromInt(getChargeTimeType()).isWithdrawalFee()
-                    || 
ChargeTimeType.fromInt(getChargeTimeType()).isSavingsNoActivityFee())
+            final ChargeTimeType chargeTimeType = 
ChargeTimeType.fromInt(getChargeTimeType());

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java:
##########
@@ -1150,6 +1150,9 @@ public SavingsAccountTransaction deposit(final 
SavingsAccountTransactionDTO tran
             addTransaction(transaction);
         }
 
+        payDepositFee(transactionDTO.getTransactionAmount(), 
transactionDTO.getTransactionDate(), transactionDTO.getAppUser(),

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountData.java:
##########
@@ -901,7 +901,7 @@ private SavingsAccountData(final Long id, final String 
accountNo, final EnumOpti
         this.savingsAmountOnHold = savingsAmountOnHold;
     }
 
-    private SavingsAccountChargeData calculateWithdrawalFee() {
+    private SavingsAccountChargeData calculateTransactionFee() {

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeEnumerations.java:
##########
@@ -58,6 +58,10 @@ public static EnumOptionData chargeTimeType(final 
ChargeTimeType type) {
                 optionData = new 
EnumOptionData(ChargeTimeType.WITHDRAWAL_FEE.getValue().longValue(),
                         ChargeTimeType.WITHDRAWAL_FEE.getCode(), "Withdrawal 
Fee");
             break;
+            case DEPOSIT_FEE:

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java:
##########
@@ -1347,6 +1350,41 @@ private void payWithdrawalFee(final BigDecimal 
transactionAmount, final LocalDat
         }
     }
 
+    private void payDepositFee(final BigDecimal transactionAmount, final 
LocalDate transactionDate, final AppUser user,

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeDropdownReadPlatformServiceImpl.java:
##########
@@ -102,7 +102,8 @@ public List<EnumOptionData> 
retrieveSavingsCollectionTimeTypes() {
                 // chargeTimeType(ChargeTimeType.SAVINGS_CLOSURE),
                 chargeTimeType(ChargeTimeType.WITHDRAWAL_FEE), 
chargeTimeType(ChargeTimeType.ANNUAL_FEE),
                 chargeTimeType(ChargeTimeType.MONTHLY_FEE), 
chargeTimeType(ChargeTimeType.WEEKLY_FEE),
-                chargeTimeType(ChargeTimeType.OVERDRAFT_FEE), 
chargeTimeType(ChargeTimeType.SAVINGS_NOACTIVITY_FEE));
+                chargeTimeType(ChargeTimeType.OVERDRAFT_FEE), 
chargeTimeType(ChargeTimeType.SAVINGS_NOACTIVITY_FEE),

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java:
##########
@@ -720,6 +720,10 @@ public boolean isWithdrawalFee() {
         return ChargeTimeType.fromInt(this.chargeTime).isWithdrawalFee();
     }
 
+    public boolean isDepositFee() {

Review Comment:
   This is also unrelated.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -287,7 +287,7 @@ private boolean 
isAnyLoanProductsAssociateWithThisCharge(final Long chargeId) {
     }
 
     private boolean isAnySavingsProductsAssociateWithThisCharge(final Long 
chargeId) {
-        final String sql = "select (CASE WHEN (exists (select 1 from 
m_savings_product_charge sc where sc.charge_id = ?)) = 1 THEN 'true' ELSE 
'false' END)";
+        final String sql = "select (CASE WHEN exists (select 1 from 
m_savings_product_charge sc where sc.charge_id = ?) THEN 'true' ELSE 'false' 
END)";

Review Comment:
   This is also unrelated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to