You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2022/08/09 01:36:31 UTC

[GitHub] [fineract] josehernandezfintecheandomx opened a new pull request, #2495: Loan transaction reversal data extension

josehernandezfintecheandomx opened a new pull request, #2495:
URL: https://github.com/apache/fineract/pull/2495

   ## Description
   
   Upon reversing a loan transaction, 2 new data fields need to be added. One is the ability to provide an external ID for the reversal and one for storing when the reversal happened.
   
   - The external ID for the reversal is important because other systems might track reversal transactions separately. 
   
   - The reversal date is also important since the Loan transactions have a submittedOnDate, therefore it makes sense to store when a particular transaction has been reversed. It is set with the Business date value when the Loan transaction is undo
   
   Undo a Loan Transaction
   <img width="908" alt="Screen Shot 2022-08-08 at 19 59 02" src="https://user-images.githubusercontent.com/44206706/183543617-8a6a63be-a617-4c73-bf22-ead84fb67352.png">
   
   Get the Loan Transaction reversed
   <img width="831" alt="Screen Shot 2022-08-08 at 20 17 20" src="https://user-images.githubusercontent.com/44206706/183543721-246366b3-1685-4d27-9ea6-82f4d366d324.png">
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per https://github.com/apache/fineract/#pull-requests
   
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   
   - [ ] Create/update unit or integration tests for verifying the changes made.
   
   - [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   
   - [ ] Submission is not a "code dump".  (Large changes can be made "in repository" via a branch.  Ask on the developer mailing list for guidance, if required.)
   
   FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
   


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
adamsaghy commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r941375263


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java:
##########
@@ -106,6 +106,12 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom {
     @Column(name = "external_id", length = 100, nullable = true, unique = true)
     private String externalId;
 
+    @Column(name = "reversal_external_id", length = 100, nullable = true, unique = true)
+    private String reversalExternalId;
+
+    @Column(name = "reversed_on_date", nullable = false)

Review Comment:
   @josehernandezfintecheandomx It should be nullable!



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r946974209


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TextUtils.java:
##########
@@ -0,0 +1,31 @@
+/**
+ * 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.infrastructure.core.service;
+
+import org.apache.commons.lang3.StringUtils;
+
+public final class TextUtils {
+
+    private TextUtils() {}
+
+    public static boolean is(final String commandParam, final String commandValue) {

Review Comment:
   Done!



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on PR #2495:
URL: https://github.com/apache/fineract/pull/2495#issuecomment-1215651162

   > @josehernandezfintecheandomx Please take a look on the conflicts!
   
   Done @adamsaghy 


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on PR #2495:
URL: https://github.com/apache/fineract/pull/2495#issuecomment-1218053894

   > @josehernandezfintecheandomx please resolve the conflicts.
   
   The conflicts are solved


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r942777504


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanEventApiJsonValidator.java:
##########
@@ -213,6 +207,11 @@ public void validateTransaction(final String json) {
         final String note = this.fromApiJsonHelper.extractStringNamed("note", element);
         baseDataValidator.reset().parameter("note").value(note).notExceedingLengthOf(1000);
 
+        final String reversalExternalId = this.fromApiJsonHelper.extractStringNamed(LoanApiConstants.REVERSAL_EXTERNAL_ID_PARAMNAME,
+                element);
+        baseDataValidator.reset().parameter(LoanApiConstants.REVERSAL_EXTERNAL_ID_PARAMNAME).ignoreIfNull().value(reversalExternalId)
+                .notExceedingLengthOf(1000);

Review Comment:
   Done!



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
galovics commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r946931301


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java:
##########
@@ -837,6 +849,10 @@ public LocalDate getSubmittedOnDate() {
         return submittedOnDate;
     }
 
+    public void setReversalExternalId(String reversalExternalId) {

Review Comment:
   I don't think we wanna allow to override the reversal external ID once its set, do we?
   I feel the reverse method should be more than enough to provide the reversal external ID.



##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TextUtils.java:
##########
@@ -0,0 +1,31 @@
+/**
+ * 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.infrastructure.core.service;
+
+import org.apache.commons.lang3.StringUtils;
+
+public final class TextUtils {
+
+    private TextUtils() {}
+
+    public static boolean is(final String commandParam, final String commandValue) {

Review Comment:
   I see you extracted this from the other class.
   I think the TextUtils is very generic, it rather should be something like CommandParameterUtil or something with a more descriptive name.



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics merged pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
galovics merged PR #2495:
URL: https://github.com/apache/fineract/pull/2495


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics commented on pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
galovics commented on PR #2495:
URL: https://github.com/apache/fineract/pull/2495#issuecomment-1217524573

   @josehernandezfintecheandomx please resolve the conflicts.


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r942776746


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java:
##########
@@ -106,6 +106,12 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom {
     @Column(name = "external_id", length = 100, nullable = true, unique = true)
     private String externalId;
 
+    @Column(name = "reversal_external_id", length = 100, nullable = true, unique = true)
+    private String reversalExternalId;
+
+    @Column(name = "reversed_on_date", nullable = false)

Review Comment:
   Done!



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
adamsaghy commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r941379001


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanEventApiJsonValidator.java:
##########
@@ -213,6 +207,11 @@ public void validateTransaction(final String json) {
         final String note = this.fromApiJsonHelper.extractStringNamed("note", element);
         baseDataValidator.reset().parameter("note").value(note).notExceedingLengthOf(1000);
 
+        final String reversalExternalId = this.fromApiJsonHelper.extractStringNamed(LoanApiConstants.REVERSAL_EXTERNAL_ID_PARAMNAME,
+                element);
+        baseDataValidator.reset().parameter(LoanApiConstants.REVERSAL_EXTERNAL_ID_PARAMNAME).ignoreIfNull().value(reversalExternalId)
+                .notExceedingLengthOf(1000);

Review Comment:
   @josehernandezfintecheandomx Based on the liquibase script, the size of this string cannot be longer than 100



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2495:
URL: https://github.com/apache/fineract/pull/2495#discussion_r946978537


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java:
##########
@@ -837,6 +849,10 @@ public LocalDate getSubmittedOnDate() {
         return submittedOnDate;
     }
 
+    public void setReversalExternalId(String reversalExternalId) {

Review Comment:
   Done! Removed



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
adamsaghy commented on PR #2495:
URL: https://github.com/apache/fineract/pull/2495#issuecomment-1215061647

   @josehernandezfintecheandomx Please resolve the conflicts!


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on pull request #2495: Loan transaction reversal data extension

Posted by GitBox <gi...@apache.org>.
adamsaghy commented on PR #2495:
URL: https://github.com/apache/fineract/pull/2495#issuecomment-1209308488

   @josehernandezfintecheandomx Can you please take a look on the conflicts?


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org