You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "yuwatidora (via GitHub)" <gi...@apache.org> on 2025/04/27 14:22:51 UTC

[PR] FINERACT-391: Fund Management-Archive Fund [fineract]

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

   ## Description
   
   Describe the changes made and why they were made.
   
   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!
   
   - [x] Write the commit message as per https://github.com/apache/fineract/#pull-requests
   - [x] 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.
   - [x] Create/update unit or integration tests for verifying the changes made.
   - [x] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   - [x] 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
   - [x] 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-391: Fund Management-Archive Fund [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #4626:
URL: https://github.com/apache/fineract/pull/4626#issuecomment-2835189542

   @yuwatidora Make sure you run this below command before commit:
   `./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest rat`


-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/api/JsonCommand.java:
##########
@@ -20,6 +20,7 @@
 
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;

Review Comment:
   Unused import



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -99,6 +99,25 @@ public CommandProcessingResult updateFund(final Long fundId, final JsonCommand c
         }
     }
 
+    @Transactional
+    @Override
+    @CacheEvict(value = "funds", key = "T(org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('fn')")
+    public CommandProcessingResult archiveFund(final Long fundId) {
+
+        this.context.authenticatedUser();

Review Comment:
   Unused...



-- 
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-391: Fund Management-Archive Fund [fineract]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4626: FINERACT-391: Fund Management-Archive Fund
URL: https://github.com/apache/fineract/pull/4626


-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-provider/src/main/resources/db/changelog/tenant/parts/0175_add_is_active_column_to_fund.xml:
##########
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<databaseChangeLog

Review Comment:
   add license header just after line 1



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-provider/src/test/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceImplTest.java:
##########
@@ -0,0 +1,63 @@
+package org.apache.fineract.portfolio.fund.service;

Review Comment:
   add license header at top



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/handler/ArchiveFundCommandHandler.java:
##########
@@ -0,0 +1,27 @@
+package org.apache.fineract.portfolio.fund.handler;

Review Comment:
   add license header at top



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/fund/data/FundData.java:
##########
@@ -34,13 +34,17 @@ public final class FundData implements Serializable {
     @SuppressWarnings("unused")
     private final String externalId;
 
-    public static FundData instance(final Long id, final String name, final String externalId) {
-        return new FundData(id, name, externalId);
+    private final Boolean isActive;
+
+    public static FundData instance(final Long id, final String name, final String externalId, final Boolean isActive) {
+        return new FundData(id, name, externalId, isActive);
     }
 
-    private FundData(final Long id, final String name, final String externalId) {
+    private FundData(final Long id, final String name, final String externalId, final Boolean isActive) {
         this.id = id;
         this.name = name;
         this.externalId = externalId;
+        this.isActive = isActive;
     }
+    public String getName(){return this.name; } //for testing

Review Comment:
   There is already lombok getter, so no need for this method...



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java:
##########
@@ -39,6 +43,9 @@ public class Fund extends AbstractPersistableCustom<Long> {
     @Column(name = "external_id", length = 100)
     private String externalId;
 
+    @Column(name = "is_active")
+    private Boolean isActive;
+
     public static Fund fromJson(final JsonCommand command) {
 
         final String firstnameParamName = "name";

Review Comment:
   Would you mind to rename these incorrect variables?



##########
fineract-core/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java:
##########
@@ -47,16 +54,21 @@ public static Fund fromJson(final JsonCommand command) {
         final String lastnameParamName = "externalId";
         final String externalId = command.stringValueOfParameterNamed(lastnameParamName);

Review Comment:
   Would you mind to rename these incorrect variables?



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java:
##########
@@ -3822,4 +3830,6 @@ public CommandWrapperBuilder updateInterestPause(final String loanExternalId, fi
         this.href = "/v1/loans/external-id/" + loanExternalId + "/interest-pauses/" + variationId;
         return this;
     }
+

Review Comment:
   No need extra lines...



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java:
##########
@@ -47,16 +54,21 @@ public static Fund fromJson(final JsonCommand command) {
         final String lastnameParamName = "externalId";
         final String externalId = command.stringValueOfParameterNamed(lastnameParamName);
 
-        return new Fund(name, externalId);
+        final String archiveParamName = "isActive";

Review Comment:
   archiveParamName and "isActive" looks not correct. Would you mind to rename?



-- 
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-391: Fund Management-Archive Fund [fineract]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4626:
URL: https://github.com/apache/fineract/pull/4626#issuecomment-2917898395

   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java:
##########
@@ -24,10 +24,14 @@
 import jakarta.persistence.UniqueConstraint;
 import java.util.LinkedHashMap;
 import java.util.Map;
+
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
 import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
 
+import javax.swing.text.StyledEditorKit;

Review Comment:
   Unused import



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/serialization/FundCommandFromApiJsonDeserializer.java:
##########
@@ -33,6 +33,7 @@
 import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
 import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
 import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
+import org.apache.kafka.common.protocol.types.Field;

Review Comment:
   Unused import...



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java:
##########
@@ -3822,4 +3830,6 @@ public CommandWrapperBuilder updateInterestPause(final String loanExternalId, fi
         this.href = "/v1/loans/external-id/" + loanExternalId + "/interest-pauses/" + variationId;
         return this;
     }
+

Review Comment:
   No need for extra empty lines...



-- 
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-391: Fund Management-Archive Fund [fineract]

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundReadPlatformServiceImpl.java:
##########
@@ -72,13 +73,14 @@ public FundData retrieveFund(final Long fundId) {
             this.context.authenticatedUser();
 
             final FundMapper rm = new FundMapper();
-            final String sql = "select " + rm.schema() + " where f.id = ?";
+            final String sql = "select " + rm.schema() + "where f.is_active = true where f.id = ?";

Review Comment:
   Incorrect sql. It has double WHERE parts...



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