FINERACT-2238: New command processing - Business Date Management (org.apache.fineract.infrastructure.businessdate)
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
d5958f36c7
commit
bb46397daa
+5
-6
@@ -42,7 +42,7 @@ import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.CreditAllocationData;
|
||||
import org.apache.fineract.client.models.CreditAllocationOrder;
|
||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||
@@ -68,7 +68,6 @@ import org.apache.fineract.client.models.PostLoansResponse;
|
||||
import org.apache.fineract.client.models.PostUpdateRescheduleLoansRequest;
|
||||
import org.apache.fineract.client.models.PutLoansLoanIdRequest;
|
||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -2467,7 +2466,7 @@ public class AdvancedPaymentAllocationLoanRepaymentScheduleTest extends BaseLoan
|
||||
0.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.09.16").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
@@ -2574,7 +2573,7 @@ public class AdvancedPaymentAllocationLoanRepaymentScheduleTest extends BaseLoan
|
||||
0.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.09.16").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
@@ -2679,7 +2678,7 @@ public class AdvancedPaymentAllocationLoanRepaymentScheduleTest extends BaseLoan
|
||||
0.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.09.16").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
@@ -2784,7 +2783,7 @@ public class AdvancedPaymentAllocationLoanRepaymentScheduleTest extends BaseLoan
|
||||
0.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.09.16").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
|
||||
+5
-6
@@ -19,7 +19,6 @@
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static java.lang.System.lineSeparator;
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
import static org.apache.fineract.integrationtests.BaseLoanIntegrationTest.TransactionProcessingStrategyCode.ADVANCED_PAYMENT_ALLOCATION_STRATEGY;
|
||||
import static org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder.DUE_PENALTY_INTEREST_PRINCIPAL_FEE_IN_ADVANCE_PENALTY_INTEREST_PRINCIPAL_FEE_STRATEGY;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
@@ -59,7 +58,7 @@ import org.apache.fineract.batch.domain.BatchRequest;
|
||||
import org.apache.fineract.batch.domain.BatchResponse;
|
||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||
import org.apache.fineract.client.models.AllowAttributeOverrides;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetJournalEntriesTransactionIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdChargesChargeIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
||||
@@ -976,8 +975,8 @@ public abstract class BaseLoanIntegrationTest extends IntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(
|
||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
runnable.run();
|
||||
} finally {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
@@ -1147,8 +1146,8 @@ public abstract class BaseLoanIntegrationTest extends IntegrationTest {
|
||||
}
|
||||
|
||||
protected void updateBusinessDate(String date) {
|
||||
businessDateHelper.updateBusinessDate(
|
||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
}
|
||||
|
||||
protected Long getTransactionId(Long loanId, String type, String date) {
|
||||
|
||||
+10
-11
@@ -55,7 +55,7 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.apache.fineract.accounting.glaccount.domain.GLAccountType;
|
||||
import org.apache.fineract.client.models.AllowAttributeOverrides;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.ChargeRequest;
|
||||
import org.apache.fineract.client.models.GetJournalEntriesTransactionIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoanTransactionRelation;
|
||||
@@ -87,7 +87,6 @@ import org.apache.fineract.client.models.PostLoansResponse;
|
||||
import org.apache.fineract.client.models.PutChargeTransactionChangesRequest;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
@@ -5320,7 +5319,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 November 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();
|
||||
@@ -5491,7 +5490,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 November 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
final Account assetFeeAndPenaltyAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
@@ -6172,7 +6171,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("04 September 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();
|
||||
@@ -6309,7 +6308,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
assertEquals(403, exception.getResponse().code());
|
||||
assertTrue(exception.getMessage().contains("error.msg.loan.is.not.charged.off"));
|
||||
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("08 September 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
PostLoansLoanIdTransactionsResponse loanRepaymentResponse = LOAN_TRANSACTION_HELPER.makeLoanRepayment((long) loanID,
|
||||
@@ -6643,7 +6642,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
@@ -6779,7 +6778,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
@@ -6911,7 +6910,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||
@@ -6993,7 +6992,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
LOG.info("-----------------------------------NEW CLIENT-----------------------------------------");
|
||||
final PostClientsRequest newClient = createRandomClientWithDate("01 January 2023");
|
||||
@@ -7026,7 +7025,7 @@ public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PostLoansLoanIdChargesRequest().chargeId(penaltyCharge.getResourceId()).dateFormat(DATETIME_PATTERN).locale("en")
|
||||
.amount(10.0).dueDate("10 January 2023"));
|
||||
LOG.info("-------------------------------DO SOME PARTIAL REPAYMENTS-------------------------------------------");
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("07 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
String firstRepaymentUUID = UUID.randomUUID().toString();
|
||||
PostLoansLoanIdTransactionsResponse firstRepaymentResult = LOAN_TRANSACTION_HELPER.makeLoanRepayment(loanId,
|
||||
|
||||
+3
-5
@@ -18,15 +18,13 @@
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
||||
import org.apache.fineract.infrastructure.event.external.service.validation.ExternalEventDTO;
|
||||
@@ -335,8 +333,8 @@ public class CustomSnapshotEventIntegrationTest extends BaseLoanIntegrationTest
|
||||
}
|
||||
|
||||
private void updateBusinessDateAndExecuteCOBJob(String date) {
|
||||
businessDateHelper.updateBusinessDate(
|
||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
schedulerJobHelper.executeAndAwaitJob("Loan COB");
|
||||
}
|
||||
|
||||
|
||||
+11
-12
@@ -19,7 +19,6 @@
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
import static org.apache.fineract.portfolio.delinquency.domain.DelinquencyAction.PAUSE;
|
||||
import static org.apache.fineract.portfolio.delinquency.domain.DelinquencyAction.RESUME;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
@@ -35,7 +34,7 @@ import java.util.UUID;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetDelinquencyActionsResponse;
|
||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdDelinquencyPausePeriod;
|
||||
@@ -137,8 +136,8 @@ public class DelinquencyActionIntegrationTests extends BaseLoanIntegrationTest {
|
||||
loanTransactionHelper.createLoanDelinquencyAction(loanId, PAUSE, "10 January 2023", "15 January 2023");
|
||||
|
||||
// Update business date
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("14 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("14 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// Create 2nd Delinquency Resume for the Loan
|
||||
loanTransactionHelper.createLoanDelinquencyAction(loanId, RESUME, "14 January 2023");
|
||||
@@ -175,8 +174,8 @@ public class DelinquencyActionIntegrationTests extends BaseLoanIntegrationTest {
|
||||
loanTransactionHelper.createLoanDelinquencyAction(loanId, PAUSE, "10 January 2023", "15 January 2023");
|
||||
|
||||
// Update business date
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("14 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("14 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// Validate Loan Delinquency Pause Period on Loan
|
||||
validateLoanDelinquencyPausePeriods(loanId, pausePeriods("10 January 2023", "15 January 2023", true));
|
||||
@@ -188,8 +187,8 @@ public class DelinquencyActionIntegrationTests extends BaseLoanIntegrationTest {
|
||||
validateLoanDelinquencyPausePeriods(loanId, pausePeriods("10 January 2023", "14 January 2023", true));
|
||||
|
||||
// Update business date to 15 January 2023
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// Validate Loan Delinquency Pause Period on Loan
|
||||
validateLoanDelinquencyPausePeriods(loanId, pausePeriods("10 January 2023", "14 January 2023", false));
|
||||
@@ -343,8 +342,8 @@ public class DelinquencyActionIntegrationTests extends BaseLoanIntegrationTest {
|
||||
disburseLoan(loanId, BigDecimal.valueOf(100.00), "01 November 2023");
|
||||
|
||||
// Update business date
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("05 November 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("05 November 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// Create Delinquency Pause for the Loan
|
||||
PostLoansDelinquencyActionResponse response = loanTransactionHelper.createLoanDelinquencyAction(loanId, PAUSE,
|
||||
@@ -352,8 +351,8 @@ public class DelinquencyActionIntegrationTests extends BaseLoanIntegrationTest {
|
||||
|
||||
// run cob for business date 26 November
|
||||
final InlineLoanCOBHelper inlineLoanCOBHelper = new InlineLoanCOBHelper(requestSpec, responseSpec);
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("26 November 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("26 November 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
inlineLoanCOBHelper.executeInlineCOB(List.of(loanId.longValue()));
|
||||
|
||||
// Loan delinquency data
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.fineract.client.models.BusinessDateData;
|
||||
import org.apache.fineract.client.models.BusinessDateResponse;
|
||||
import org.apache.fineract.client.models.DeleteDelinquencyBucketResponse;
|
||||
import org.apache.fineract.client.models.DeleteDelinquencyRangeResponse;
|
||||
import org.apache.fineract.client.models.DelinquencyBucketData;
|
||||
@@ -320,7 +320,7 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
||||
final LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 March 2012");
|
||||
log.info("Current date {}", bussinesLocalDate);
|
||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, bussinesLocalDate);
|
||||
final BusinessDateData businessDateResponse = this.businessDateHelper.getBusinessDateByType(requestSpec, responseSpec,
|
||||
final BusinessDateResponse businessDateResponse = this.businessDateHelper.getBusinessDateByType(requestSpec, responseSpec,
|
||||
BusinessDateType.BUSINESS_DATE);
|
||||
|
||||
ArrayList<Integer> rangeIds = new ArrayList<>();
|
||||
|
||||
+23
-24
@@ -32,7 +32,7 @@ import io.restassured.specification.ResponseSpecification;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdRequest;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdResponse;
|
||||
@@ -40,7 +40,6 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -96,7 +95,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer penalty = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -213,7 +212,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer penalty = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -344,7 +343,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer fee = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -457,7 +456,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer fee = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -542,7 +541,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer fee = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -686,7 +685,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer fee = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -769,7 +768,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.01.28").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer penalty = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -823,7 +822,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
(long) firstRepaymentId, new PostLoansLoanIdTransactionsTransactionIdRequest().dateFormat("dd MMMM yyyy")
|
||||
.transactionDate("28 January 2023").transactionAmount(0.0).locale("en"));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.01.31").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
response = loanTransactionHelper.getLoanDetails((long) loanID);
|
||||
@@ -913,7 +912,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer fee = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -987,7 +986,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
Integer secondChargeId = loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(penalty), "15 February 2023", "15"));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
response = loanTransactionHelper.getLoanDetails((long) loanID);
|
||||
@@ -1159,7 +1158,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer fee = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
@@ -1233,7 +1232,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
Integer secondChargeId = loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(penalty), "15 February 2023", "15"));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
response = loanTransactionHelper.getLoanDetails((long) loanID);
|
||||
@@ -1328,7 +1327,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
}
|
||||
assertEquals(2, response.getTransactions().get(4).getLoanChargePaidByList().size());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.07").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
PostLoansLoanIdTransactionsResponse secondReverseRepayment = loanTransactionHelper.reverseLoanTransaction((long) loanID,
|
||||
@@ -1338,7 +1337,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
Integer thirdChargeId = loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(penalty), "07 March 2023", "15"));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.08").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
Integer thirdRepayment = (Integer) loanTransactionHelper.makeRepayment("08 March 2023", Float.parseFloat("15.00"), loanID)
|
||||
@@ -1500,7 +1499,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.05.14").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||
@@ -1525,7 +1524,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
loanStatusHashMap = loanTransactionHelper.disburseLoanWithTransactionAmount("14 May 2023", loanID, "127.95");
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.06.11").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
final String requestJSON = new LoanRescheduleRequestTestBuilder().updateRescheduleFromDate("13 June 2023")
|
||||
@@ -1542,7 +1541,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
this.loanRescheduleRequestHelper.approveLoanRescheduleRequest(loanRescheduleRequestId, aproveRequestJSON);
|
||||
Integer penalty1LoanChargeId = loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(fee), "13 July 2023", "3.65"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.06.12").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
inlineLoanCOBHelper.executeInlineCOB(List.of(loanID.longValue()));
|
||||
|
||||
@@ -1582,7 +1581,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
assertEquals(3.65, Utils.getDoubleValue(loanDetails.getTransactions().get(1).getFeeChargesPortion()));
|
||||
assertEquals(0.0, Utils.getDoubleValue(loanDetails.getTransactions().get(1).getOutstandingLoanBalance()));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.06.17").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
PostLoansLoanIdTransactionsResponse merchantIssuedRefund1 = loanTransactionHelper.makeMerchantIssuedRefund(Long.valueOf(loanID),
|
||||
new PostLoansLoanIdTransactionsRequest().locale("en").dateFormat("dd MMMM yyyy").transactionDate("17 June 2023")
|
||||
@@ -1692,7 +1691,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.05.14").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||
@@ -1717,7 +1716,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
loanStatusHashMap = loanTransactionHelper.disburseLoanWithTransactionAmount("14 May 2023", loanID, "127.95");
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.06.11").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
final String requestJSON = new LoanRescheduleRequestTestBuilder().updateRescheduleFromDate("13 June 2023")
|
||||
@@ -1734,7 +1733,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
this.loanRescheduleRequestHelper.approveLoanRescheduleRequest(loanRescheduleRequestId, aproveRequestJSON);
|
||||
Integer penalty1LoanChargeId = loanTransactionHelper.addChargesForLoan(loanID,
|
||||
LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(fee), "13 July 2023", "3.65"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.06.12").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
inlineLoanCOBHelper.executeInlineCOB(List.of(loanID.longValue()));
|
||||
|
||||
@@ -1774,7 +1773,7 @@ public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrat
|
||||
assertEquals(3.65, Utils.getDoubleValue(loanDetails.getTransactions().get(1).getFeeChargesPortion()));
|
||||
assertEquals(0.0, Utils.getDoubleValue(loanDetails.getTransactions().get(1).getOutstandingLoanBalance()));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.06.17").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
PostLoansLoanIdTransactionsResponse merchantIssuedRefund1 = loanTransactionHelper.makeMerchantIssuedRefund(Long.valueOf(loanID),
|
||||
|
||||
+2
-3
@@ -31,7 +31,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.DeleteLoansLoanIdChargesChargeIdResponse;
|
||||
import org.apache.fineract.client.models.DeleteLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.DelinquencyRangeData;
|
||||
@@ -62,7 +62,6 @@ import org.apache.fineract.client.models.PutLoansLoanIdChargesChargeIdResponse;
|
||||
import org.apache.fineract.client.models.PutLoansLoanIdRequest;
|
||||
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -832,7 +831,7 @@ public class ExternalIdSupportIntegrationTest extends BaseLoanIntegrationTest {
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
new BusinessDateHelper().updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
new BusinessDateHelper().updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2022.10.10").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
try {
|
||||
ArrayList<Integer> rangeIds = new ArrayList<>();
|
||||
|
||||
+3
-4
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -26,7 +25,7 @@ import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdLoanInstallmentLevelDelinquency;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||
@@ -595,8 +594,8 @@ public class InstallmentLevelDelinquencyAPIIntegrationTests extends BaseLoanInte
|
||||
}
|
||||
|
||||
private void updateBusinessDateAndExecuteCOBJob(String date) {
|
||||
businessDateHelper.updateBusinessDate(
|
||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
schedulerJobHelper.executeAndAwaitJob("Loan COB");
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -35,14 +35,13 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.PostClientsResponse;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
||||
import org.apache.fineract.client.models.PostLoansRequest;
|
||||
import org.apache.fineract.client.models.PostLoansResponse;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -165,7 +164,7 @@ public class LoanChargePaymentWithAdvancedPaymentAllocationTest extends BaseLoan
|
||||
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
final Integer savingsId = createSavingsAccountDailyPosting(client.getClientId().intValue(), startDate);
|
||||
|
||||
+21
-22
@@ -19,7 +19,6 @@
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
@@ -27,7 +26,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||
@@ -80,20 +79,20 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "01 November 2023", false);
|
||||
|
||||
// Update business date
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("13 November 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("13 November 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 13 Nov Business date
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "16 November 2023", false);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("16 November 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("16 November 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 16 Nov Business date
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "01 December 2023", false);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("01 December 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 December 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 01 Dec Business date
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "16 December 2023", false);
|
||||
@@ -111,14 +110,14 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
||||
installment(0.0, 0.0, 50.0, 50.0, false, "23 December 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("17 December 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("17 December 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 17 Dec Business date N + 1
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "23 December 2023", false);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("25 December 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("25 December 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
} finally {
|
||||
// reset global config
|
||||
@@ -166,8 +165,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "16 November 2023", false);
|
||||
|
||||
// Update business date
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("13 November 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("13 November 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 13 Nov Business date
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "16 November 2023", false);
|
||||
@@ -187,8 +186,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
||||
// delinquency next payment date for 13 Nov Business date after paying 16 November Installment
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "01 December 2023", false);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("16 November 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("16 November 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 16 Nov Business date
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "01 December 2023", false);
|
||||
@@ -208,8 +207,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
||||
// delinquency next payment date for 16 Nov Business date after partial payment of 01 Dec installment
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "01 December 2023", false);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("01 December 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 December 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 01 December Business date
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "16 December 2023", false);
|
||||
@@ -227,14 +226,14 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
||||
installment(0.0, 0.0, 50.0, 50.0, false, "23 December 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("17 December 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("17 December 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// delinquency next payment date for 17 Dec Business date N + 1
|
||||
verifyLoanDelinquencyNextPaymentDate(loanId, "23 December 2023", false);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("25 December 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("25 December 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
} finally {
|
||||
// reset global config
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE,
|
||||
|
||||
+4
-5
@@ -35,7 +35,7 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.ChargeRequest;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.PostChargesResponse;
|
||||
@@ -49,7 +49,6 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionI
|
||||
import org.apache.fineract.client.models.PostLoansRequest;
|
||||
import org.apache.fineract.client.models.PostLoansResponse;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -436,7 +435,7 @@ public class LoanSpecificDueDateChargeAfterMaturityTest extends BaseLoanIntegrat
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 September 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
PostChargesResponse penaltyCharge = CHARGES_HELPER.createCharges(new ChargeRequest().penalty(true).amount(10.0)
|
||||
@@ -462,7 +461,7 @@ public class LoanSpecificDueDateChargeAfterMaturityTest extends BaseLoanIntegrat
|
||||
validateLoanTransaction(loanDetails, 0, 1000.0, 0.0, 0.0, 1000.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("01 October 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
PostLoansLoanIdTransactionsResponse repaymentTransaction = loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(),
|
||||
@@ -475,7 +474,7 @@ public class LoanSpecificDueDateChargeAfterMaturityTest extends BaseLoanIntegrat
|
||||
validateLoanTransaction(loanDetails, 1, 1000.0, 1000.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getClosedObligationsMet());
|
||||
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("04 October 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
loanTransactionHelper.makeMerchantIssuedRefund(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
|
||||
+3
-4
@@ -40,7 +40,7 @@ import org.apache.fineract.batch.command.internal.CreateTransactionLoanCommandSt
|
||||
import org.apache.fineract.batch.domain.BatchRequest;
|
||||
import org.apache.fineract.batch.domain.BatchResponse;
|
||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.ChargeRequest;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdLoanChargeData;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
@@ -57,7 +57,6 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||
import org.apache.fineract.client.models.PostLoansRequest;
|
||||
import org.apache.fineract.client.models.PostLoansResponse;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -906,7 +905,7 @@ public class LoanTransactionInterestPaymentWaiverTest extends BaseLoanIntegratio
|
||||
0.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.09.16").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
@@ -1013,7 +1012,7 @@ public class LoanTransactionInterestPaymentWaiverTest extends BaseLoanIntegratio
|
||||
0.0, 0.0, 0.0);
|
||||
assertTrue(loanDetails.getStatus().getActive());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.09.16").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
loanTransactionHelper.makeLoanRepayment(loanResponse.getLoanId(), new PostLoansLoanIdTransactionsRequest()
|
||||
|
||||
+10
-11
@@ -34,7 +34,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdTransactions;
|
||||
@@ -42,7 +42,6 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -97,7 +96,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
// Loan ExternalId
|
||||
@@ -123,13 +122,13 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
|
||||
inlineLoanCOBHelper.executeInlineCOB(List.of(loanId.longValue()));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("05 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
loanTransactionHelper.makeCreditBalanceRefund(loanExternalIdStr, new PostLoansLoanIdTransactionsRequest()
|
||||
.dateFormat(DATE_PATTERN).transactionDate("05 October 2022").locale("en").transactionAmount(500.0));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("06 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
loanTransactionHelper.reverseLoanTransaction(loanExternalIdStr, repaymentTransaction.getResourceId(),
|
||||
@@ -162,7 +161,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
// Loan ExternalId
|
||||
@@ -198,7 +197,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
assertEquals(LocalDate.of(2022, 10, 10),
|
||||
loansLoanIdResponse.getRepaymentSchedule().getPeriods().get(lastPeriodIndex).getDueDate());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("06 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
final PostLoansLoanIdTransactionsResponse repaymentTransaction = loanTransactionHelper.makeLoanRepayment(loanExternalIdStr,
|
||||
@@ -217,7 +216,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
assertEquals(LocalDate.of(2022, 10, 10),
|
||||
loansLoanIdResponse.getRepaymentSchedule().getPeriods().get(lastPeriodIndex).getDueDate());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("11 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
loanTransactionHelper.chargebackLoanTransaction(loanExternalIdStr, loanTransactionExternalIdStr,
|
||||
new PostLoansLoanIdTransactionsTransactionIdRequest().locale("en").transactionAmount(100.0).paymentTypeId(1L));
|
||||
@@ -237,7 +236,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
final Account assetAccount = accountHelper.createAssetAccount();
|
||||
@@ -277,7 +276,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
|
||||
inlineLoanCOBHelper.executeInlineCOB(List.of(loanId.longValue()));
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("05 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
PostLoansLoanIdTransactionsResponse cbrTransactionResponse = loanTransactionHelper.makeCreditBalanceRefund(loanExternalIdStr,
|
||||
@@ -302,7 +301,7 @@ public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||
assertEquals(1, cbrExpenseJournalEntries.size());
|
||||
assertEquals(1, cbrAssetJournalEntries.size());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("06 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||
|
||||
loanTransactionHelper.reverseLoanTransaction(loanExternalIdStr, repaymentTransaction.getResourceId(),
|
||||
|
||||
+5
-6
@@ -31,7 +31,7 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeFormatterBuilder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.PostClientsResponse;
|
||||
@@ -39,7 +39,6 @@ import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
||||
import org.apache.fineract.client.models.PostLoansRequest;
|
||||
import org.apache.fineract.client.models.PostLoansResponse;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
@@ -87,7 +86,7 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest extends BaseL
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
final Account assetAccount = accountHelper.createAssetAccount();
|
||||
@@ -167,7 +166,7 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest extends BaseL
|
||||
assertEquals(250.00, Utils.getDoubleValue(thirdRepaymentInstallment.getTotalOutstandingForPeriod()));
|
||||
assertEquals(LocalDate.of(2023, 4, 1), thirdRepaymentInstallment.getDueDate());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
loanTransactionHelper.makeRepayment("01 March 2023", 810.0f, loanId);
|
||||
|
||||
@@ -288,7 +287,7 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest extends BaseL
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
final Account assetAccount = accountHelper.createAssetAccount();
|
||||
@@ -368,7 +367,7 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest extends BaseL
|
||||
assertEquals(250.00, Utils.getDoubleValue(thirdRepaymentInstallment.getTotalOutstandingForPeriod()));
|
||||
assertEquals(LocalDate.of(2023, 4, 1), thirdRepaymentInstallment.getDueDate());
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
loanTransactionHelper.makeRepayment("28 January 2023", 810.0f, loanId);
|
||||
|
||||
|
||||
+3
-3
@@ -49,7 +49,7 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.TimeZone;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetJournalEntriesTransactionIdResponse;
|
||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||
import org.apache.fineract.client.models.JournalEntryTransactionItem;
|
||||
@@ -1348,7 +1348,7 @@ public class SchedulerJobsTestResults extends IntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2022.09.04").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
@@ -1375,7 +1375,7 @@ public class SchedulerJobsTestResults extends IntegrationTest {
|
||||
this.loanTransactionHelper.approveLoan("02 September 2022", loanId);
|
||||
this.loanTransactionHelper.disburseLoan("03 September 2022", loanId, "1000", null);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("2022.09.05").dateFormat("yyyy.MM.dd").locale("en"));
|
||||
|
||||
LocalDate targetDate = LocalDate.of(2022, 9, 5);
|
||||
|
||||
+29
-30
@@ -19,12 +19,11 @@
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
||||
@@ -795,8 +794,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -909,8 +908,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("10 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("10 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
addRepaymentForLoan(loanId, 300.0, "10 January 2023");
|
||||
|
||||
@@ -920,8 +919,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
transaction(300.0, "Repayment", "10 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1047,8 +1046,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1166,8 +1165,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1201,8 +1200,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(1050.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("20 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("20 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// make an additional repayment after the 2nd disbursal
|
||||
addRepaymentForLoan(loanId, 50.0, "20 January 2023");
|
||||
@@ -1258,8 +1257,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1296,8 +1295,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(1050.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("20 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("20 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// make an additional repayment after the 2nd disbursal
|
||||
addRepaymentForLoan(loanId, 50.0, "20 January 2023");
|
||||
@@ -1350,8 +1349,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1472,8 +1471,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1594,8 +1593,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1629,8 +1628,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(1050.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("20 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("20 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// make an additional repayment after the 2nd disbursal
|
||||
addRepaymentForLoan(loanId, 50.0, "20 January 2023");
|
||||
@@ -1730,8 +1729,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(750.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("15 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("15 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// 2nd Disburse Loan
|
||||
disburseLoan(loanId, BigDecimal.valueOf(400.0), "15 January 2023");
|
||||
@@ -1767,8 +1766,8 @@ public class UndoLoanDisbursalWithDownPaymentIntegrationTest extends BaseLoanInt
|
||||
installment(1050.0, false, "31 January 2023") //
|
||||
);
|
||||
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BUSINESS_DATE.getName()).date("20 January 2023")
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date("20 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
|
||||
// make an additional repayment after the 2nd disbursal
|
||||
addRepaymentForLoan(loanId, 50.0, "20 January 2023");
|
||||
|
||||
+9
-12
@@ -18,8 +18,6 @@
|
||||
*/
|
||||
package org.apache.fineract.integrationtests.common;
|
||||
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
import io.restassured.specification.ResponseSpecification;
|
||||
@@ -27,9 +25,8 @@ import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.client.models.BusinessDateData;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateResponse;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||
import org.apache.fineract.client.util.Calls;
|
||||
import org.apache.fineract.client.util.JSON;
|
||||
@@ -56,29 +53,29 @@ public final class BusinessDateHelper {
|
||||
return Utils.performServerPost(requestSpec, responseSpec, BUSINESS_DATE_API, buildBusinessDateRequest(type, date), "changes");
|
||||
}
|
||||
|
||||
public static BusinessDateResponse updateBusinessDate(final BusinessDateRequest request) {
|
||||
public static BusinessDateResponse updateBusinessDate(final BusinessDateUpdateRequest request) {
|
||||
log.info("------------------UPDATE BUSINESS DATE----------------------");
|
||||
log.info("------------------Type: {}, date: {}----------------------", request.getType(), request.getDate());
|
||||
return Calls.ok(FineractClientHelper.getFineractClient().businessDateManagement.updateBusinessDate(request));
|
||||
return Calls.ok(FineractClientHelper.getFineractClient().businessDateManagement.updateBusinessDate(null, request));
|
||||
}
|
||||
|
||||
// TODO: Rewrite to use fineract-client instead!
|
||||
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
|
||||
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
|
||||
@Deprecated(forRemoval = true)
|
||||
public BusinessDateData getBusinessDateByType(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
public BusinessDateResponse getBusinessDateByType(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final BusinessDateType type) {
|
||||
final String BUSINESS_DATE_API = "/fineract-provider/api/v1/businessdate/" + type.name() + "?" + Utils.TENANT_IDENTIFIER;
|
||||
final String response = Utils.performServerGet(requestSpec, responseSpec, BUSINESS_DATE_API);
|
||||
log.info("{}", response);
|
||||
return GSON.fromJson(response, BusinessDateData.class);
|
||||
return GSON.fromJson(response, BusinessDateResponse.class);
|
||||
}
|
||||
|
||||
public BusinessDateData getBusinessDate(final String type) {
|
||||
public BusinessDateResponse getBusinessDate(final String type) {
|
||||
return Calls.ok(FineractClientHelper.getFineractClient().businessDateManagement.getBusinessDate(type));
|
||||
}
|
||||
|
||||
public List<BusinessDateData> getBusinessDates() {
|
||||
public List<BusinessDateResponse> getBusinessDates() {
|
||||
return Calls.ok(FineractClientHelper.getFineractClient().businessDateManagement.getBusinessDates());
|
||||
}
|
||||
|
||||
@@ -100,8 +97,8 @@ public final class BusinessDateHelper {
|
||||
try {
|
||||
new GlobalConfigurationHelper().updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
updateBusinessDate(
|
||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE).date(date)
|
||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
runnable.run();
|
||||
} finally {
|
||||
new GlobalConfigurationHelper().updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
|
||||
+3
-5
@@ -18,8 +18,6 @@
|
||||
*/
|
||||
package org.apache.fineract.integrationtests.savings.base;
|
||||
|
||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.builder.ResponseSpecBuilder;
|
||||
import io.restassured.http.ContentType;
|
||||
@@ -36,7 +34,7 @@ import java.util.function.Consumer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
||||
import org.apache.fineract.client.models.BusinessDateUpdateRequest;
|
||||
import org.apache.fineract.client.models.PostSavingsAccountTransactionsRequest;
|
||||
import org.apache.fineract.client.models.PostSavingsAccountTransactionsResponse;
|
||||
import org.apache.fineract.client.models.PostSavingsAccountsAccountIdRequest;
|
||||
@@ -102,8 +100,8 @@ public class BaseSavingsIntegrationTest extends IntegrationTest {
|
||||
try {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
new PutGlobalConfigurationsRequest().enabled(true));
|
||||
businessDateHelper.updateBusinessDate(
|
||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE)
|
||||
.date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||
runnable.accept(date);
|
||||
} finally {
|
||||
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||
|
||||
Reference in New Issue
Block a user