You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "Pushkal-9 (via GitHub)" <gi...@apache.org> on 2024/02/24 02:22:31 UTC

[PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Pushkal-9 opened a new pull request, #3764:
URL: https://github.com/apache/fineract/pull/3764

   …2056)
   
   ## Description
   
   Describe the changes made and why they were made.
   
   Introduced Lombok based annotations to the interoperation package of savings module in order to reduce the boilerplate code.
   
   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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1502965375


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java:
##########
@@ -29,11 +29,18 @@
 import jakarta.validation.constraints.NotNull;
 import java.time.LocalDateTime;
 import java.util.Objects;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 import org.apache.fineract.infrastructure.core.service.DateUtils;
 import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
 
 @Entity
+@Setter

Review Comment:
   None of the setters are used. I dont think we need to have it at all!



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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1502962786


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/data/InteropIdentifierData.java:
##########
@@ -19,41 +19,28 @@
 package org.apache.fineract.interoperation.data;
 
 import jakarta.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.fineract.interoperation.domain.InteropIdentifier;
 import org.apache.fineract.interoperation.domain.InteropIdentifierType;
 
+@Getter
+@AllArgsConstructor
 public class InteropIdentifierData {
 
     @NotNull
-    private final InteropIdentifierType idType;

Review Comment:
   Why do you remove the final tag?



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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "vidakovic (via GitHub)" <gi...@apache.org>.
vidakovic commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1503010680


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java:
##########
@@ -29,11 +29,18 @@
 import jakarta.validation.constraints.NotNull;
 import java.time.LocalDateTime;
 import java.util.Objects;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 import org.apache.fineract.infrastructure.core.service.DateUtils;
 import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
 
 @Entity
+@Setter

Review Comment:
   @adamsaghy ... not entirely true... standard (portable) JPA entities essentially require this.



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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "Pushkal-9 (via GitHub)" <gi...@apache.org>.
Pushkal-9 commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1503146439


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/data/InteropIdentifierData.java:
##########
@@ -19,41 +19,28 @@
 package org.apache.fineract.interoperation.data;
 
 import jakarta.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.fineract.interoperation.domain.InteropIdentifier;
 import org.apache.fineract.interoperation.domain.InteropIdentifierType;
 
+@Getter
+@AllArgsConstructor
 public class InteropIdentifierData {
 
     @NotNull
-    private final InteropIdentifierType idType;

Review Comment:
   @adamsaghy it is still implicitly immutable as there are no setters and it is initialised using constructor, but I'll revert this change to make it explicit. 



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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #3764:
URL: https://github.com/apache/fineract/pull/3764


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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "vidakovic (via GitHub)" <gi...@apache.org>.
vidakovic commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1503013965


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/data/InteropIdentifierData.java:
##########
@@ -19,41 +19,28 @@
 package org.apache.fineract.interoperation.data;
 
 import jakarta.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.fineract.interoperation.domain.InteropIdentifier;
 import org.apache.fineract.interoperation.domain.InteropIdentifierType;
 
+@Getter
+@AllArgsConstructor
 public class InteropIdentifierData {
 
     @NotNull
-    private final InteropIdentifierType idType;

Review Comment:
   @adamsaghy I think the idea is to better use the builder pattern instead of a gigantic (depending on number of class attributes) constructor with "57" string parameters (I am exaggerating).



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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1503062617


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/data/InteropIdentifierData.java:
##########
@@ -19,41 +19,28 @@
 package org.apache.fineract.interoperation.data;
 
 import jakarta.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.fineract.interoperation.domain.InteropIdentifier;
 import org.apache.fineract.interoperation.domain.InteropIdentifierType;
 
+@Getter
+@AllArgsConstructor
 public class InteropIdentifierData {
 
     @NotNull
-    private final InteropIdentifierType idType;

Review Comment:
   Builder pattern might be okay, but it is not used here. so its just a simple dto which is created once and from that moment it is immutable.



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


Re: [PR] FINERACT-2056: Introduce Lombok to savings module: interoperation package. [fineract]

Posted by "Pushkal-9 (via GitHub)" <gi...@apache.org>.
Pushkal-9 commented on code in PR #3764:
URL: https://github.com/apache/fineract/pull/3764#discussion_r1503124725


##########
fineract-savings/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java:
##########
@@ -29,11 +29,18 @@
 import jakarta.validation.constraints.NotNull;
 import java.time.LocalDateTime;
 import java.util.Objects;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 import org.apache.fineract.infrastructure.core.service.DateUtils;
 import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
 
 @Entity
+@Setter

Review Comment:
   @adamsaghy There are some setter methods previously written in the class, didn't want to break that backward compatibility, also as @vidakovic mentioned JPA entities would require this.



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