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/11/20 03:13:27 UTC

[GitHub] [fineract] josehernandezfintecheandomx opened a new pull request, #2750: Fix datatable put call with resource id

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

   ## Description
   
   Update Datatable One to Many Entry `PUT` for:
   
   `resource_id` field in response is populated with `datatableEntryId`
   
   Ignore if these details are present on the associated [Apache Fineract JIRA ticket](https://github.com/apache/fineract/pull/1284).
   
   
   ## 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] galovics merged pull request #2750: FINERACT-1815: Fix datatable put call with resource id

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


-- 
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 #2750: Fix datatable put call with resource id

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

   @josehernandezfintecheandomx can you pls change the commit message & PR title to have a Fineract ticket in it? Thanks.


-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   Why don't we simply set the subResourceId in this case?



-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   I think we dont need these conditions.
   `
   CommandProcessingResultBuilder result = new CommandProcessingResultBuilder()
   .withEntityId(command.entityId()
   .withSubEntityId(command.subentityId())
   ...
   `



-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   @galovics what you mean? Currently there is not any method in the `JsonCommand` class to return the `subresourceId` attribute, I mean the `subentityId()` method returns that attribute 
   
   <img width="401" alt="Screenshot 2022-11-21 at 13 25 02" src="https://user-images.githubusercontent.com/44206706/203141768-75c48196-9a54-4447-98ab-df22c0fe0e22.png">
   
   



-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   I think we dont need these conditions.
   `
   CommandProcessingResultBuilder result = new CommandProcessingResultBuilder()
   .withEntityId(command.entityId()
   .withSubEntityId(command.subentityId()
   ...
   `



-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   Personally i would do this:
   ```
   new CommandProcessingResultBuilder().withEntityId(datatableId != null? datatableId : appTableId);
   ```



-- 
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 #2750: FINERACT-1815: Fix datatable put call with resource id

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

   > @josehernandezfintecheandomx can you pls change the commit message & PR title to have a Fineract ticket in it? Thanks.
   
   @galovics Title updated


-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   I think we dont need these conditions.
   `
   CommandProcessingResultBuilder result = new CommandProcessingResultBuilder()
   .withEntityId(command.entityId()
   .withSubEntityId(command.subentityId())
   ...
   `



##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

Review Comment:
   subEntity == subResourceId



-- 
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 #2750: Fix datatable put call with resource id

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


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -1415,14 +1415,22 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName,
             }
         }
 
-        return new CommandProcessingResultBuilder() //
+        CommandProcessingResultBuilder result = new CommandProcessingResultBuilder() //
+                .withCommandId(command.commandId()) //
                 .withOfficeId(commandProcessingResult.getOfficeId()) //
                 .withGroupId(commandProcessingResult.getGroupId()) //
                 .withClientId(commandProcessingResult.getClientId()) //
                 .withSavingsId(commandProcessingResult.getSavingsId()) //
                 .withLoanId(commandProcessingResult.getLoanId()) //
-                .with(changes) //
-                .build();
+                .with(changes);
+
+        if (command.subentityId() != null) {
+            result = result.withEntityId(command.subentityId());

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