somasorosdpc commented on code in PR #5931:
URL: https://github.com/apache/fineract/pull/5931#discussion_r3381008747


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java:
##########
@@ -863,6 +864,14 @@ public CommandWrapperBuilder 
discountFeeAdjustmentWorkingCapitalLoanTransaction(
         return this;
     }
 
+    public CommandWrapperBuilder 
undoDiscountFeeAdjustmentWorkingCapitalLoanTransaction(final Long loanId) {
+        this.actionName = ACTION_UNDODISCOUNTFEEADJUSTMENT;
+        this.entityName = ENTITY_WORKINGCAPITALLOAN;

Review Comment:
   I think `ENTITY_WORKINGCAPITALLOANTRANSACTION` would be better, because it 
undo a transaction not a loan.



##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanTransactionsApiResource.java:
##########
@@ -184,7 +184,7 @@ private WorkingCapitalLoanCommandTemplateData 
handleLoanTransactionTemplate(fina
     @Path("{loanId}/transactions")

Review Comment:
   according to the path, and the entity you want to modify I think 
`@Path("{loanId}/transactions/{transactionId}")`  would be more suitable.
   There is a pending pr: https://github.com/apache/fineract/pull/5937 feel 
free to copy related code



##########
fineract-core/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java:
##########
@@ -863,6 +864,14 @@ public CommandWrapperBuilder 
discountFeeAdjustmentWorkingCapitalLoanTransaction(
         return this;
     }
 
+    public CommandWrapperBuilder 
undoDiscountFeeAdjustmentWorkingCapitalLoanTransaction(final Long loanId) {
+        this.actionName = ACTION_UNDODISCOUNTFEEADJUSTMENT;
+        this.entityName = ENTITY_WORKINGCAPITALLOAN;
+        this.entityId = loanId;

Review Comment:
   According the previous logic, I think, `entityId` should be the transaction 
Id and you can set `this.loanId = loanId;` to make sure  loanId is handled and 
preserved properly on the command.



##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/handler/UndoWorkingCapitalLoanDiscountFeeAdjustmentCommandHandler.java:
##########
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.portfolio.workingcapitalloan.handler;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.commands.annotation.CommandType;
+import org.apache.fineract.commands.handler.NewCommandSourceHandler;
+import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
+import 
org.apache.fineract.portfolio.workingcapitalloan.service.WorkingCapitalLoanWritePlatformService;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor
+@CommandType(entity = "WORKINGCAPITALLOAN", action = 
"UNDODISCOUNTFEEADJUSTMENT")

Review Comment:
   could you please use the same constants which were used in 
`CommandWrapperBuilder` instead of magic string



-- 
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