diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 71fc12d6fd8..da0c7d4a890 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Build the image run: ./gradlew --no-daemon --console=plain :fineract-provider:clean :fineract-provider:build :fineract-provider:jibDockerBuild -x test -x cucumber - name: Start the Fineract stack - run: docker compose -f docker-compose-postgresql.yml up -d + run: docker compose -f docker-compose-postgresql-test-activemq.yml up -d - name: Wait for stack to come up run: sleep 400 - name: Check the stack @@ -39,5 +39,7 @@ jobs: TEST_PASSWORD: password TEST_TENANT_ID: default INITIALIZATION_ENABLED: true - EVENT_VERIFICATION_ENABLED: false + EVENT_VERIFICATION_ENABLED: true + ACTIVEMQ_BROKER_URL: tcp://localhost:61616 + ACTIVEMQ_TOPIC_NAME: events run: ./gradlew --no-daemon --console=plain fineract-e2e-tests-runner:cucumber --tags 'not @Skip' allureReport diff --git a/config/docker/env/activemq.env b/config/docker/env/activemq.env index e907e337cfe..2a4a94f21c2 100644 --- a/config/docker/env/activemq.env +++ b/config/docker/env/activemq.env @@ -17,5 +17,10 @@ # under the License. # +FINERACT_REMOTE_JOB_MESSAGE_HANDLER_SPRING_EVENTS_ENABLED=false FINERACT_REMOTE_JOB_MESSAGE_HANDLER_JMS_ENABLED=true FINERACT_REMOTE_JOB_MESSAGE_HANDLER_JMS_BROKER_URL=tcp://activemq:61616 +FINERACT_EXTERNAL_EVENTS_ENABLED=true +FINERACT_EXTERNAL_EVENTS_PRODUCER_JMS_ENABLED=true +FINERACT_EXTERNAL_EVENTS_PRODUCER_JMS_TOPIC_NAME=events +FINERACT_EXTERNAL_EVENTS_PRODUCER_JMS_BROKER_URL=tcp://activemq:61616 diff --git a/config/docker/env/fineract-common.env b/config/docker/env/fineract-common.env index a1e5ad745c4..b77bb24b0e0 100644 --- a/config/docker/env/fineract-common.env +++ b/config/docker/env/fineract-common.env @@ -52,7 +52,7 @@ FINERACT_DEFAULT_TENANTDB_PWD=skdcnwauicn2ucnaecasdsajdnizucawencascdca FINERACT_DEFAULT_MASTER_PASSWORD=fineract FINERACT_MANAGEMENT_ENDPOINT_WEB_EXPOSURE_INCLUDE=health,info,prometheus FINERACT_MANAGEMENT_METRICS_TAGS_APPLICATION=fineract -FINERACT_REMOTE_JOB_MESSAGE_HANDLER_SPRING_EVENTS_ENABLED=false +FINERACT_REMOTE_JOB_MESSAGE_HANDLER_SPRING_EVENTS_ENABLED=true FINERACT_INSECURE_HTTP_CLIENT=true SPRING_PROFILES_ACTIVE=test,diagnostics OTEL_SERVICE_NAME=fineract diff --git a/config/docker/env/kafka-client-msk.env b/config/docker/env/kafka-client-msk.env index ee4e58005af..88785040e37 100644 --- a/config/docker/env/kafka-client-msk.env +++ b/config/docker/env/kafka-client-msk.env @@ -17,6 +17,7 @@ # under the License. # +FINERACT_REMOTE_JOB_MESSAGE_HANDLER_SPRING_EVENTS_ENABLED=false FINERACT_REMOTE_JOB_MESSAGE_HANDLER_JMS_ENABLED=false FINERACT_REMOTE_JOB_MESSAGE_HANDLER_KAFKA_ENABLED=true FINERACT_REMOTE_JOB_MESSAGE_HANDLER_KAFKA_BOOTSTRAP_SERVERS=b-3-public.democluster1.am2oyx.c4.kafka.eu-central-1.amazonaws.com:9198,b-2-public.democluster1.am2oyx.c4.kafka.eu-central-1.amazonaws.com:9198,b-1-public.democluster1.am2oyx.c4.kafka.eu-central-1.amazonaws.com:9198 diff --git a/config/docker/env/kafka-client.env b/config/docker/env/kafka-client.env index 470b8860951..1d342271c82 100644 --- a/config/docker/env/kafka-client.env +++ b/config/docker/env/kafka-client.env @@ -17,6 +17,7 @@ # under the License. # +FINERACT_REMOTE_JOB_MESSAGE_HANDLER_SPRING_EVENTS_ENABLED=false FINERACT_REMOTE_JOB_MESSAGE_HANDLER_JMS_ENABLED=false FINERACT_REMOTE_JOB_MESSAGE_HANDLER_KAFKA_ENABLED=true FINERACT_REMOTE_JOB_MESSAGE_HANDLER_KAFKA_BOOTSTRAP_SERVERS=kafka:9092 diff --git a/docker-compose-postgresql-test-activemq.yml b/docker-compose-postgresql-test-activemq.yml new file mode 100644 index 00000000000..38b84e3920f --- /dev/null +++ b/docker-compose-postgresql-test-activemq.yml @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +version: "3.8" + +services: + activemq: + extends: + file: ./config/docker/compose/activemq.yml + service: activemq + + db: + extends: + file: ./config/docker/compose/postgresql.yml + service: postgresql + + fineract: + extends: + file: ./config/docker/compose/fineract.yml + service: fineract + ports: + - "8443:8443" + depends_on: + db: + condition: service_healthy + env_file: + - ./config/docker/env/fineract.env + - ./config/docker/env/fineract-common.env + - ./config/docker/env/fineract-postgresql.env + - ./config/docker/env/activemq.env diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java index 09a4f02e0cb..f00eadd66cc 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java @@ -1006,7 +1006,7 @@ public void initialize() throws Exception { .name(name48)// .supportedInterestRefundTypes(Arrays.asList("MERCHANT_ISSUED_REFUND", "PAYOUT_REFUND"))// .paymentAllocation(List.of(// - createPaymentAllocation("DEFAULT", "LAST_INSTALLMENT")));// + createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT")));// Response responseLoanProductsRequestLP2AdvancedpaymentInterestEmiActualActualInterestRefundInterestRecalculation = loanProductsApi .createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmiActualActualInterestRefundRecalculation).execute(); TestContext.INSTANCE.set( diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/EventAssertion.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/EventAssertion.java index aac1cd885a8..770037b3a13 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/EventAssertion.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/EventAssertion.java @@ -101,7 +101,7 @@ public > EventAssertionBuilder assertEvent(Class eve } else { eventMessage = (EventMessage) new EmptyEventMessage(); } - log.info("Assert event: {}", eventMessage.getIdempotencyKey()); + log.debug("Assert event: {}", eventMessage.getIdempotencyKey()); return new EventAssertionBuilder<>(eventMessage); } @@ -167,7 +167,11 @@ public class EventBigDecimalAssertionBuilder { public EventAssertionBuilder isEqualTo(BigDecimal value) { if (eventProperties.isEventVerificationEnabled()) { - Assertions.assertThat(extractedValue).isEqualByComparingTo(value); + if (extractedValue == null) { + Assertions.assertThat(extractedValue).isEqualTo(value); + } else { + Assertions.assertThat(extractedValue).isEqualByComparingTo(value); + } } return new EventAssertionBuilder<>(eventMessage); } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/event/EventCheckHelper.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/event/EventCheckHelper.java index eba050c479f..1537b94f418 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/event/EventCheckHelper.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/event/EventCheckHelper.java @@ -128,9 +128,8 @@ public void createLoanEventCheck(Response createLoanResponse) eventAssertion.assertEvent(LoanCreatedEvent.class, createLoanResponse.body().getLoanId())// .extractingData(LoanAccountDataV1::getId).isEqualTo(body.getId())// .extractingData(loanAccountDataV1 -> loanAccountDataV1.getStatus().getId()).isEqualTo(body.getStatus().getId())// - .extractingData(LoanAccountDataV1::getClientId).isEqualTo(Long.valueOf(body.getClientId()))// - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getPrincipal().longValue()) - .isEqualTo(body.getPrincipal().longValue())// + .extractingData(LoanAccountDataV1::getClientId).isEqualTo(body.getClientId())// + .extractingBigDecimal(LoanAccountDataV1::getPrincipal).isEqualTo(body.getPrincipal())// .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getCurrency().getCode()) .isEqualTo(body.getCurrency().getCode());// } @@ -145,8 +144,7 @@ public void approveLoanEventCheck(Response loanApproveR .extractingData(loanAccountDataV1 -> loanAccountDataV1.getStatus().getId()).isEqualTo(body.getStatus().getId())// .extractingData(loanAccountDataV1 -> loanAccountDataV1.getStatus().getCode()).isEqualTo(body.getStatus().getCode())// .extractingData(LoanAccountDataV1::getClientId).isEqualTo(Long.valueOf(body.getClientId()))// - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getApprovedPrincipal().longValue()) - .isEqualTo(body.getApprovedPrincipal().longValue())// + .extractingBigDecimal(LoanAccountDataV1::getApprovedPrincipal).isEqualTo(BigDecimal.valueOf(body.getApprovedPrincipal()))// .extractingData(loanAccountDataV1 -> loanAccountDataV1.getTimeline().getApprovedOnDate())// .isEqualTo(FORMATTER_EVENTS.format(body.getTimeline().getApprovedOnDate()))// .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getCurrency().getCode()) @@ -239,9 +237,9 @@ private void loanAccountDataV1Check(Class eventClaz } private boolean areBigDecimalValuesEqual(BigDecimal actual, BigDecimal expected) { - log.info("--- Checking BigDecimal values.... ---"); - log.info("Actual: {}", actual); - log.info("Expected: {}", expected); + log.debug("--- Checking BigDecimal values.... ---"); + log.debug("Actual: {}", actual); + log.debug("Expected: {}", expected); return actual.compareTo(expected) == 0; } @@ -261,8 +259,7 @@ public void loanDisbursalTransactionEventCheck(Response eventAssertion.assertEvent(LoanDisbursalTransactionEvent.class, disbursementTransaction.getId())// .extractingData(LoanTransactionDataV1::getLoanId).isEqualTo(body.getId())// .extractingData(LoanTransactionDataV1::getDate).isEqualTo(FORMATTER_EVENTS.format(disbursementTransaction.getDate()))// - .extractingData(loanTransactionDataV1 -> loanTransactionDataV1.getAmount().longValue()) - .isEqualTo(disbursementTransaction.getAmount().longValue());// + .extractingBigDecimal(LoanTransactionDataV1::getAmount).isEqualTo(BigDecimal.valueOf(disbursementTransaction.getAmount()));// } public EventAssertion.EventAssertionBuilder transactionEventCheck( @@ -291,8 +288,7 @@ public EventAssertion.EventAssertionBuilder transactionEv EventAssertion.EventAssertionBuilder eventBuilder = eventAssertion.assertEvent(eventClass, transactionId); eventBuilder.extractingData(LoanTransactionDataV1::getLoanId).isEqualTo(loanDetailsResponse.body().getId())// .extractingData(LoanTransactionDataV1::getDate).isEqualTo(FORMATTER_EVENTS.format(transactionFound.getDate()))// - .extractingData(loanTransactionDataV1 -> loanTransactionDataV1.getAmount().longValue()) - .isEqualTo(transactionFound.getAmount().longValue())// + .extractingBigDecimal(LoanTransactionDataV1::getAmount).isEqualTo(BigDecimal.valueOf(transactionFound.getAmount()))// .extractingData(LoanTransactionDataV1::getExternalOwnerId).isEqualTo(externalOwnerId);// return eventBuilder; } @@ -316,13 +312,15 @@ public void loanOwnershipTransferBusinessEventCheck(Long loanId, Long transferId .isEqualTo(filtered.getOwner().getExternalId()).extractingData(LoanOwnershipTransferDataV1::getTransferExternalId) .isEqualTo(filtered.getTransferExternalId()).extractingData(LoanOwnershipTransferDataV1::getSettlementDate) .isEqualTo(FORMATTER_EVENTS.format(filtered.getSettlementDate())) - .extractingData(LoanOwnershipTransferDataV1::getTotalOutstandingBalanceAmount) + .extractingBigDecimal(LoanOwnershipTransferDataV1::getTotalOutstandingBalanceAmount) .isEqualTo(totalOutstandingBalanceAmountExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingPrincipalPortion).isEqualTo(outstandingPrincipalPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingFeePortion).isEqualTo(outstandingFeePortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingPenaltyPortion).isEqualTo(outstandingPenaltyPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingInterestPortion).isEqualTo(outstandingInterestPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOverPaymentPortion).isEqualTo(overPaymentPortionExpected); + .extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingPrincipalPortion) + .isEqualTo(outstandingPrincipalPortionExpected).extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingFeePortion) + .isEqualTo(outstandingFeePortionExpected).extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingPenaltyPortion) + .isEqualTo(outstandingPenaltyPortionExpected) + .extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingInterestPortion) + .isEqualTo(outstandingInterestPortionExpected).extractingBigDecimal(LoanOwnershipTransferDataV1::getOverPaymentPortion) + .isEqualTo(overPaymentPortionExpected); } public void loanOwnershipTransferBusinessEventWithStatusCheck(Long loanId, Long transferId, String transferStatus, @@ -358,15 +356,17 @@ public void loanOwnershipTransferBusinessEventWithStatusCheck(Long loanId, Long .isEqualTo(filtered.getOwner().getExternalId()).extractingData(LoanOwnershipTransferDataV1::getTransferExternalId) .isEqualTo(filtered.getTransferExternalId()).extractingData(LoanOwnershipTransferDataV1::getSettlementDate) .isEqualTo(FORMATTER_EVENTS.format(filtered.getSettlementDate())) - .extractingData(LoanOwnershipTransferDataV1::getTotalOutstandingBalanceAmount) + .extractingBigDecimal(LoanOwnershipTransferDataV1::getTotalOutstandingBalanceAmount) .isEqualTo(totalOutstandingBalanceAmountExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingPrincipalPortion).isEqualTo(outstandingPrincipalPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingFeePortion).isEqualTo(outstandingFeePortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingPenaltyPortion).isEqualTo(outstandingPenaltyPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOutstandingInterestPortion).isEqualTo(outstandingInterestPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getOverPaymentPortion).isEqualTo(overPaymentPortionExpected) - .extractingData(LoanOwnershipTransferDataV1::getTransferStatus).isEqualTo(transferStatusExpected) - .extractingData(LoanOwnershipTransferDataV1::getTransferStatusReason).isEqualTo(transferStatusReasonExpected); + .extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingPrincipalPortion) + .isEqualTo(outstandingPrincipalPortionExpected).extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingFeePortion) + .isEqualTo(outstandingFeePortionExpected).extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingPenaltyPortion) + .isEqualTo(outstandingPenaltyPortionExpected) + .extractingBigDecimal(LoanOwnershipTransferDataV1::getOutstandingInterestPortion) + .isEqualTo(outstandingInterestPortionExpected).extractingBigDecimal(LoanOwnershipTransferDataV1::getOverPaymentPortion) + .isEqualTo(overPaymentPortionExpected).extractingData(LoanOwnershipTransferDataV1::getTransferStatus) + .isEqualTo(transferStatusExpected).extractingData(LoanOwnershipTransferDataV1::getTransferStatusReason) + .isEqualTo(transferStatusReasonExpected); } public void loanAccountSnapshotBusinessEventCheck(Long loanId, Long transferId) throws IOException { @@ -389,17 +389,17 @@ public void loanAccountSnapshotBusinessEventCheck(Long loanId, Long transferId) eventAssertion.assertEvent(LoanAccountSnapshotEvent.class, loanId).extractingData(LoanAccountDataV1::getId).isEqualTo(loanId) .extractingData(LoanAccountDataV1::getExternalOwnerId).isEqualTo(ownerExternalIdExpected) .extractingData(LoanAccountDataV1::getSettlementDate).isEqualTo(settlementDateExpected) - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getTotalOutstanding()) + .extractingBigDecimal(loanAccountDataV1 -> loanAccountDataV1.getSummary().getTotalOutstanding()) .isEqualTo(totalOutstandingBalanceAmountExpected) - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getPrincipalOutstanding()) + .extractingBigDecimal(loanAccountDataV1 -> loanAccountDataV1.getSummary().getPrincipalOutstanding()) .isEqualTo(outstandingPrincipalPortionExpected) - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getFeeChargesOutstanding()) + .extractingBigDecimal(loanAccountDataV1 -> loanAccountDataV1.getSummary().getFeeChargesOutstanding()) .isEqualTo(outstandingFeePortionExpected) - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getPenaltyChargesOutstanding()) + .extractingBigDecimal(loanAccountDataV1 -> loanAccountDataV1.getSummary().getPenaltyChargesOutstanding()) .isEqualTo(outstandingPenaltyPortionExpected) - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getInterestOutstanding()) + .extractingBigDecimal(loanAccountDataV1 -> loanAccountDataV1.getSummary().getInterestOutstanding()) .isEqualTo(outstandingInterestPortionExpected) - .extractingData(loanAccountDataV1 -> loanAccountDataV1.getSummary().getTotalOverdue()) + .extractingBigDecimal(loanAccountDataV1 -> loanAccountDataV1.getSummary().getTotalOverdue()) .isEqualTo(overPaymentPortionExpected); } @@ -435,15 +435,15 @@ public void loanAccountDelinquencyPauseChangedBusinessEventCheck(Long loanId) th pausePeriodEndExpected))// .isEqualTo(pausePeriodEndExpected);// - log.info("LoanAccountDelinquencyPauseChangedBusinessEvent -> isActiveActual:\s{}", isActiveActual); - log.info("LoanAccountDelinquencyPauseChangedBusinessEvent -> pausePeriodStartActual:\s{}", pausePeriodStartActual); - log.info("LoanAccountDelinquencyPauseChangedBusinessEvent -> pausePeriodEndActual:\s{}", pausePeriodEndActual); + log.debug("LoanAccountDelinquencyPauseChangedBusinessEvent -> isActiveActual:\s{}", isActiveActual); + log.debug("LoanAccountDelinquencyPauseChangedBusinessEvent -> pausePeriodStartActual:\s{}", pausePeriodStartActual); + log.debug("LoanAccountDelinquencyPauseChangedBusinessEvent -> pausePeriodEndActual:\s{}", pausePeriodEndActual); } return null; }); } - public void installmentLevelDelinquencyRangeChangeEventCheck(Long loanId) throws IOException { + public void installmentLevelDelinquencyRangeChangeEventCheck(Long loanId) { eventAssertion.assertEvent(LoanDelinquencyRangeChangeEvent.class, loanId).extractingData(loanAccountDelinquencyRangeDataV1 -> { // check if sum of total amounts equal the sum of amount types in installmentDelinquencyBuckets BigDecimal totalAmountSum = loanAccountDelinquencyRangeDataV1.getInstallmentDelinquencyBuckets().stream()// @@ -471,13 +471,13 @@ public void installmentLevelDelinquencyRangeChangeEventCheck(Long loanId) throws assertThat(totalAmountSum) .as(ErrorMessageHelper.wrongAmountInLoanDelinquencyRangeChangedEventTotalAmount(totalAmountSum, totalAmountSumActual)) - .isEqualTo(totalAmountSumActual); + .isEqualByComparingTo(totalAmountSumActual); - log.info("Nr of installment level delinquency buckets: {}", + log.debug("Nr of installment level delinquency buckets: {}", loanAccountDelinquencyRangeDataV1.getInstallmentDelinquencyBuckets().size()); - log.info("Buckets:"); + log.debug("Buckets:"); loanAccountDelinquencyRangeDataV1.getInstallmentDelinquencyBuckets().forEach(e -> { - log.info("{}\s-\sTotal amount:\s{}", e.getDelinquencyRange().getClassification(), e.getAmount().getTotalAmount()); + log.debug("{}\s-\sTotal amount:\s{}", e.getDelinquencyRange().getClassification(), e.getAmount().getTotalAmount()); }); return null; diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/service/JobService.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/service/JobService.java index 23b43ebc769..356725cc57f 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/service/JobService.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/service/JobService.java @@ -62,7 +62,10 @@ public void executeAndWait(Job job) { private void waitUntilJobIsFinished(Job job) { String jobName = job.getName(); - await().atMost(Duration.ofMinutes(2)).alias("%s didn't finish on time".formatted(jobName)).pollInterval(Duration.ofSeconds(10)) + await().atMost(Duration.ofMinutes(2)) // + .alias("%s didn't finish on time".formatted(jobName)) // + .pollInterval(Duration.ofSeconds(5)) // + .pollDelay(Duration.ofSeconds(5)) // .until(() -> { log.info("Waiting for job {} to finish", jobName); Long jobId = jobResolver.resolve(job); diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/assetexternalization/AssetExternalizationStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/assetexternalization/AssetExternalizationStepDef.java index 24a5828c1e0..c51da467abc 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/assetexternalization/AssetExternalizationStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/assetexternalization/AssetExternalizationStepDef.java @@ -253,10 +253,10 @@ public void checkAssetExternalizationResponse() { Long loanIdActual = body.getSubResourceId(); String transferExternalIdActual = body.getResourceExternalId(); - log.info("loanId: {}", loanId); - log.info("ownerExternalIdStored: {}", ownerExternalIdStored); - log.info("transferExternalId generated by user: {}", transferExternalIdExpected); - log.info("transferExternalIdActual: {}", transferExternalIdActual); + log.debug("loanId: {}", loanId); + log.debug("ownerExternalIdStored: {}", ownerExternalIdStored); + log.debug("transferExternalId generated by user: {}", transferExternalIdExpected); + log.debug("transferExternalIdActual: {}", transferExternalIdActual); assertThat(loanIdActual).as(ErrorMessageHelper.wrongDataInAssetExternalizationResponse(loanIdActual, loanId)).isEqualTo(loanId); assertThat(body.getResourceId()).isNotNull(); @@ -405,8 +405,8 @@ public void buybackDateError(int errorCodeExpected, DataTable table) throws IOEx assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @Then("Asset externalization transaction with the following data results a {int} error and {string} error message") @@ -453,8 +453,8 @@ public void transactionError(int errorCodeExpected, String errorMessageType, Dat assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @Then("Asset externalization SALES transaction with ownerExternalId = null and the following data results a {int} error and {string} error message") @@ -488,8 +488,8 @@ public void transactionErrorSalesOwnerNull(int errorCodeExpected, String errorMe assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @Then("The latest asset externalization transaction with {string} status has the following TRANSFER Journal entries:") @@ -528,10 +528,10 @@ public void checkJournalEntriesTransaction(String status, DataTable table) throw .isEqualTo(linesExpected); } - log.info("loanId: {}", journalEntriesOfTransfer.body().getTransferData().getLoan().getLoanId()); - log.info("ownerExternalId: {}", journalEntriesOfTransfer.body().getTransferData().getOwner().getExternalId()); - log.info("transferId: {}", lastTransferIdByStatus); - log.info("transferExternalId: {}", journalEntriesOfTransfer.body().getTransferData().getTransferExternalId()); + log.debug("loanId: {}", journalEntriesOfTransfer.body().getTransferData().getLoan().getLoanId()); + log.debug("ownerExternalId: {}", journalEntriesOfTransfer.body().getTransferData().getOwner().getExternalId()); + log.debug("transferId: {}", lastTransferIdByStatus); + log.debug("transferExternalId: {}", journalEntriesOfTransfer.body().getTransferData().getTransferExternalId()); } private Long getLastTransferIdByStatus(Long loanId, String status) throws IOException { @@ -589,7 +589,7 @@ public void checkJournalEntriesOwner(DataTable table) throws IOException { .isEqualTo(linesExpected); } - log.info("ownerExternalId: {}", journalEntriesOfOwner.body().getOwnerData().getExternalId()); + log.debug("ownerExternalId: {}", journalEntriesOfOwner.body().getOwnerData().getExternalId()); } @Then("LoanOwnershipTransferBusinessEvent is created") @@ -633,10 +633,10 @@ public void checkAssetExternalizationResponse(String type) { Long loanIdActual = body.getSubResourceId(); String transferExternalIdActual = body.getResourceExternalId(); - log.info("loanId: {}", loanId); - log.info("ownerExternalIdStored: {}", ownerExternalIdStored); - log.info("transferExternalId generated by user: {}", transferExternalIdExpected); - log.info("transferExternalIdActual: {}", transferExternalIdActual); + log.debug("loanId: {}", loanId); + log.debug("ownerExternalIdStored: {}", ownerExternalIdStored); + log.debug("transferExternalId generated by user: {}", transferExternalIdExpected); + log.debug("transferExternalIdActual: {}", transferExternalIdActual); assertThat(loanIdActual).as(ErrorMessageHelper.wrongDataInAssetExternalizationResponse(loanIdActual, loanId)).isEqualTo(loanId); assertThat(body.getResourceId()).isNotNull(); diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BatchApiStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BatchApiStepDef.java index 7fdd1414b82..13889c4e56d 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BatchApiStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BatchApiStepDef.java @@ -488,11 +488,11 @@ public void runBatchApiCreateAndApproveLoanRescheduleWithGivenUser(String fromDa .execute(); if (batchResponseList.errorBody() != null) { - log.info("ERROR: {}", batchResponseList.errorBody().string()); + log.debug("ERROR: {}", batchResponseList.errorBody().string()); } if (batchResponseList.body() != null) { - log.info("Body: {}", batchResponseList.body()); + log.debug("Body: {}", batchResponseList.body()); } testContext().set(TestContextKey.BATCH_API_CALL_RESPONSE, batchResponseList); @@ -554,8 +554,8 @@ public void runBatchApiCreateAndApproveLoanRescheduleWithGivenUserLockedByCobErr assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @When("Batch API call with steps: queryDatatable, updateDatatable runs, with empty queryDatatable response") diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BusinessStepStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BusinessStepStepDef.java index 1752fcc3caa..554999713c1 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BusinessStepStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BusinessStepStepDef.java @@ -150,7 +150,7 @@ public void removeGivenJobInCOB(String businessStepName) throws IOException { } private void setBackBusinessStepsToOriginal() throws IOException { - log.info("Setting back Business steps to original..."); + log.debug("Setting back Business steps to original..."); UpdateBusinessStepConfigRequest request = new UpdateBusinessStepConfigRequest().businessSteps(ORIGINAL_COB_BUSINESS_STEPS); Response response = businessStepConfigurationApi.updateJobBusinessStepConfig(WORKFLOW_NAME_LOAN_CLOSE_OF_BUSINESS, request) @@ -172,7 +172,7 @@ private void logChanges() throws IOException { .map(BusinessStep::getStepName)// .collect(Collectors.toList());// - log.info("Business steps has been CHANGED to the following:"); - changes.forEach(e -> log.info(e)); + log.debug("Business steps has been CHANGED to the following:"); + changes.forEach(e -> log.debug(e)); } } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanCOBStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanCOBStepDef.java index 9c04e3f373f..d5090dd64aa 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanCOBStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanCOBStepDef.java @@ -60,8 +60,8 @@ public void checkOldestCOBProcessed() throws IOException { LocalDate cobDate = response.body().getCobBusinessDate(); LocalDate cobDateMinusOne = cobDate.minusDays(1); LocalDate cobProcessedDate = response.body().getCobProcessedDate(); - log.info("cobDateMinusOne: {}", cobDateMinusOne); - log.info("cobProcessedDate: {}", cobProcessedDate); + log.debug("cobDateMinusOne: {}", cobDateMinusOne); + log.debug("cobProcessedDate: {}", cobProcessedDate); boolean result = cobDateMinusOne.isAfter(cobProcessedDate); assertThat(result).as(ErrorMessageHelper.wrongLastCOBProcessedLoanDate(cobProcessedDate, cobDateMinusOne)).isTrue(); @@ -74,7 +74,7 @@ public void listOfLockedLoansEmpty() throws IOException { int size = response.body().getContent().size(); assertThat(size).as(ErrorMessageHelper.listOfLockedLoansNotEmpty(response)).isEqualTo(0); - log.info("Size of List of the locked loans: {}", size); + log.debug("Size of List of the locked loans: {}", size); } @Then("The loan account is not locked") diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeAdjustmentStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeAdjustmentStepDef.java index 72cd37afdd2..8b066393928 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeAdjustmentStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeAdjustmentStepDef.java @@ -118,8 +118,8 @@ public void loanChargeAdjustmentFailedOnWrongAmount(String chargeTypeEnum, Strin .as(ErrorMessageHelper.wrongErrorMessageInFailedChargeAdjustment(developerMessageActual, developerMessageExpected)) .isEqualTo(developerMessageExpected); - log.info("Error code: {}", httpStatusCodeActual); - log.info("Error message: {}", developerMessageActual); + log.debug("Error code: {}", httpStatusCodeActual); + log.debug("Error message: {}", developerMessageActual); } @When("Admin reverts the charge adjustment which was raised on {string} with {double} EUR transaction amount") diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeStepDef.java index 9a2bccac293..8acfc8dbdb2 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanChargeStepDef.java @@ -26,6 +26,7 @@ import io.cucumber.java.en.Then; import io.cucumber.java.en.When; import java.io.IOException; +import java.math.BigDecimal; import java.time.format.DateTimeFormatter; import java.util.List; import lombok.extern.slf4j.Slf4j; @@ -258,9 +259,9 @@ private void addChargeEventCheck(Response loanCh GetLoansLoanIdChargesChargeIdResponse body = chargeDetails.body(); eventAssertion.assertEvent(LoanAddChargeEvent.class, loanChargeResponse.body().getResourceId()) - .extractingData(LoanChargeDataV1::getName).isEqualTo(body.getName()) - .extractingData(loanChargeDataV1 -> loanChargeDataV1.getAmount().longValue()).isEqualTo(body.getAmount().longValue()) - .extractingData(LoanChargeDataV1::getDueDate).isEqualTo(formatter.format(body.getDueDate())); + .extractingData(LoanChargeDataV1::getName).isEqualTo(body.getName()).extractingBigDecimal(LoanChargeDataV1::getAmount) + .isEqualTo(BigDecimal.valueOf(body.getAmount())).extractingData(LoanChargeDataV1::getDueDate) + .isEqualTo(formatter.format(body.getDueDate())); } @Then("Loan charge transaction with the following data results a {int} error and {string} error message") @@ -300,7 +301,7 @@ public void chargeOffTransactionError(int errorCodeExpected, String errorMessage assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanDelinquencyStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanDelinquencyStepDef.java index d584e3a0bce..963749f77cb 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanDelinquencyStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanDelinquencyStepDef.java @@ -273,8 +273,8 @@ public void delinquencyPauseWithCreatedUserNOPermissionError(String startDate, S assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @When("Admin initiate a DELINQUENCY RESUME with startDate: {string}") @@ -657,7 +657,7 @@ public void checkDelinquencyRangeInEvent() throws IOException { Long loanLevelDelinquencyRangeIdExpected = delinquencyRange.getId(); String loanLevelDelinquencyRangeExpected = delinquencyRange.getClassification(); String loanLevelDelinquentDateExpected = FORMATTER.format(delinquent.getDelinquentDate()); - BigDecimal loanLevelTotalAmountExpected = new BigDecimal(delinquent.getDelinquentAmount()); + BigDecimal loanLevelTotalAmountExpected = BigDecimal.valueOf(delinquent.getDelinquentAmount()); assertThat(loanLevelDelinquencyRangeId)// .as(ErrorMessageHelper.wrongValueInLoanDelinquencyRangeChangeBusinessEvent4(loanLevelDelinquencyRangeId, @@ -674,7 +674,7 @@ public void checkDelinquencyRangeInEvent() throws IOException { assertThat(loanLevelTotalAmount)// .as(ErrorMessageHelper.wrongValueInLoanDelinquencyRangeChangeBusinessEvent6(loanLevelTotalAmount, loanLevelTotalAmountExpected))// - .isEqualTo(loanLevelTotalAmountExpected);// + .isEqualByComparingTo(loanLevelTotalAmountExpected);// List installmentLevelDelinquencyBucketsExpected = delinquent .getInstallmentLevelDelinquency(); @@ -703,7 +703,7 @@ public void checkDelinquencyRangeInEvent() throws IOException { assertThat(installmentLevelTotalAmount)// .as(ErrorMessageHelper.wrongValueInLoanDelinquencyRangeChangeBusinessEvent3(installmentLevelTotalAmount, installmentLevelTotalAmountExpected))// - .isEqualTo(installmentLevelTotalAmountExpected);// + .isEqualByComparingTo(installmentLevelTotalAmountExpected);// } return null; }); @@ -728,8 +728,8 @@ public void delinquentLastRepaymentAmountCheck(int expectedLastRepaymentAmount, .as(ErrorMessageHelper.wrongDataInDelinquentLastRepaymentDate(actualLastRepaymentDate, expectedLastRepaymentDate))// .isEqualTo(expectedLastRepaymentDate);// - log.info("loanDetails.delinquent.lastRepaymentAmount: {}", actualLastRepaymentAmount); - log.info("loanDetails.delinquent.lastRepaymentDate: {}", actualLastRepaymentDate); + log.debug("loanDetails.delinquent.lastRepaymentAmount: {}", actualLastRepaymentAmount); + log.debug("loanDetails.delinquent.lastRepaymentDate: {}", actualLastRepaymentDate); } private List fetchValuesOfDelinquencyPausePeriods(List header, GetLoansLoanIdDelinquencyPausePeriod t) { @@ -757,8 +757,8 @@ private void errorMessageAssertation(Response loanTransactionAdjustmentDataV1.getTransactionToAdjust().getId()) .isEqualTo(targetTransaction.getId()); - eventAssertionBuilder.extractingData( - loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getTransactionToAdjust().getAmount().doubleValue()) - .isEqualTo(targetTransaction.getAmount()); + eventAssertionBuilder + .extractingBigDecimal( + loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getTransactionToAdjust().getAmount()) + .isEqualTo(BigDecimal.valueOf(targetTransaction.getAmount())); eventAssertionBuilder .extractingData( loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getTransactionToAdjust().getManuallyReversed()) @@ -587,9 +588,10 @@ private void adjustNthRepaymentWithExternalOwnerCheck(String nthItemStr, String eventAssertionBuilder .extractingData(loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getNewTransactionDetail().getId()) .isEqualTo(repaymentAdjustmentResponse.body().getResourceId()); - eventAssertionBuilder.extractingData( - loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getNewTransactionDetail().getAmount().doubleValue()) - .isEqualTo(amountValue); + eventAssertionBuilder + .extractingBigDecimal( + loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getNewTransactionDetail().getAmount()) + .isEqualTo(BigDecimal.valueOf(amountValue)); eventAssertionBuilder.extractingData( loanTransactionAdjustmentDataV1 -> loanTransactionAdjustmentDataV1.getNewTransactionDetail().getExternalOwnerId()) .isEqualTo(externalOwnerId); diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanRescheduleStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanRescheduleStepDef.java index 31c64d90c70..8fc6732705c 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanRescheduleStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanRescheduleStepDef.java @@ -163,7 +163,7 @@ public void createLoanRescheduleError(int errorCodeExpected, String errorMessage assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java index 62c01d5926a..cc3582e3efa 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java @@ -44,7 +44,6 @@ import java.util.Objects; import java.util.Optional; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; import org.apache.fineract.avro.loan.v1.LoanAccountDataV1; @@ -386,8 +385,8 @@ public void futureDateCBRError(String transactionDate, double transactionAmount) assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @When("Admin creates a fully customized loan with the following data:") @@ -548,8 +547,8 @@ public void createFullyCustomizedLoanWithForcedEnabledDownpayment(DataTable tabl assertThat(errorCode).as(ErrorMessageHelper.dateFailureErrorCodeMsg()).isEqualTo(403); assertThat(errorMessage).isEqualTo(ErrorMessageHelper.downpaymentDisabledOnProductErrorCodeMsg()); - log.info("Error code: {}", errorCode); - log.info("Error message: {}}", errorMessage); + log.debug("Error code: {}", errorCode); + log.debug("Error message: {}}", errorMessage); } @When("Admin creates a fully customized loan with auto downpayment {double}% and with the following data:") @@ -845,8 +844,8 @@ public void createFullyCustomizedLoanFixedLengthError(int fixedLength, int error assertThat(errorCodeActual).as(ErrorMessageHelper.wrongErrorCode(errorCodeActual, errorCodeExpected)).isEqualTo(errorCodeExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @When("Admin creates a fully customized loan with Advanced payment allocation and with product no Advanced payment allocation set results an error:") @@ -927,8 +926,8 @@ public void createFullyCustomizedLoanNoAdvancedPaymentError(DataTable table) thr assertThat(errorMessageActual).as(ErrorMessageHelper.wrongErrorMessage(errorMessageActual, errorMessageExpected)) .isEqualTo(errorMessageExpected); - log.info("ERROR CODE: {}", errorCodeActual); - log.info("ERROR MESSAGE: {}", errorMessageActual); + log.debug("ERROR CODE: {}", errorCodeActual); + log.debug("ERROR MESSAGE: {}", errorMessageActual); } @When("Admin creates a fully customized loan with installment level delinquency and with the following data:") @@ -1519,7 +1518,7 @@ public void disburseLoanFailureWithAmount(String actualDisbursementDate, String assertThat(errorDetails.getHttpStatusCode()).as(ErrorMessageHelper.dateFailureErrorCodeMsg()).isEqualTo(403); assertThat(developerMessage).matches(ErrorMessageHelper.disburseMaxAmountFailure()); - log.info("Error message: {}", developerMessage); + log.debug("Error message: {}", developerMessage); } @Then("Loan has {double} outstanding amount") @@ -2073,18 +2072,24 @@ public void runLoanCOBCatchUp() throws IOException { @When("Admin checks that Loan COB is running until the current business date") public void checkLoanCOBCatchUpRunningUntilCOBBusinessDate() { - await().pollInterval(2, TimeUnit.SECONDS).atMost(Duration.ofSeconds(20)).until(() -> { - Response isCatchUpRunningResponse = loanCobCatchUpApi.isCatchUpRunning().execute(); - ErrorHelper.checkSuccessfulApiCall(isCatchUpRunningResponse); - IsCatchUpRunningResponse isCatchUpRunning = isCatchUpRunningResponse.body(); - return isCatchUpRunning.getIsCatchUpRunning(); - }); - await().pollInterval(2, TimeUnit.SECONDS).atMost(Duration.ofMinutes(4)).until(() -> { - Response isCatchUpRunningResponse = loanCobCatchUpApi.isCatchUpRunning().execute(); - ErrorHelper.checkSuccessfulApiCall(isCatchUpRunningResponse); - IsCatchUpRunningResponse isCatchUpRunning = isCatchUpRunningResponse.body(); - return !isCatchUpRunning.getIsCatchUpRunning(); - }); + await().atMost(Duration.ofMinutes(2)) // + .pollInterval(Duration.ofSeconds(5)) // + .pollDelay(Duration.ofSeconds(5)) // + .until(() -> { + Response isCatchUpRunningResponse = loanCobCatchUpApi.isCatchUpRunning().execute(); + ErrorHelper.checkSuccessfulApiCall(isCatchUpRunningResponse); + IsCatchUpRunningResponse isCatchUpRunning = isCatchUpRunningResponse.body(); + return isCatchUpRunning.getIsCatchUpRunning(); + }); + await().atMost(Duration.ofMinutes(4)) // + .pollInterval(Duration.ofSeconds(5)) // + .pollDelay(Duration.ofSeconds(5)) // + .until(() -> { + Response isCatchUpRunningResponse = loanCobCatchUpApi.isCatchUpRunning().execute(); + ErrorHelper.checkSuccessfulApiCall(isCatchUpRunningResponse); + IsCatchUpRunningResponse isCatchUpRunning = isCatchUpRunningResponse.body(); + return !isCatchUpRunning.getIsCatchUpRunning(); + }); } @Then("Loan's actualMaturityDate is {string}") @@ -2289,7 +2294,7 @@ public void editFutureInstallmentAllocationTypeForLoanProduct(String loanProduct String futureInstallmentAllocationRuleNew) throws IOException { DefaultLoanProduct product = DefaultLoanProduct.valueOf(loanProductName); Long loanProductId = loanProductResolver.resolve(product); - log.info("loanProductId: {}", loanProductId); + log.debug("loanProductId: {}", loanProductId); Response loanProductDetails = loanProductsApi.retrieveLoanProductDetails(loanProductId).execute(); ErrorHelper.checkSuccessfulApiCall(loanProductDetails); @@ -2319,7 +2324,7 @@ public void editFutureInstallmentAllocationTypeForLoanProduct(String loanProduct public void editRepaymentStartDateType(String loanProductName, String repaymentStartDateType) throws IOException { DefaultLoanProduct product = DefaultLoanProduct.valueOf(loanProductName); Long loanProductId = loanProductResolver.resolve(product); - log.info("loanProductId: {}", loanProductId); + log.debug("loanProductId: {}", loanProductId); Map repaymentStartDateTypeMap = Map.of("DISBURSEMENT_DATE", 1, "SUBMITTED_ON_DATE", 2); diff --git a/fineract-e2e-tests-runner/src/test/resources/features/COB.feature b/fineract-e2e-tests-runner/src/test/resources/features/0_COB.feature similarity index 100% rename from fineract-e2e-tests-runner/src/test/resources/features/COB.feature rename to fineract-e2e-tests-runner/src/test/resources/features/0_COB.feature diff --git a/fineract-e2e-tests-runner/src/test/resources/features/LoanAccrualTransaction.feature b/fineract-e2e-tests-runner/src/test/resources/features/LoanAccrualTransaction.feature index 2805d403f04..93889a623d0 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/LoanAccrualTransaction.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/LoanAccrualTransaction.feature @@ -61,16 +61,16 @@ Feature: LoanAccrualTransaction And Customer makes "AUTOPAY" repayment on "03 January 2023" with 250 EUR transaction amount When Admin adds "LOAN_SNOOZE_FEE" due date charge with "04 January 2023" due date and 10 EUR transaction amount When Admin sets the business date to "04 January 2023" - And Admin runs COB job + And Admin runs inline COB job for Loan When Admin sets the business date to "05 January 2023" And Customer makes "AUTOPAY" repayment on "05 January 2023" with 510 EUR transaction amount Then Loan has 0 outstanding amount - And Admin makes "REPAYMENT_ADJUSTMENT_CHARGEBACK" chargeback with 250 EUR transaction amount for Payment nr. 2 - Then Loan has 250 outstanding amount + Then LoanAccrualTransactionCreatedBusinessEvent is raised on "05 January 2023" Then Loan Transactions tab has a transaction with date: "05 January 2023", and with the following data: | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | | Accrual | 10.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | - Then LoanAccrualTransactionCreatedBusinessEvent is raised on "05 January 2023" + And Admin makes "REPAYMENT_ADJUSTMENT_CHARGEBACK" chargeback with 250 EUR transaction amount for Payment nr. 2 + Then Loan has 250 outstanding amount Scenario: Verify that after periodic accrual transaction job accrual event is raised when loan has a fee-charge added with waive charge and undo waive charge @@ -322,7 +322,7 @@ Feature: LoanAccrualTransaction And Admin runs COB job And Admin successfully disburse the loan on "28 April 2023" with "20" EUR transaction amount When Admin sets the business date to "29 April 2023" - And Admin runs COB job + And Admin runs inline COB job for Loan Then Loan Repayment schedule has 1 periods, with the following data for periods: | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | | | | 26 April 2023 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | @@ -349,7 +349,7 @@ Feature: LoanAccrualTransaction Then Loan has 1000 outstanding amount When Admin adds "LOAN_SNOOZE_FEE" due date charge with "1 May 2023" due date and 10 EUR transaction amount When Admin sets the business date to "2 May 2023" - And Admin runs COB job + And Admin runs inline COB job for Loan When Admin sets the business date to "8 May 2023" And Admin successfully disburse the loan on "8 May 2023" with "20" EUR transaction amount Then Loan Repayment schedule has 1 periods, with the following data for periods: diff --git a/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature b/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature index 690fc317e10..89cf72b54d3 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature @@ -5,6 +5,8 @@ Feature: LoanCharge Scenario: Charge creation functionality with locale EN When Admin creates a client with random data When Admin successfully creates a new customised Loan submitted on date: "1 July 2022", with Principal: "6000", a loanTermFrequency: 24 months, and numberOfRepayments: 24 + And Admin successfully approves the loan on "1 July 2022" with "6000" amount and expected disbursement date on "1 July 2022" + When Admin successfully disburse the loan on "1 July 2022" with "6000" EUR transaction amount And Admin adds a 10 % Processing charge to the loan with "en" locale on date: "10 July 2022" Then Charge is successfully added to the loan with 600 EUR @@ -12,6 +14,8 @@ Feature: LoanCharge Scenario: Charge creation functionality with locale DE When Admin creates a client with random data When Admin successfully creates a new customised Loan submitted on date: "1 July 2022", with Principal: "6000", a loanTermFrequency: 24 months, and numberOfRepayments: 24 + And Admin successfully approves the loan on "1 July 2022" with "6000" amount and expected disbursement date on "1 July 2022" + When Admin successfully disburse the loan on "1 July 2022" with "6000" EUR transaction amount And Admin adds a 10 % Processing charge to the loan with "de_DE" locale on date: "10 Juli 2022" Then Charge is successfully added to the loan with 600 EUR @@ -118,261 +122,837 @@ Feature: LoanCharge When Admin sets the business date to "23 October 2022" And Admin adds an NSF fee because of payment bounce with "23 October 2022" transaction date Then Loan has 1010 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | | 500.0 | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 0.0 | 0.0 | 0.0 | 510.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 0 | 10 | 1010 | 0 | 0 | 0 | 1010 | -## check transactions last transaction ID type:accrual amount:10, fee:10 depends on NSF penalty or fee / nekunk -# TODO Accrual job 500 Error -# And Admin runs the Add Periodic Accrual Transactions job -# Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: -# | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | -# | Repayment | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 600.0 | - - -## chek Journal entries for transaction ID --> type/account name/debit-credit amount - # TODO can be done when journal entry paging is fixed -# Then The transaction type "Accrual" with date "23 October 2022" has the following journal entries data: Type="ASSET", Account name="Interest/Fee Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - -## check charges --> due/paid/waived/outstanding - Then Loan Charges tab has a given charge with the following data: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 0.0 | 10.0 | 1010.0 | 0.0 | 0.0 | 0.0 | 1010.0 | + Then Loan Charges tab has the following data: | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 0.0 | 0.0 | 10.0 | - + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | +# --- charge adjustment for nsf fee with 3 --- When Admin sets the business date to "04 November 2022" - -## charge adjustment for nsf fee with 3 When Admin makes a charge adjustment for the last "LOAN_NSF_FEE" type charge which is due on "23 October 2022" with 3 EUR transaction amount and externalId "" Then Loan has 1007 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | | 500.0 | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 3.0 | 3.0 | 0.0 | 507.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 0 | 10 | 1010 | 3 | 3 | 0 | 1007 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 3.0 | 0.0 | 0.0 | 0.0 | 3.0 | 1000.0 | - -## chek Journal entries for transaction ID --> type/account name/debit-credit amount -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Interest/Fee Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 0.0 | 10.0 | 1010.0 | 3.0 | 3.0 | 0.0 | 1007.0 | + Then Loan Charges tab has the following data: | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 3.0 | 0.0 | 7.0 | -# + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | + | 04 November 2022 | Charge Adjustment | 3.0 | 0.0 | 0.0 | 0.0 | 3.0 | 1000.0 | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 3.0 | + | INCOME | 404007 | Fee Income | 3.0 | | +# --- Backdated repayment with 8 EUR --- And Customer makes "AUTOPAY" repayment on "25 October 2022" with 8 EUR transaction amount Then Loan has 999 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | | 500.0 | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 11.0 | 11.0 | 0.0 | 499.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 0 | 10 | 1010 | 11 | 11 | 0 | 999 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Interest/Fee Receivable", Type="INCOME", Account name="Fee Income", Type="ASSET", Account name="Loans Receivable" - Then Loan Charges tab has a given charge with the following data: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 0.0 | 10.0 | 1010.0 | 11.0 | 11.0 | 0.0 | 999.0 | + Then Loan Charges tab has the following data: | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | -# -## charge adjustment with 8 will fail - When Charge adjustment for the last "LOAN_NSF_FEE" type charge which is due on "23 October 2022" with transaction amount 8 which is higher than the available charge amount results an ERROR -## revert last charge adjustment (was amount 3) + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | +# --- charge adjustment with 8 will fail --- + Then Charge adjustment for the last "LOAN_NSF_FEE" type charge which is due on "23 October 2022" with transaction amount 8 which is higher than the available charge amount results an ERROR +# --- revert last charge adjustment (was amount 3) --- When Admin reverts the charge adjustment which was raised on "04 November 2022" with 3 EUR transaction amount Then Loan has 1002 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | | 500.0 | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 8.0 | 8.0 | 0.0 | 502.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 0 | 10 | 1010 | 8 | 8 | 0 | 1002 | - Then In Loan Transactions the latest Transaction has Transaction type="Charge Adjustment" and is reverted -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Interest/Fee Receivable", Type="INCOME", Account name="Fee Income", Type="ASSET", Account name="Loans Receivable" - Then Loan Charges tab has a given charge with the following data: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 0.0 | 10.0 | 1010.0 | 8.0 | 8.0 | 0.0 | 1002.0 | + Then Loan Charges tab has the following data: | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 8.0 | 0.0 | 2.0 | -# -## Add snooze fee on 10/27/2022 with amount 9 (az eloyo legzen penaltz ez meg fee( + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | +# --- Add snooze fee on 10/27/2022 with amount 9 --- And Admin adds "LOAN_SNOOZE_FEE" due date charge with "27 October 2022" due date and 9 EUR transaction amount Then Loan has 1011 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 8.0 | 8.0 | 0.0 | 511.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 8 | 8 | 0 | 1011 | - Then In Loan Transactions the latest Transaction has Transaction type="Charge Adjustment" and is reverted -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Interest/Fee Receivable", Type="INCOME", Account name="Fee Income", Type="ASSET", Account name="Loans Receivable" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 0.0 | 0.0 | 9.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 0 | 0 | 9 | -# -## charge adjustment for snooze fee with 4 + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 8.0 | 8.0 | 0.0 | 1011.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 0.0 | 0.0 | 9.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 8.0 | 0.0 | 2.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | +# --- charge adjustment for snooze fee with 4 --- When Admin makes a charge adjustment for the last "LOAN_SNOOZE_FEE" type charge which is due on "27 October 2022" with 4 EUR transaction amount and externalId "" Then Loan has 1007 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 12.0 | 12.0 | 0.0 | 507.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 12 | 12 | 0 | 1007 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 4.0 | 0.0 | 0.0 | 2.0 | 2.0 | 1000.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Interest/Fee Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 2.0 | 0.0 | 7.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 2 | 0 | 7 | -# + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 12.0 | 12.0 | 0.0 | 1007.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 2.0 | 0.0 | 7.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 0.0 | 0.0 | 2.0 | 2.0 | 1000.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | +# --- Backdated repayment with 507 EUR --- And Customer makes "AUTOPAY" repayment on "31 October 2022" with 507 EUR transaction amount Then Loan has 500 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 04 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 519 | 519 | 0 | 500 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 500.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Loans Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | -# -## charge adjustment for nsf fee with 5 / hol jegyzi meg az ID-t? + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 519.0 | 519.0 | 0.0 | 500.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 500.0 | false | true | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | +# --- charge adjustment for nsf fee with 5 --- When Admin makes a charge adjustment for the last "LOAN_NSF_FEE" type charge which is due on "23 October 2022" with 5 EUR transaction amount and externalId "" Then Loan has 495 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 04 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 5.0 | 5.0 | 0.0 | 495.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 524 | 524 | 0 | 495 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 495.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Loans Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | - + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 524.0 | 524.0 | 0.0 | 495.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 500.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 495.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | +# --- Backdated repayment with 494 EUR --- And Customer makes "AUTOPAY" repayment on "1 November 2022" with 494 EUR transaction amount Then Loan has 1 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 01 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 499.0 | 499.0 | 0.0 | 1.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 1018 | 1018 | 0 | 1 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Loans Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | -# -# # charge adjustment for snooze fee with 1 + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 1018.0 | 1018.0 | 0.0 | 1.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 01 November 2022 | Repayment | 494.0 | 494.0 | 0.0 | 0.0 | 0.0 | 10.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 6.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "01 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 494.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 494.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | +# --- charge adjustment for snooze fee with 1 --- When Admin makes a charge adjustment for the last "LOAN_SNOOZE_FEE" type charge which is due on "27 October 2022" with 1 EUR transaction amount and externalId "" Then Loan status will be "CLOSED_OBLIGATIONS_MET" Then Loan has 0 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 01 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | 04 November 2022 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 500.0 | 500.0 | 0.0 | 0.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 1019 | 1019 | 0 | 0 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Loans Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | -# -# # revert last charge adjustment (was amount 1) + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 1019.0 | 1019.0 | 0.0 | 0.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 01 November 2022 | Repayment | 494.0 | 494.0 | 0.0 | 0.0 | 0.0 | 10.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 6.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | false | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "01 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 494.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 494.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | +# --- revert last charge adjustment (was amount 1) --- When Admin reverts the charge adjustment which was raised on "04 November 2022" with 1 EUR transaction amount Then Loan status will be "ACTIVE" Then Loan has 1 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 01 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 499.0 | 499.0 | 0.0 | 1.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 1018 | 1018 | 0 | 1 | -# TODO do it with nth transaction and not latest, because accrual is working now, so the last transaction will be accrual and the one before will be the reverted Charge Adjustment -# Then In Loan Transactions the latest Transaction has Transaction type="Charge Adjustment" and is reverted -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Loans Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | -# -# # charge adjustment for nsf fee with 1 + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 1018.0 | 1018.0 | 0.0 | 1.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 01 November 2022 | Repayment | 494.0 | 494.0 | 0.0 | 0.0 | 0.0 | 10.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 6.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | false | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "01 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 494.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 494.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | INCOME | 404007 | Fee Income | | 1.0 | +# --- charge adjustment for nsf fee with 1 --- When Admin makes a charge adjustment for the last "LOAN_NSF_FEE" type charge which is due on "23 October 2022" with 1 EUR transaction amount and externalId "" Then Loan status will be "CLOSED_OBLIGATIONS_MET" Then Loan has 0 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 01 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | 04 November 2022 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 500.0 | 500.0 | 0.0 | 0.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 1019 | 1019 | 0 | 0 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="ASSET", Account name="Loans Receivable", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | -# -# # charge adjustment for nsf fee with 2 + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 1019.0 | 1019.0 | 0.0 | 0.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 01 November 2022 | Repayment | 494.0 | 494.0 | 0.0 | 0.0 | 0.0 | 10.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 6.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | false | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "01 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 494.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 494.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | INCOME | 404007 | Fee Income | | 1.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | +# --- charge adjustment for nsf fee with 2 --- When Admin makes a charge adjustment for the last "LOAN_NSF_FEE" type charge which is due on "23 October 2022" with 2 EUR transaction amount and externalId "" Then Loan status will be "OVERPAID" Then Loan has 0 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 01 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | 04 November 2022 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 500.0 | 500.0 | 0.0 | 0.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 1019 | 1019 | 0 | 0 | - Then Loan Transactions tab has a transaction with date: "04 November 2022", and with the following data: - | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | - | Charge Adjustment | 2.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | - Then Loan has 2 overpaid amount - -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="LIABILITY", Account name="Overpayment account", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | -# -# # revert last charge adjustment (was amount 2) + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 1019.0 | 1019.0 | 0.0 | 0.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 01 November 2022 | Repayment | 494.0 | 494.0 | 0.0 | 0.0 | 0.0 | 10.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 6.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | false | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 2.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "01 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 494.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 494.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | INCOME | 404007 | Fee Income | | 1.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | LIABILITY | l1 | Overpayment account | | 2.0 | + | INCOME | 404007 | Fee Income | 2.0 | | +# --- revert last charge adjustment (was amount 2) --- When Admin reverts the charge adjustment which was raised on "04 November 2022" with 2 EUR transaction amount Then Loan status will be "CLOSED_OBLIGATIONS_MET" Then Loan has 0 outstanding amount + And Admin runs the Add Periodic Accrual Transactions job + Then Loan Repayment schedule has 2 periods, with the following data for periods: + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | | | 22 October 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 31 | 22 November 2022 | 01 November 2022 | 500.0 | 500.0 | 0.0 | 9.0 | 10.0 | 519.0 | 519.0 | 519.0 | 0.0 | 0.0 | + | 2 | 30 | 22 December 2022 | 04 November 2022 | 0.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 500.0 | 500.0 | 0.0 | 0.0 | Then Loan Repayment schedule has the following data in Total row: - | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | - | 1000 | 0 | 9 | 10 | 1019 | 1019 | 1019 | 0 | 0 | - Then In Loan Transactions the latest Transaction has Transaction type="Charge Adjustment" and is reverted -# TODO can be done when journal entry paging is fixed -# Then The transaction type "Charge Adjustment" with date "04 November 2022" has the following journal entries data: Type="LIABILITY", Account name="Overpayment account", Type="INCOME", Account name="Fee Income", Type="", Account name="" - Then Loan Charges tab has a given charge with the following data: - | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | - | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | -# Then In Loan Charges the given Charge has the following data: -# | nth Charge | Name | isPenalty | Due as of | Due | Paid | Waived | Outstanding | -# | | Snooze fee | false | 27 October 2022 | 9 | 9 | 0 | 0 | - + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 1000.0 | 0.0 | 9.0 | 10.0 | 1019.0 | 1019.0 | 1019.0 | 0.0 | 0.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Snooze fee | false | Specified due date | 27 October 2022 | Flat | 9.0 | 9.0 | 0.0 | 0.0 | + | NSF fee | true | Specified due date | 23 October 2022 | Flat | 10.0 | 10.0 | 0.0 | 0.0 | + Then Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | + | 22 October 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | + | 23 October 2022 | Accrual | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | false | false | + | 25 October 2022 | Repayment | 8.0 | 0.0 | 0.0 | 0.0 | 8.0 | 1000.0 | false | false | + | 31 October 2022 | Repayment | 507.0 | 496.0 | 0.0 | 9.0 | 2.0 | 504.0 | false | false | + | 01 November 2022 | Repayment | 494.0 | 494.0 | 0.0 | 0.0 | 0.0 | 10.0 | false | false | + | 04 November 2022 | Charge Adjustment | 3.0 | 1.0 | 0.0 | 0.0 | 2.0 | 999.0 | true | true | + | 04 November 2022 | Accrual | 9.0 | 0.0 | 0.0 | 9.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 4.0 | 4.0 | 0.0 | 0.0 | 0.0 | 6.0 | false | true | + | 04 November 2022 | Charge Adjustment | 5.0 | 5.0 | 0.0 | 0.0 | 0.0 | 1.0 | false | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | false | + | 04 November 2022 | Charge Adjustment | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false | + | 04 November 2022 | Charge Adjustment | 2.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | false | + Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "22 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | 1000.0 | | + | LIABILITY | 145023 | Suspense/Clearing account | | 1000.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "23 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | + | INCOME | 404007 | Fee Income | | 10.0 | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "25 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | | 8.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 8.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "31 October 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 496.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 11.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 507.0 | | + Then Loan Transactions tab has a "REPAYMENT" transaction with date "01 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 494.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 494.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | ASSET | 112603 | Interest/Fee Receivable | | 2.0 | + | INCOME | 404007 | Fee Income | 3.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | ASSET | 112603 | Interest/Fee Receivable | 2.0 | | + | INCOME | 404007 | Fee Income | | 3.0 | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112603 | Interest/Fee Receivable | 9.0 | | + | INCOME | 404007 | Fee Income | | 9.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 4.0 | + | INCOME | 404007 | Fee Income | 4.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 5.0 | + | INCOME | 404007 | Fee Income | 5.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | + | ASSET | 112601 | Loans Receivable | 1.0 | | + | INCOME | 404007 | Fee Income | | 1.0 | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | ASSET | 112601 | Loans Receivable | | 1.0 | + | INCOME | 404007 | Fee Income | 1.0 | | + Then Loan Transactions tab has a "CHARGE_ADJUSTMENT" transaction with date "04 November 2022" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | LIABILITY | l1 | Overpayment account | | 2.0 | + | INCOME | 404007 | Fee Income | 2.0 | | + | LIABILITY | l1 | Overpayment account | 2.0 | | + | INCOME | 404007 | Fee Income | | 2.0 | Scenario: Verify that charge can be added to loan on disbursement date (loan status is 'active') When Admin sets the business date to "01 January 2023" diff --git a/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeback.feature b/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeback.feature index fadecc7c718..686ef8d90eb 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeback.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeback.feature @@ -1043,7 +1043,7 @@ Feature: LoanChargeback When Admin sets the business date to "05 April 2023" When Admin adds "LOAN_SNOOZE_FEE" due date charge with "05 April 2023" due date and 20 EUR transaction amount Then Loan has 270 outstanding amount - And Admin runs COB job + And Admin runs inline COB job for Loan And Customer makes "AUTOPAY" repayment on "05 April 2023" with 270 EUR transaction amount Then Loan has 0 outstanding amount And Admin makes "REPAYMENT_ADJUSTMENT_CHARGEBACK" chargeback with 250 EUR transaction amount for Payment nr. 2 diff --git a/fineract-e2e-tests-runner/src/test/resources/features/LoanRepayment.feature b/fineract-e2e-tests-runner/src/test/resources/features/LoanRepayment.feature index 6dc3164e517..0eb4ced08d6 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/LoanRepayment.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/LoanRepayment.feature @@ -3398,6 +3398,8 @@ Feature: LoanRepayment When Customer undo "1"th "Repayment" transaction made on "24 June 2024" Then Loan status will be "ACTIVE" + # Needs to fix Merchant issued Refund - Interest refund order + @Skip Scenario: Verify the relationship for Interest Refund transaction after repayment by reverting related transaction When Admin sets the business date to "30 January 2024" When Admin creates a client with random data @@ -3413,17 +3415,19 @@ Feature: LoanRepayment | 01 January 2024 | Disbursement | 200.0 | 0.0 | 0.0 | 0.0 | 0.0 | 200.0 | false | | 15 January 2024 | Merchant Issued Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | | 15 January 2024 | Interest Refund | 0.29 | 0.29 | 0.0 | 0.0 | 0.0 | 149.71 | false | - | 16 January 2024 | Payout Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 99.71 | false | - | 16 January 2024 | Interest Refund | 0.31 | 0.31 | 0.0 | 0.0 | 0.0 | 99.4 | false | - When Customer makes "AUTOPAY" repayment on "10 January 2024" with 25 EUR transaction amount (and transaction fails because of wrong date) + | 16 January 2024 | Payout Refund | 50.0 | 48.79 | 1.21 | 0.0 | 0.0 | 100.92 | false | + | 16 January 2024 | Interest Refund | 0.31 | 0.31 | 0.0 | 0.0 | 0.0 | 100.61 | false | + Then In Loan Transactions the "3"th Transaction has relationship type=RELATED with the "2"th Transaction + Then In Loan Transactions the "5"th Transaction has relationship type=RELATED with the "4"th Transaction + When Customer makes "AUTOPAY" repayment on "10 January 2024" with 25 EUR transaction amount Then Loan Transactions tab has the following data: | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | | 01 January 2024 | Disbursement | 200.0 | 0.0 | 0.0 | 0.0 | 0.0 | 200.0 | false | | 10 January 2024 | Repayment | 25.0 | 25.0 | 0.0 | 0.0 | 0.0 | 175.0 | false | - | 15 January 2024 | Merchant Issued Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 125.0 | false | - | 15 January 2024 | Interest Refund | 0.29 | 0.29 | 0.0 | 0.0 | 0.0 | 124.71 | false | - | 16 January 2024 | Payout Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 74.71 | false | - | 16 January 2024 | Interest Refund | 0.31 | 0.31 | 0.0 | 0.0 | 0.0 | 74.4 | false | + | 15 January 2024 | Merchant Issued Refund | 50.0 | 48.9 | 1.1 | 0.0 | 0.0 | 126.1 | false | + | 15 January 2024 | Interest Refund | 0.29 | 0.29 | 0.0 | 0.0 | 0.0 | 125.81 | false | + | 16 January 2024 | Payout Refund | 50.0 | 49.95 | 0.05 | 0.0 | 0.0 | 75.86 | false | + | 16 January 2024 | Interest Refund | 0.31 | 0.31 | 0.0 | 0.0 | 0.0 | 75.55 | false | Then In Loan Transactions the "4"th Transaction has relationship type=RELATED with the "3"th Transaction Then In Loan Transactions the "6"th Transaction has relationship type=RELATED with the "5"th Transaction When Customer undo "1"th "Merchant Issued Refund" transaction made on "15 January 2024" @@ -3432,7 +3436,7 @@ Feature: LoanRepayment | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | | 01 January 2024 | Disbursement | 200.0 | 0.0 | 0.0 | 0.0 | 0.0 | 200.0 | false | | 10 January 2024 | Repayment | 25.0 | 25.0 | 0.0 | 0.0 | 0.0 | 175.0 | false | - | 15 January 2024 | Merchant Issued Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 125.0 | true | - | 15 January 2024 | Interest Refund | 0.29 | 0.29 | 0.0 | 0.0 | 0.0 | 124.71 | true | - | 16 January 2024 | Payout Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 125.0 | true | - | 16 January 2024 | Interest Refund | 0.31 | 0.31 | 0.0 | 0.0 | 0.0 | 124.69 | true | \ No newline at end of file + | 15 January 2024 | Merchant Issued Refund | 50.0 | 48.9 | 1.1 | 0.0 | 0.0 | 126.1 | true | + | 15 January 2024 | Interest Refund | 0.29 | 0.29 | 0.0 | 0.0 | 0.0 | 125.81 | true | + | 16 January 2024 | Payout Refund | 50.0 | 48.83 | 1.17 | 0.0 | 0.0 | 126.17 | true | + | 16 January 2024 | Interest Refund | 0.31 | 0.31 | 0.0 | 0.0 | 0.0 | 125.86 | true | diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanCOBAccountLockCatchupInlineCOBTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanCOBAccountLockCatchupInlineCOBTest.java index e4096d91a06..4ff665bea8e 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanCOBAccountLockCatchupInlineCOBTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanCOBAccountLockCatchupInlineCOBTest.java @@ -253,7 +253,8 @@ public void testCatchUpInLockedInstanceLastCOBDateIsNotNull() { // days behind loanCOBCatchUpHelper.executeLoanCOBCatchUp(); - Awaitility.await().atMost(Duration.ofSeconds(30)).with().pollInterval(Duration.ofSeconds(5)) // + Awaitility.await().atMost(Duration.ofMinutes(2)).with().pollInterval(Duration.ofSeconds(5)) // + .pollDelay(Duration.ofSeconds(5)) // .until(() -> loanCOBCatchUpHelper.isLoanCOBCatchUpFinishedFor(LocalDate.of(2020, 3, 4))); // loan = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanID); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/NotificationHelper.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/NotificationHelper.java index 9c6487d169b..9182e1f27bf 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/NotificationHelper.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/NotificationHelper.java @@ -51,7 +51,9 @@ public static boolean areNotificationsAvailable(final RequestSpecification reque // Waiting for notifications to be available is needed due to the asynchronous event processing public static void waitUntilNotificationsAreAvailable(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - await().atMost(Duration.ofSeconds(30)).pollInterval(Duration.ofMillis(250)) + await().atMost(Duration.ofSeconds(30)) // + .pollInterval(Duration.ofSeconds(5)) // + .pollDelay(Duration.ofSeconds(5)) // .until(() -> NotificationHelper.areNotificationsAvailable(requestSpec, responseSpec)); } } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java index c343f25b200..c81a2f07e88 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java @@ -223,26 +223,29 @@ public void executeAndAwaitJob(T jobParam, Consumer } private void awaitJob(Instant beforeExecuteTime, Supplier>> retrieveLastRunHistory) { - final Duration timeout = Duration.ofMinutes(4); - final Duration pause = Duration.ofSeconds(2); + final Duration timeout = Duration.ofMinutes(2); + final Duration pause = Duration.ofSeconds(5); DateTimeFormatter df = DateTimeFormatter.ISO_INSTANT; // FINERACT-926 // Await JobDetailData.lastRunHistory [JobDetailHistoryData] // jobRunStartTime >= beforeExecuteTime (or timeout) // jobRunEndTime to be both set and >= jobRunStartTime (or timeout) - Map finalLastRunHistory = await().atMost(timeout).pollInterval(pause).until(retrieveLastRunHistory.get(), - lastRunHistory -> { - String jobRunStartText = lastRunHistory.get("jobRunStartTime"); - if (jobRunStartText == null) { - return false; - } - String jobRunEndText = lastRunHistory.get("jobRunEndTime"); - if (jobRunEndText == null) { - return false; - } - Instant jobRunStartTime = df.parse(jobRunStartText, Instant::from); - Instant jobRunEndTime = df.parse(jobRunEndText, Instant::from); - return !jobRunStartTime.isBefore(beforeExecuteTime) && !jobRunEndTime.isBefore(jobRunStartTime); - }); + Map finalLastRunHistory = await().atMost(timeout) // + .pollInterval(pause) // + .pollDelay(pause) // + .until(retrieveLastRunHistory.get(), // + lastRunHistory -> { + String jobRunStartText = lastRunHistory.get("jobRunStartTime"); + if (jobRunStartText == null) { + return false; + } + String jobRunEndText = lastRunHistory.get("jobRunEndTime"); + if (jobRunEndText == null) { + return false; + } + Instant jobRunStartTime = df.parse(jobRunStartText, Instant::from); + Instant jobRunEndTime = df.parse(jobRunEndText, Instant::from); + return !jobRunStartTime.isBefore(beforeExecuteTime) && !jobRunEndTime.isBefore(jobRunStartTime); + }); // Verify triggerType MatcherAssert.assertThat(finalLastRunHistory.get("triggerType"), is("application"));