You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/06/14 16:31:59 UTC
[fineract] 02/02: bulk auto reformat ca. 2900 files using ./gradlew
:spotlessApply [FINERACT-1006]
This is an automated email from the ASF dual-hosted git repository.
vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
commit 9da59323072506ec18992aff497dc3a35bac4d9a
Author: Michael Vorburger <mi...@vorburger.ch>
AuthorDate: Sun Jun 14 17:55:15 2020 +0200
bulk auto reformat ca. 2900 files using ./gradlew :spotlessApply [FINERACT-1006]
---
fineract-provider/build.gradle | 104 +-
fineract-provider/config/checkstyle/checkstyle.xml | 24 +-
fineract-provider/dependencies.gradle | 40 +-
.../properties/oauth/application.properties | 2 +-
.../AccountNumberPreferencesTest.java | 109 +-
.../integrationtests/AccountTransferTest.java | 28 +-
.../AccountingScenarioIntegrationTest.java | 111 +-
.../integrationtests/ActuatorIntegrationTest.java | 5 +-
.../fineract/integrationtests/BatchApiTest.java | 20 +-
.../BatchRequestsIntegrationTest.java | 5 +-
.../integrationtests/CenterIntegrationTest.java | 32 +-
.../ClientLoanIntegrationTest.java | 1515 +++---
.../ClientSavingsIntegrationTest.java | 616 +--
.../integrationtests/ClientStatusChecker.java | 16 +-
...ientUndoRejectAndWithdrawalIntegrationTest.java | 39 +-
.../ConcurrencyIntegrationTest.java | 12 +-
.../fineract/integrationtests/CurrenciesTest.java | 3 +-
.../integrationtests/CurrencyIntegrationTest.java | 1 -
.../DisbursalAndRepaymentScheduleTest.java | 696 ++-
.../ExternalServicesConfigurationTest.java | 9 +-
.../FinancialActivityAccountsTest.java | 14 +-
.../integrationtests/FixedDepositTest.java | 460 +-
...xibleSavingsInterestPostingIntegrationTest.java | 17 +-
.../integrationtests/FundsIntegrationTest.java | 100 +-
...restChargedFromDateSameAsDisbursalDateTest.java | 28 +-
.../integrationtests/GlobalConfigurationTest.java | 58 +-
.../integrationtests/GroupLoanIntegrationTest.java | 49 +-
.../GroupSavingsIntegrationTest.java | 49 +-
.../fineract/integrationtests/GroupTest.java | 5 +-
.../integrationtests/HookIntegrationTest.java | 13 +-
.../LoanApplicationApprovalTest.java | 26 +-
.../LoanApplicationUndoLastTrancheTest.java | 19 +-
.../LoanDisbursalDateValidationTest.java | 35 +-
.../LoanDisbursementDetailsIntegrationTest.java | 57 +-
.../LoanRepaymentRescheduleAtDisbursementTest.java | 34 +-
.../LoanRescheduleRequestTest.java | 55 +-
.../LoanReschedulingWithinCenterTest.java | 44 +-
...ithWaiveInterestAndWriteOffIntegrationTest.java | 19 +-
...mDaysBetweenDisbursalAndFirstRepaymentTest.java | 2 +-
.../integrationtests/NotificationApiTest.java | 3 +-
.../integrationtests/OfficeIntegrationTest.java | 11 +-
.../PasswordPreferencesIntegrationTest.java | 7 +-
.../fineract/integrationtests/RatesTest.java | 52 +-
.../integrationtests/RecurringDepositTest.java | 515 +-
.../fineract/integrationtests/RolesTest.java | 3 +-
.../integrationtests/SchedulerJobsTest.java | 11 +-
.../integrationtests/SchedulerJobsTestResults.java | 1509 +++---
.../SkipRepaymentOnMonthFirstTest.java | 45 +-
.../integrationtests/StaffImageApiTest.java | 4 +-
.../fineract/integrationtests/StaffTest.java | 6 +-
.../integrationtests/SurveyIntegrationTest.java | 2 +-
.../fineract/integrationtests/SystemCodeTest.java | 15 +-
.../integrationtests/TemplateIntegrationTest.java | 6 +-
.../integrationtests/UserAdministrationTest.java | 29 +-
.../integrationtests/XBRLIntegrationTest.java | 1 +
.../client/ClientEntityImportHandlerTest.java | 98 +-
.../importhandler/loan/LoanImportHandlerTest.java | 88 +-
.../office/OfficeImportHandlerTest.java | 52 +-
.../savings/SavingsImportHandlerTest.java | 89 +-
.../client/ClientEntityWorkbookPopulatorTest.java | 37 +-
.../populator/loan/LoanWorkbookPopulatorTest.java | 74 +-
.../office/OfficeWorkBookPopulatorTest.java | 21 +-
.../savings/SavingsWorkbookPopulateTest.java | 57 +-
.../integrationtests/common/BatchHelper.java | 15 +-
.../integrationtests/common/CalendarHelper.java | 17 +-
.../integrationtests/common/CenterDomain.java | 20 +-
.../integrationtests/common/CenterHelper.java | 32 +-
.../integrationtests/common/ClientChargesTest.java | 4 +-
.../integrationtests/common/ClientHelper.java | 223 +-
.../integrationtests/common/CommonConstants.java | 1 -
.../integrationtests/common/CurrenciesHelper.java | 7 +-
.../integrationtests/common/CurrencyDomain.java | 8 +-
.../ExternalServicesConfigurationHelper.java | 22 +-
.../common/GlobalConfigurationHelper.java | 74 +-
.../integrationtests/common/GroupHelper.java | 69 +-
.../integrationtests/common/HolidayHelper.java | 10 +-
.../integrationtests/common/HookHelper.java | 16 +-
.../integrationtests/common/ImageHelper.java | 4 +-
.../common/LoanRescheduleRequestHelper.java | 1 +
.../common/NotificationHelper.java | 3 +-
.../integrationtests/common/OfficeDomain.java | 33 +-
.../integrationtests/common/OfficeHelper.java | 50 +-
.../common/PasswordPreferencesHelper.java | 26 +-
.../integrationtests/common/PaymentTypeHelper.java | 42 +-
.../common/ProvisioningIntegrationTest.java | 135 +-
.../common/SchedulerJobHelper.java | 55 +-
.../common/StandingInstructionsHelper.java | 16 +-
.../integrationtests/common/SurveyHelper.java | 17 +-
.../common/TaxComponentHelper.java | 5 +-
.../integrationtests/common/TaxGroupHelper.java | 6 +-
.../fineract/integrationtests/common/Utils.java | 95 +-
.../integrationtests/common/WorkingDaysHelper.java | 8 +-
.../common/accounting/Account.java | 1 +
.../common/accounting/AccountHelper.java | 15 +-
.../accounting/FinancialActivityAccountHelper.java | 11 +-
.../common/accounting/JournalEntry.java | 1 +
.../common/charges/ChargesHelper.java | 99 +-
.../fixeddeposit/FixedDepositAccountHelper.java | 117 +-
.../FixedDepositAccountStatusChecker.java | 26 +-
.../fixeddeposit/FixedDepositProductHelper.java | 16 +-
.../integrationtests/common/funds/FundsHelper.java | 21 +-
.../common/funds/FundsResourceHandler.java | 21 +-
.../common/loans/LoanApplicationTestBuilder.java | 29 +-
.../common/loans/LoanDisbursementTestBuilder.java | 48 +-
.../common/loans/LoanProductTestBuilder.java | 26 +-
.../common/loans/LoanTransactionHelper.java | 238 +-
.../common/organisation/CampaignsHelper.java | 62 +-
.../common/organisation/Currency.java | 12 +-
.../common/organisation/CurrencyHelper.java | 17 +-
.../organisation/EntityDatatableChecksHelper.java | 13 +-
.../EntityDatatableChecksIntegrationTest.java | 1 +
.../common/organisation/StaffHelper.java | 39 +-
.../common/provisioning/ProvisioningHelper.java | 10 +-
.../ProvisioningTransactionHelper.java | 37 +-
.../integrationtests/common/rates/RatesHelper.java | 106 +-
.../RecurringDepositAccountHelper.java | 177 +-
.../RecurringDepositAccountStatusChecker.java | 28 +-
.../RecurringDepositProductHelper.java | 10 +-
.../integrationtests/common/report/ReportData.java | 4 +-
.../common/savings/AccountTransferHelper.java | 31 +-
.../common/savings/SavingsAccountHelper.java | 117 +-
.../savings/SavingsApplicationTestBuilder.java | 26 +-
.../common/savings/SavingsProductHelper.java | 11 +-
.../common/savings/SavingsStatusChecker.java | 56 +-
.../common/shares/DividendsIntegrationTests.java | 107 +-
.../common/shares/ShareAccountHelper.java | 103 +-
.../shares/ShareAccountIntegrationTests.java | 217 +-
.../shares/ShareAccountTransactionHelper.java | 4 +-
.../shares/ShareDividendsTransactionHelper.java | 25 +-
.../common/shares/ShareProductHelper.java | 140 +-
.../shares/ShareProductTransactionHelper.java | 8 +-
.../system/AccountNumberPreferencesHelper.java | 151 +-
.../AccountNumberPreferencesTestBuilder.java | 1 +
.../integrationtests/common/system/CodeHelper.java | 148 +-
.../common/system/DatatableHelper.java | 11 +-
.../interoperation/InteropHelper.java | 12 +-
.../interoperation/InteropTest.java | 40 +-
.../loanaccount/guarantor/GuarantorHelper.java | 4 +-
.../loanaccount/guarantor/GuarantorTest.java | 122 +-
.../guarantor/GuarantorTestBuilder.java | 3 +-
.../useradministration/roles/RolesHelper.java | 11 +-
.../useradministration/users/UserHelper.java | 55 +-
...VariableInstallmentsDecliningBalanceHelper.java | 42 +-
.../VariableInstallmentsFlatHelper.java | 29 +-
.../VariableInstallmentsIntegrationTest.java | 555 ++-
.../VariableIntallmentsTransactionHelper.java | 17 +-
.../org/apache/fineract/ServerApplication.java | 13 +-
.../accrual/api/AccrualAccountingApiResource.java | 17 +-
.../api/AccrualAccountingApiResourceSwagger.java | 2 +
.../ExecutePeriodicAccrualCommandHandler.java | 2 +-
.../AccrualAccountingDataValidator.java | 5 +-
.../AccrualAccountingWritePlatformServiceImpl.java | 3 +-
.../closure/api/GLClosureJsonInputParams.java | 3 +-
.../closure/api/GLClosuresApiResource.java | 45 +-
.../closure/api/GLClosuresApiResourceSwagger.java | 19 +-
.../closure/command/GLClosureCommand.java | 14 +-
.../accounting/closure/data/GLClosureData.java | 2 +-
.../accounting/closure/domain/GLClosure.java | 5 +-
.../exception/GLClosureDuplicateException.java | 7 +-
.../exception/GLClosureInvalidDeleteException.java | 2 +-
.../exception/GLClosureInvalidException.java | 7 +-
.../exception/GLClosureNotFoundException.java | 2 +-
.../handler/CreateGLClosureCommandHandler.java | 2 +-
.../handler/DeleteGLClosureCommandHandler.java | 2 +-
.../handler/UpdateGLClosureCommandHandler.java | 2 +-
.../GLClosureCommandFromApiJsonDeserializer.java | 2 +-
...osureWritePlatformServiceJpaRepositoryImpl.java | 22 +-
.../accounting/common/AccountingConstants.java | 110 +-
.../AccountingDropdownReadPlatformService.java | 2 +-
.../AccountingDropdownReadPlatformServiceImpl.java | 2 +-
.../accounting/common/AccountingRuleType.java | 2 +-
.../api/FinancialActivityAccountsApiResource.java | 40 +-
...inancialActivityAccountsApiResourceSwagger.java | 35 +-
.../api/FinancialActivityAccountsConstants.java | 6 +-
.../FinancialActivityAccountsJsonInputParams.java | 3 +-
.../data/FinancialActivityAccountData.java | 3 +-
.../domain/FinancialActivityAccount.java | 2 +-
.../domain/FinancialActivityAccountRepository.java | 4 +-
.../FinancialActivityAccountRepositoryWrapper.java | 3 +-
...cateFinancialActivityAccountFoundException.java | 2 +-
.../FinancialActivityAccountInvalidException.java | 14 +-
.../FinancialActivityAccountNotFoundException.java | 7 +-
.../CreateFinancialActivityAccountHandler.java | 2 +-
...leteFinancialActivityAccountCommandHandler.java | 2 +-
...dateFinancialActivityAccountCommandHandler.java | 2 +-
.../FinancialActivityAccountDataValidator.java | 8 +-
...inancialActivityAccountReadPlatformService.java | 2 +-
...cialActivityAccountReadPlatformServiceImpl.java | 3 +-
...nancialActivityAccountWritePlatformService.java | 2 +-
...ialActivityAccountWritePlatformServiceImpl.java | 25 +-
.../glaccount/api/GLAccountJsonInputParams.java | 7 +-
.../glaccount/api/GLAccountsApiResource.java | 109 +-
.../api/GLAccountsApiResourceSwagger.java | 41 +-
.../glaccount/command/GLAccountCommand.java | 14 +-
.../accounting/glaccount/data/GLAccountData.java | 22 +-
.../accounting/glaccount/domain/GLAccount.java | 4 +-
.../domain/GLAccountRepositoryWrapper.java | 2 +-
.../accounting/glaccount/domain/GLAccountType.java | 34 +-
.../accounting/glaccount/domain/TrialBalance.java | 25 +-
.../glaccount/domain/TrialBalanceRepository.java | 5 +-
.../domain/TrialBalanceRepositoryWrapper.java | 17 +-
.../exception/GLAccountDisableException.java | 6 +-
.../exception/GLAccountDuplicateException.java | 2 +-
.../GLAccountInvalidClassificationException.java | 2 +-
.../exception/GLAccountInvalidDeleteException.java | 11 +-
.../exception/GLAccountInvalidParentException.java | 6 +-
.../exception/GLAccountInvalidUpdateException.java | 11 +-
.../exception/GLAccountInvalidUsageException.java | 2 +-
.../exception/GLAccountNotFoundException.java | 2 +-
.../handler/CreateGLAccountCommandHandler.java | 2 +-
.../handler/DeleteGLAccountCommandHandler.java | 2 +-
.../handler/UpdateGLAccountCommandHandler.java | 2 +-
.../GLAccountCommandFromApiJsonDeserializer.java | 6 +-
.../service/GLAccountReadPlatformService.java | 2 +-
.../service/GLAccountReadPlatformServiceImpl.java | 20 +-
...countWritePlatformServiceJpaRepositoryImpl.java | 52 +-
.../api/JournalEntriesApiResource.java | 115 +-
.../api/JournalEntriesApiResourceSwagger.java | 10 +-
.../api/JournalEntryJsonInputParams.java | 12 +-
.../journalentry/command/JournalEntryCommand.java | 8 +-
.../command/SingleDebitOrCreditEntryCommand.java | 2 +-
.../accounting/journalentry/data/CreditDebit.java | 1 +
.../journalentry/data/JournalEntryData.java | 58 +-
.../data/JournalEntryDataValidator.java | 6 +-
.../journalentry/data/LoanTransactionDTO.java | 12 +-
.../journalentry/data/TransactionTypeEnumData.java | 2 +-
.../journalentry/domain/JournalEntry.java | 4 +-
.../domain/JournalEntryRepository.java | 24 +-
.../exception/JournalEntriesNotFoundException.java | 7 +-
.../exception/JournalEntryInvalidException.java | 11 +-
.../exception/JournalEntryNotFoundException.java | 7 +-
.../exception/JournalEntryRuntimeException.java | 1 -
.../handler/CreateJournalEntryCommandHandler.java | 2 +-
.../handler/ReverseJournalEntryCommandHandler.java | 2 +-
...JournalEntryCommandFromApiJsonDeserializer.java | 13 +-
.../service/AccountingProcessorHelper.java | 188 +-
.../AccrualBasedAccountingProcessorForLoan.java | 59 +-
.../CashBasedAccountingProcessorForLoan.java | 66 +-
.../CashBasedAccountingProcessorForSavings.java | 61 +-
.../CashBasedAccountingProcessorForShares.java | 10 +-
.../service/JournalEntryReadPlatformService.java | 2 +-
.../JournalEntryReadPlatformServiceImpl.java | 51 +-
...ournalEntryRunningBalanceUpdateServiceImpl.java | 54 +-
.../service/JournalEntryWritePlatformService.java | 4 +-
...EntryWritePlatformServiceJpaRepositoryImpl.java | 113 +-
.../domain/PortfolioProductType.java | 1 +
.../domain/ProductToGLAccountMapping.java | 15 +-
.../ProductToGLAccountMappingRepository.java | 21 +-
.../ProductToGLAccountMappingInvalidException.java | 9 +-
...ProductToGLAccountMappingNotFoundException.java | 2 +-
...tToGLAccountMappingFromApiJsonDeserializer.java | 173 +-
.../LoanProductToGLAccountMappingHelper.java | 102 +-
.../service/ProductToGLAccountMappingHelper.java | 83 +-
...oductToGLAccountMappingReadPlatformService.java | 2 +-
...tToGLAccountMappingReadPlatformServiceImpl.java | 20 +-
...ductToGLAccountMappingWritePlatformService.java | 2 +-
...ToGLAccountMappingWritePlatformServiceImpl.java | 34 +-
.../SavingsProductToGLAccountMappingHelper.java | 51 +-
.../ShareProductToGLAccountMappingHelper.java | 33 +-
.../api/ProvisioningEntriesApiResource.java | 52 +-
.../api/ProvisioningEntriesApiResourceSwagger.java | 15 +-
.../constant/ProvisioningEntriesApiConstants.java | 8 +-
.../data/LoanProductProvisioningEntryData.java | 64 +-
.../provisioning/data/ProvisioningEntryData.java | 48 +-
.../domain/LoanProductProvisioningEntry.java | 66 +-
.../provisioning/domain/ProvisioningEntry.java | 25 +-
.../domain/ProvisioningEntryRepository.java | 4 +-
.../NoProvisioningCriteriaDefinitionFound.java | 1 -
.../ProvisioningEntryAlreadyCreatedException.java | 4 +-
.../ProvisioningEntryNotfoundException.java | 1 -
...teProvisioningEntriesRequestCommandHandler.java | 5 +-
...sioningJournalEntriesRequestCommandHandler.java | 5 +-
...eateProvisioningEntryRequestCommandHandler.java | 7 +-
...visioningEntriesDefinitionJsonDeserializer.java | 17 +-
.../ProvisioningEntriesReadPlatformService.java | 15 +-
...ProvisioningEntriesReadPlatformServiceImpl.java | 22 +-
.../ProvisioningEntriesWritePlatformService.java | 5 +-
...triesWritePlatformServiceJpaRepositoryImpl.java | 45 +-
.../rule/api/AccountingRuleApiResource.java | 81 +-
.../rule/api/AccountingRuleApiResourceSwagger.java | 18 +-
.../rule/api/AccountingRuleJsonInputParams.java | 6 +-
.../accounting/rule/data/AccountingRuleData.java | 2 +-
.../accounting/rule/domain/AccountingRule.java | 11 +-
.../accounting/rule/domain/AccountingTagRule.java | 3 +-
.../exception/AccountingRuleDataException.java | 4 +-
.../AccountingRuleDuplicateException.java | 2 +-
.../AccountingRuleInvalidDeleteException.java | 2 +-
.../exception/AccountingRuleInvalidException.java | 7 +-
.../exception/AccountingRuleNotFoundException.java | 2 +-
.../CreateAccountingRuleCommandHandler.java | 2 +-
.../DeleteAccountingRuleCommandHandler.java | 2 +-
.../UpdateAccountingRuleCommandHandler.java | 2 +-
...countingRuleCommandFromApiJsonDeserializer.java | 36 +-
.../AccountingRuleReadPlatformServiceImpl.java | 19 +-
...gRuleWritePlatformServiceJpaRepositoryImpl.java | 13 +-
.../exception/TrialBalanceNotFoundException.java | 8 +-
.../fineract/adhocquery/api/AdHocApiResource.java | 26 +-
.../adhocquery/api/AdHocJsonInputParams.java | 9 +-
.../apache/fineract/adhocquery/data/AdHocData.java | 46 +-
.../apache/fineract/adhocquery/domain/AdHoc.java | 41 +-
.../adhocquery/domain/ReportRunFrequency.java | 15 +-
.../exception/AdHocNotFoundException.java | 5 +-
.../handler/CreateAdHocCommandHandler.java | 2 +-
.../handler/DeleteAdHocCommandHandler.java | 2 +-
.../handler/UpdateAdHocCommandHandler.java | 2 +-
.../adhocquery/service/AdHocDataValidator.java | 23 +-
.../service/AdHocReadPlatformService.java | 3 +-
.../service/AdHocReadPlatformServiceImpl.java | 24 +-
.../service/AdHocScheduledJobRunnerService.java | 1 +
.../AdHocScheduledJobRunnerServiceImpl.java | 32 +-
.../service/AdHocWritePlatformService.java | 2 +-
...AdHocWritePlatformServiceJpaRepositoryImpl.java | 8 +-
.../fineract/batch/api/BatchApiResource.java | 29 +-
.../batch/api/BatchApiResourceSwagger.java | 7 +-
.../fineract/batch/command/CommandContext.java | 35 +-
.../batch/command/CommandStrategyProvider.java | 20 +-
.../internal/ActivateClientCommandStrategy.java | 9 +-
.../command/internal/ApplyLoanCommandStrategy.java | 8 +-
.../internal/ApplySavingsCommandStrategy.java | 10 +-
.../internal/ApproveLoanCommandStrategy.java | 20 +-
.../ApproveLoanRescheduleCommandStrategy.java | 3 +-
.../internal/CollectChargesCommandStrategy.java | 8 +-
.../internal/CreateChargeCommandStrategy.java | 13 +-
.../internal/CreateClientCommandStrategy.java | 4 +-
.../internal/DisburseLoanCommandStrategy.java | 18 +-
.../command/internal/RepayLoanCommandStrategy.java | 11 +-
.../exception/ClientDetailsNotFoundException.java | 2 +-
.../fineract/batch/exception/ErrorHandler.java | 15 +-
.../serialization/BatchRequestJsonHelper.java | 4 +-
.../fineract/batch/service/BatchApiService.java | 10 +-
.../batch/service/BatchApiServiceImpl.java | 61 +-
.../fineract/batch/service/ResolutionHelper.java | 4 +-
.../fineract/commands/annotation/CommandType.java | 3 +-
.../fineract/commands/api/AuditsApiResource.java | 65 +-
.../commands/api/MakercheckersApiResource.java | 53 +-
.../api/MakercheckersApiResourceSwagger.java | 14 +-
.../apache/fineract/commands/data/AuditData.java | 6 +-
.../fineract/commands/data/AuditSearchData.java | 2 +-
.../commands/data/ProcessingResultLookup.java | 2 +-
.../domain/CommandProcessingResultType.java | 2 +-
.../fineract/commands/domain/CommandSource.java | 13 +-
.../commands/domain/CommandSourceRepository.java | 2 +-
.../fineract/commands/domain/CommandWrapper.java | 30 +-
.../CommandNotAwaitingApprovalException.java | 2 +-
.../exception/CommandNotFoundException.java | 2 +-
.../exception/UnsupportedCommandException.java | 2 +-
.../commands/handler/NewCommandSourceHandler.java | 2 +-
.../commands/provider/CommandHandlerProvider.java | 30 +-
.../commands/service/AuditReadPlatformService.java | 2 +-
.../service/AuditReadPlatformServiceImpl.java | 21 +-
.../commands/service/CommandProcessingService.java | 4 +-
.../commands/service/CommandWrapperBuilder.java | 84 +-
...PortfolioCommandSourceWritePlatformService.java | 2 +-
...folioCommandSourceWritePlatformServiceImpl.java | 10 +-
.../SynchronousCommandProcessingService.java | 7 +-
.../api/AccountNumberFormatsApiResource.java | 68 +-
.../AccountNumberFormatsApiResourceSwagger.java | 20 +-
.../data/AccountNumberFormatDataValidator.java | 43 +-
.../domain/AccountNumberFormat.java | 5 +-
.../domain/AccountNumberFormatEnumerations.java | 33 +-
.../domain/AccountNumberFormatRepository.java | 4 +-
.../AccountNumberFormatRepositoryWrapper.java | 3 +-
.../domain/EntityAccountType.java | 9 +-
.../AccountNumberFormatNotFoundException.java | 4 +-
...AccountNumberFormatReadPlatformServiceImpl.java | 4 +-
...ormatWritePlatformServiceJpaRepositoryImpl.java | 7 +-
.../bulkimport/api/BulkImportApiResource.java | 36 +-
.../bulkimport/constants/CenterConstants.java | 40 +-
.../constants/ChartOfAcountsConstants.java | 33 +-
.../constants/ClientEntityConstants.java | 76 +-
.../constants/ClientPersonConstants.java | 73 +-
.../bulkimport/constants/GroupConstants.java | 46 +-
.../bulkimport/constants/GuarantorConstants.java | 20 +-
.../constants/JournalEntryConstants.java | 2 +-
.../bulkimport/constants/LoanConstants.java | 100 +-
.../constants/LoanRepaymentConstants.java | 48 +-
.../bulkimport/constants/OfficeConstants.java | 10 +-
.../constants/RecurringDepositConstants.java | 1 -
.../bulkimport/constants/SavingsConstants.java | 2 +-
.../constants/SharedAccountsConstants.java | 44 +-
.../bulkimport/constants/StaffConstants.java | 18 +-
.../constants/TemplatePopulateImportConstants.java | 238 +-
.../bulkimport/constants/UserConstants.java | 23 +-
.../bulkimport/data/BulkImportEvent.java | 10 +-
.../infrastructure/bulkimport/data/Count.java | 10 +-
.../bulkimport/data/GlobalEntityType.java | 57 +-
.../infrastructure/bulkimport/data/ImportData.java | 28 +-
.../bulkimport/data/ImportFormatType.java | 19 +-
.../bulkimport/domain/ImportDocument.java | 23 +-
.../domain/ImportDocumentRepository.java | 3 +-
.../exceptions/ImportTypeNotFoundException.java | 2 +-
.../bulkimport/importhandler/ImportHandler.java | 2 +-
.../importhandler/ImportHandlerUtils.java | 270 +-
.../importhandler/center/CenterImportHandler.java | 130 +-
.../ChartOfAccountsImportHandler.java | 94 +-
.../client/ClientEntityImportHandler.java | 112 +-
.../client/ClientPersonImportHandler.java | 108 +-
.../fixeddeposits/FixedDepositImportHandler.java | 202 +-
.../FixedDepositTransactionImportHandler.java | 74 +-
.../importhandler/group/GroupImportHandler.java | 160 +-
.../guarantor/GuarantorImportHandler.java | 77 +-
.../importhandler/helper/ClientIdSerializer.java | 8 +-
.../helper/CodeValueDataIdSerializer.java | 1 +
.../helper/CurrencyDateCodeSerializer.java | 3 +-
.../importhandler/helper/DateSerializer.java | 2 +-
.../helper/EnumOptionDataIdSerializer.java | 1 +
.../helper/EnumOptionDataValueSerializer.java | 1 +
.../importhandler/helper/GroupIdSerializer.java | 7 +-
.../journalentry/JournalEntriesImportHandler.java | 182 +-
.../importhandler/loan/LoanImportHandler.java | 277 +-
.../loanrepayment/LoanRepaymentImportHandler.java | 69 +-
.../importhandler/office/OfficeImportHandler.java | 52 +-
.../RecurringDepositImportHandler.java | 160 +-
.../RecurringDepositTransactionImportHandler.java | 81 +-
.../savings/SavingsImportHandler.java | 194 +-
.../savings/SavingsTransactionImportHandler.java | 72 +-
.../sharedaccount/SharedAccountImportHandler.java | 112 +-
.../importhandler/staff/StaffImportHandler.java | 71 +-
.../importhandler/users/UserImportHandler.java | 68 +-
.../populator/AbstractWorkbookPopulator.java | 187 +-
.../bulkimport/populator/CenterSheetPopulator.java | 23 +-
.../bulkimport/populator/ClientSheetPopulator.java | 14 +-
.../bulkimport/populator/ExtrasSheetPopulator.java | 12 +-
.../FixedDepositProductSheetPopulator.java | 117 +-
.../populator/GlAccountSheetPopulator.java | 5 +-
.../bulkimport/populator/GroupSheetPopulator.java | 45 +-
.../populator/LoanProductSheetPopulator.java | 16 +-
.../bulkimport/populator/OfficeSheetPopulator.java | 79 +-
.../populator/PersonnelSheetPopulator.java | 161 +-
.../RecurringDepositProductSheetPopulator.java | 130 +-
.../bulkimport/populator/RoleSheetPopulator.java | 12 +-
.../populator/SavingsAccountSheetPopulator.java | 50 +-
.../populator/SavingsProductSheetPopulator.java | 19 +-
.../populator/SharedProductsSheetPopulator.java | 106 +-
.../bulkimport/populator/WorkbookPopulator.java | 4 +-
.../centers/CentersWorkbookPopulator.java | 158 +-
.../chartofaccounts/ChartOfAccountsWorkbook.java | 264 +-
.../client/ClientEntityWorkbookPopulator.java | 399 +-
.../client/ClientPersonWorkbookPopulator.java | 597 ++-
.../comparator/LoanComparatorByStatusActive.java | 18 +-
.../FixedDepositTransactionWorkbookPopulator.java | 124 +-
.../FixedDepositWorkbookPopulator.java | 311 +-
.../populator/group/GroupsWorkbookPopulator.java | 170 +-
.../guarantor/GuarantorWorkbookPopulator.java | 329 +-
.../JournalEntriesWorkbookPopulator.java | 137 +-
.../populator/loan/LoanWorkbookPopulator.java | 329 +-
.../LoanRepaymentWorkbookPopulator.java | 141 +-
.../populator/office/OfficeWorkbookPopulator.java | 81 +-
...curringDepositTransactionWorkbookPopulator.java | 137 +-
.../RecurringDepositWorkbookPopulator.java | 281 +-
.../SavingsTransactionsWorkbookPopulator.java | 124 +-
.../savings/SavingsWorkbookPopulator.java | 242 +-
.../SharedAccountWorkBookPopulator.java | 241 +-
.../populator/staff/StaffWorkbookPopulator.java | 83 +-
.../populator/users/UserWorkbookPopulator.java | 94 +-
.../service/BulkImportEventListener.java | 100 +-
.../BulkImportWorkbookPopulatorService.java | 4 +-
.../BulkImportWorkbookPopulatorServiceImpl.java | 543 ++-
.../service/BulkImportWorkbookService.java | 5 +-
.../service/BulkImportWorkbookServiceImpl.java | 140 +-
.../cache/PlatformCacheConfiguration.java | 4 +-
.../infrastructure/cache/api/CacheApiResource.java | 19 +-
.../cache/api/CacheApiResourceSwagger.java | 12 +-
.../cache/command/UpdateCacheCommandHandler.java | 5 +-
.../infrastructure/cache/data/CacheData.java | 2 +-
.../infrastructure/cache/domain/CacheType.java | 2 +-
.../infrastructure/cache/domain/PlatformCache.java | 2 +-
.../cache/domain/PlatformCacheRepository.java | 2 +-
.../cache/service/CacheWritePlatformService.java | 2 +-
...CacheWritePlatformServiceJpaRepositoryImpl.java | 2 +-
.../service/RuntimeDelegatingCacheManager.java | 2 +-
.../campaigns/constants/CampaignType.java | 4 +-
.../campaigns/email/EmailApiConstants.java | 6 +-
.../campaigns/email/ScheduledEmailConstants.java | 26 +-
.../campaigns/email/api/EmailApiResource.java | 2 +-
.../email/api/EmailCampaignApiResource.java | 61 +-
.../email/api/EmailConfigurationApiResource.java | 14 +-
.../email/data/EmailBusinessRulesData.java | 23 +-
.../campaigns/email/data/EmailCampaignData.java | 49 +-
.../email/data/EmailCampaignTimeLine.java | 5 +-
.../email/data/EmailCampaignValidator.java | 83 +-
.../email/data/EmailConfigurationData.java | 1 +
.../email/data/EmailConfigurationValidator.java | 27 +-
.../campaigns/email/data/EmailData.java | 40 +-
.../campaigns/email/data/EmailDataValidator.java | 146 +-
.../email/data/EmailMessageWithAttachmentData.java | 18 +-
.../email/data/ScheduledEmailEnumerations.java | 5 +-
.../campaigns/email/domain/EmailCampaign.java | 148 +-
.../email/domain/EmailCampaignRepository.java | 3 +-
.../email/domain/EmailCampaignStatus.java | 15 +-
.../domain/EmailCampaignStatusEnumerations.java | 21 +-
.../campaigns/email/domain/EmailCampaignType.java | 12 +-
.../campaigns/email/domain/EmailConfiguration.java | 1 +
.../email/domain/EmailConfigurationRepository.java | 4 +-
.../campaigns/email/domain/EmailMessage.java | 50 +-
.../email/domain/EmailMessageAssembler.java | 9 +-
.../email/domain/EmailMessageEnumerations.java | 6 +-
.../email/domain/EmailMessageRepository.java | 3 +-
.../email/domain/EmailMessageStatusType.java | 6 +-
.../domain/ScheduledEmailAttachmentFileFormat.java | 23 +-
...cheduledEmailStretchyReportParamDateOption.java | 24 +-
.../email/exception/EmailBusinessRuleNotFound.java | 3 +-
...ilCampaignMustBeClosedToBeDeletedException.java | 5 +-
.../EmailCampaignMustBeClosedToEditException.java | 1 -
.../email/exception/EmailCampaignNotFound.java | 5 +-
.../EmailConfigurationSMTPUsernameNotValid.java | 7 +-
.../email/exception/EmailNotFoundException.java | 2 +-
.../ActivateEmailCampaignCommandHandler.java | 1 +
.../handler/CloseEmailCampaignCommandHandler.java | 5 +-
.../email/handler/CreateEmailCommandHandler.java | 2 +-
.../handler/DeleteEmailCampaignCommandHandler.java | 3 +-
.../email/handler/DeleteEmailCommandHandler.java | 2 +-
.../ReactivateEmailCampaignCommandHandler.java | 3 +-
.../handler/UpdateEmailCampaignCommandHandler.java | 4 +-
.../EmailCampaignReadPlatformServiceImpl.java | 91 +-
...ailCampaignWritePlatformCommandHandlerImpl.java | 9 +-
.../EmailConfigurationReadPlatformServiceImpl.java | 14 +-
.../EmailConfigurationWritePlatformService.java | 1 -
...EmailConfigurationWritePlatformServiceImpl.java | 45 +-
.../email/service/EmailMessageJobEmailService.java | 1 -
.../service/EmailMessageJobEmailServiceImpl.java | 35 +-
.../service/EmailReadPlatformServiceImpl.java | 28 +-
.../email/service/EmailWritePlatformService.java | 2 +-
...EmailWritePlatformServiceJpaRepositoryImpl.java | 11 +-
.../campaigns/helper/SmsConfigUtils.java | 20 +-
.../campaigns/sms/api/SmsCampaignApiResource.java | 22 +-
.../sms/constants/SmsCampaignEnumerations.java | 16 +-
.../sms/constants/SmsCampaignTriggerType.java | 1 +
.../campaigns/sms/data/SmsBusinessRulesData.java | 12 +-
.../campaigns/sms/data/SmsCampaignData.java | 25 +-
.../campaigns/sms/data/SmsProviderData.java | 4 +-
.../campaigns/sms/domain/SmsCampaign.java | 32 +-
.../sms/domain/SmsCampaignRepository.java | 5 +-
.../sms/domain/SmsCampaignStatusEnumerations.java | 22 +-
.../sms/exception/ConnectionFailureException.java | 4 +-
...msCampaignMustBeClosedToBeDeletedException.java | 5 +-
.../sms/exception/SmsCampaignNotFound.java | 5 +-
.../handler/CloseSmsCampaignCommandHandler.java | 5 +-
.../handler/DeleteSmsCampaignCommandHandler.java | 3 +-
.../ReactivateSmsCampaignCommandHandler.java | 3 +-
.../sms/serialization/SmsCampaignValidator.java | 25 +-
.../sms/service/SmsCampaignDomainService.java | 3 +-
.../sms/service/SmsCampaignDomainServiceImpl.java | 246 +-
...SmsCampaignDropdownReadPlatformServiceImpl.java | 35 +-
.../SmsCampaignReadPlatformServiceImpl.java | 9 +-
.../service/SmsCampaignWritePlatformService.java | 4 +-
.../SmsCampaignWritePlatformServiceJpaImpl.java | 142 +-
.../infrastructure/codes/CodeConstants.java | 5 +-
.../codes/api/CodeValuesApiResource.java | 55 +-
.../codes/api/CodeValuesApiResourceSwagger.java | 18 +-
.../infrastructure/codes/api/CodesApiResource.java | 29 +-
.../codes/api/CodesApiResourceSwagger.java | 18 +-
.../infrastructure/codes/data/CodeData.java | 2 +-
.../infrastructure/codes/data/CodeValueData.java | 23 +-
.../fineract/infrastructure/codes/domain/Code.java | 2 +-
.../codes/domain/CodeRepository.java | 2 +-
.../infrastructure/codes/domain/CodeValue.java | 10 +-
.../codes/domain/CodeValueRepository.java | 2 +-
.../codes/exception/CodeNotFoundException.java | 2 +-
.../exception/CodeValueNotFoundException.java | 10 +-
.../codes/handler/CreateCodeCommandHandler.java | 2 +-
.../handler/CreateCodeValueCommandHandler.java | 2 +-
.../codes/handler/DeleteCodeCommandHandler.java | 2 +-
.../handler/DeleteCodeValueCommandHandler.java | 2 +-
.../codes/handler/UpdateCodeCommandHandler.java | 2 +-
.../handler/UpdateCodeValueCommandHandler.java | 2 +-
.../CodeCommandFromApiJsonDeserializer.java | 8 +-
.../CodeValueCommandFromApiJsonDeserializer.java | 17 +-
.../codes/service/CodeReadPlatformServiceImpl.java | 2 +-
.../service/CodeValueReadPlatformService.java | 2 +-
.../service/CodeValueWritePlatformService.java | 2 +-
...ValueWritePlatformServiceJpaRepositoryImpl.java | 15 +-
.../codes/service/CodeWritePlatformService.java | 2 +-
.../CodeWritePlatformServiceJpaRepositoryImpl.java | 11 +-
.../ExternalServiceConfigurationApiConstant.java | 3 +-
.../ExternalServicesConfigurationApiResource.java | 25 +-
...nalServicesConfigurationApiResourceSwagger.java | 5 +-
.../api/GlobalConfigurationApiResource.java | 45 +-
.../api/GlobalConfigurationApiResourceSwagger.java | 18 +-
.../command/UpdateGlobalConfigurationCommand.java | 2 +-
.../data/GlobalConfigurationData.java | 2 +-
.../data/GlobalConfigurationDataValidator.java | 22 +-
.../data/GlobalConfigurationPropertyData.java | 8 +-
.../configuration/data/SMTPCredentialsData.java | 7 +-
.../domain/ConfigurationDomainService.java | 2 +-
.../domain/ConfigurationDomainServiceJpa.java | 20 +-
.../configuration/domain/ExternalService.java | 3 +-
.../domain/ExternalServicePropertiesPK.java | 12 +-
.../domain/ExternalServicesProperties.java | 1 +
.../ExternalServicesPropertiesRepository.java | 5 +-
...xternalServicesPropertiesRepositoryWrapper.java | 7 +-
.../domain/GlobalConfigurationProperty.java | 15 +-
.../domain/GlobalConfigurationRepository.java | 6 +-
.../GlobalConfigurationRepositoryWrapper.java | 3 +-
...GlobalConfigurationPropertyCannotBeModfied.java | 5 +-
...obalConfigurationPropertyNotFoundException.java | 2 +-
.../UpdateGlobalConfigurationCommandHandler.java | 2 +-
...onfigurationCommandFromApiJsonDeserializer.java | 6 +-
.../service/ConfigurationReadPlatformService.java | 2 +-
.../ConfigurationReadPlatformServiceImpl.java | 8 +-
.../service/ExternalServicesConstants.java | 8 +-
...ernalServicesPropertiesReadPlatformService.java | 2 +-
...lServicesPropertiesReadPlatformServiceImpl.java | 13 +-
.../GlobalConfigurationWritePlatformService.java | 3 +-
...ationWritePlatformServiceJpaRepositoryImpl.java | 13 +-
.../core/api/ApiParameterHelper.java | 3 +-
.../core/api/ApiRequestParameterHelper.java | 2 +-
.../infrastructure/core/api/DateAdapter.java | 7 +-
.../core/api/JodaLocalDateAdapter.java | 6 +-
.../core/api/JodaMonthDayAdapter.java | 6 +-
.../infrastructure/core/api/JsonCommand.java | 42 +-
.../core/api/ParameterListExclusionStrategy.java | 2 +-
.../core/api/ParameterListInclusionStrategy.java | 2 +-
.../boot/AbstractApplicationConfiguration.java | 15 +-
.../core/boot/ApplicationExitUtil.java | 5 +-
.../infrastructure/core/boot/JDBCDriverConfig.java | 7 +-
.../core/boot/WebFrontEndConfiguration.java | 15 +-
.../core/boot/WebTwoFactorXmlConfiguration.java | 4 +-
.../core/boot/WebXmlConfiguration.java | 4 +-
.../core/boot/WebXmlOauthConfiguration.java | 11 +-
.../core/data/ApiErrorMessageArg.java | 2 +-
.../core/data/ApiGlobalErrorResponse.java | 6 +-
.../core/data/ApiParameterError.java | 7 +-
.../core/data/CommandProcessingResult.java | 25 +-
.../core/data/CommandProcessingResultBuilder.java | 6 +-
.../core/data/DataValidatorBuilder.java | 94 +-
.../infrastructure/core/data/EnumOptionData.java | 14 +-
.../core/data/PaginationParameters.java | 2 +-
.../data/PaginationParametersDataValidator.java | 37 +-
.../core/domain/AbstractAuditableCustom.java | 7 +-
.../core/domain/AbstractPersistableCustom.java | 13 +-
.../core/domain/Base64EncodedImage.java | 2 +-
.../infrastructure/core/domain/EmailDetail.java | 2 +-
.../core/domain/FineractPlatformTenant.java | 6 +-
.../domain/FineractPlatformTenantConnection.java | 16 +-
.../infrastructure/core/domain/JdbcSupport.java | 2 +
.../core/domain/LocalDateInterval.java | 2 +-
.../core/domain/MySQLDictionaryCustom.java | 32 +-
.../infrastructure/core/domain/Tenant.java | 2 +-
.../AbstractPlatformDomainRuleException.java | 2 +-
.../AbstractPlatformResourceNotFoundException.java | 2 +-
...bstractPlatformServiceUnavailableException.java | 2 +-
.../GeneralPlatformDomainRuleException.java | 2 +-
.../core/exception/InvalidJsonException.java | 2 +-
.../core/exception/MultiException.java | 20 +-
.../PlatformApiDataValidationException.java | 2 +-
.../exception/PlatformDataIntegrityException.java | 2 +-
.../exception/PlatformInternalServerException.java | 2 +-
.../exception/UnrecognizedQueryParamException.java | 2 +-
.../exception/UnsupportedParameterException.java | 2 +-
.../AccessDeniedExceptionMapper.java | 2 +-
.../BadCredentialsExceptionMapper.java | 2 +-
.../InvalidJsonExceptionMapper.java | 2 +-
.../InvalidTenantIdentifierExceptionMapper.java | 2 +-
.../exceptionmapper/JsonSyntaxExceptionMapper.java | 2 +-
.../MalformedJsonExceptionMapper.java | 2 +-
.../NoAuthorizationExceptionMapper.java | 2 +-
.../PlatformApiDataValidationExceptionMapper.java | 6 +-
.../PlatformDataIntegrityExceptionMapper.java | 7 +-
.../PlatformDomainRuleExceptionMapper.java | 2 +-
.../PlatformInternalServerExceptionMapper.java | 2 +-
.../PlatformResourceNotFoundExceptionMapper.java | 2 +-
.../UnAuthenticatedUserExceptionMapper.java | 2 +-
.../UnrecognizedQueryParamExceptionMapper.java | 6 +-
.../UnsupportedCommandExceptionMapper.java | 10 +-
.../UnsupportedParameterExceptionMapper.java | 10 +-
.../core/filters/ResponseCorsFilter.java | 5 +-
.../AbstractFromApiJsonDeserializer.java | 2 +-
.../AbstractFromCommandJsonDeserializer.java | 2 +-
.../ApiRequestJsonSerializationSettings.java | 2 +-
.../CommandProcessingResultJsonSerializer.java | 2 +-
.../core/serialization/CommandSerializer.java | 2 +-
.../CommandSerializerDefaultToJson.java | 2 +-
.../DatatableCommandFromApiJsonDeserializer.java | 32 +-
.../serialization/DefaultToApiJsonSerializer.java | 8 +-
...hPrettyPrintingOffJsonSerializerGoogleGson.java | 2 +-
...thPrettyPrintingOnJsonSerializerGoogleGson.java | 2 +-
.../serialization/FromApiJsonDeserializer.java | 2 +-
.../serialization/FromCommandJsonDeserializer.java | 2 +-
.../core/serialization/FromJsonHelper.java | 5 +-
.../serialization/GoogleGsonSerializerHelper.java | 7 +-
.../core/serialization/JsonParserHelper.java | 91 +-
.../core/serialization/ToApiJsonSerializer.java | 2 +-
...AbandonedConnectionCleanupShutdownListener.java | 19 +-
.../infrastructure/core/service/DateUtils.java | 4 +-
.../service/GmailBackedPlatformEmailService.java | 21 +-
.../fineract/infrastructure/core/service/Page.java | 2 +-
.../core/service/PlatformEmailService.java | 3 +-
.../core/service/RoutingDataSource.java | 2 +-
.../core/service/RoutingDataSourceService.java | 2 +-
.../core/service/SearchParameters.java | 33 +-
.../core/service/TenantDatabaseUpgradeService.java | 93 +-
.../core/service/ThreadLocalContextUtil.java | 2 +-
.../TomcatJdbcDataSourcePerTenantService.java | 21 +-
.../api/CreditBureauConfigurationAPI.java | 37 +-
.../data/CreditBureauConfigurationData.java | 9 +-
.../creditbureau/data/CreditBureauData.java | 11 +-
.../data/CreditBureauLoanProductMappingData.java | 17 +-
.../creditbureau/data/CreditBureauProduct.java | 3 +-
.../data/OrganisationCreditBureauData.java | 14 +-
.../creditbureau/domain/CreditBureau.java | 1 -
.../domain/CreditBureauConfiguration.java | 1 +
.../domain/CreditBureauLoanProductMapping.java | 49 +-
.../domain/CreditBureauRepository.java | 4 +-
.../domain/OrganisationCreditBureau.java | 2 -
...editBureauLoanProductMappingCommandHandler.java | 3 +-
...editBureauLoanProductMappingCommandHandler.java | 3 +-
...CreditBureauCommandFromApiJsonDeserializer.java | 33 +-
...uLoanProductCommandFromApiJsonDeserializer.java | 89 +-
...uLoanProductMappingReadPlatformServiceImpl.java | 5 +-
...LoanProductMappingWritePlatformServiceImpl.java | 6 +-
.../CreditBureauReadConfigurationServiceImpl.java | 10 +-
.../CreditBureauReadPlatformServiceImpl.java | 7 +-
...rganisationCreditBureauReadPlatformService.java | 1 +
...isationCreditBureauReadPlatformServiceImpl.java | 11 +-
...ationCreditBureauWritePlatflormServiceImpl.java | 12 +-
.../dataqueries/api/DataTableApiConstant.java | 4 +-
.../dataqueries/api/DatatablesApiResource.java | 138 +-
.../api/DatatablesApiResourceSwagger.java | 80 +-
.../api/EntityDatatableChecksApiResource.java | 48 +-
.../EntityDatatableChecksApiResourceSwagger.java | 20 +-
.../dataqueries/api/ReportsApiResource.java | 38 +-
.../dataqueries/api/ReportsApiResourceSwagger.java | 25 +-
.../dataqueries/api/RunreportsApiResource.java | 43 +-
.../api/RunreportsApiResourceSwagger.java | 4 +
.../dataqueries/data/DataTableValidator.java | 3 +-
.../dataqueries/data/DatatableData.java | 13 +-
.../data/EntityDataTableChecksData.java | 2 +-
.../data/EntityDataTableChecksTemplateData.java | 29 +-
.../dataqueries/data/EntityTables.java | 46 +-
.../dataqueries/data/GenericResultsetData.java | 2 +-
.../dataqueries/data/ReportData.java | 2 +-
.../dataqueries/data/ReportParameterData.java | 2 +-
.../dataqueries/data/ReportParameterJoinData.java | 2 +-
.../data/ResultsetColumnHeaderData.java | 10 +-
.../dataqueries/data/ResultsetColumnValueData.java | 2 +-
.../dataqueries/data/StatusEnum.java | 2 +-
.../dataqueries/domain/EntityDatatableChecks.java | 7 +-
.../domain/EntityDatatableChecksRepository.java | 14 +-
.../infrastructure/dataqueries/domain/Report.java | 17 +-
.../dataqueries/domain/ReportParameter.java | 2 +-
.../domain/ReportParameterRepository.java | 2 +-
.../dataqueries/domain/ReportParameterUsage.java | 41 +-
.../domain/ReportParameterUsageRepository.java | 6 +-
.../dataqueries/domain/ReportRepository.java | 2 +-
.../domain/ReportRepositoryWrapper.java | 15 +-
.../exception/DatatableEntryRequiredException.java | 9 +-
.../exception/DatatableNotFoundException.java | 2 +-
.../exception/DatatableSystemErrorException.java | 2 +-
...EntityDatatableCheckAlreadyExistsException.java | 19 +-
.../EntityDatatableCheckNotAllowException.java | 8 +-
.../EntityDatatableCheckNotSupportedException.java | 7 +-
.../EntityDatatableChecksNotFoundException.java | 5 +-
.../exception/ReportNotFoundException.java | 2 +-
.../ReportParameterNotFoundException.java | 2 +-
.../handler/CreateDatatableCommandHandler.java | 2 +-
.../CreateDatatableEntryCommandHandler.java | 2 +-
.../CreateEntityDatatableChecksCommandHandler.java | 5 +-
.../handler/CreateReportCommandHandler.java | 2 +-
.../handler/DeleteDatatableCommandHandler.java | 2 +-
.../DeleteEntityDatatableChecksCommandHandler.java | 5 +-
...eleteOneToManyDatatableEntryCommandHandler.java | 2 +-
...DeleteOneToOneDatatableEntryCommandHandler.java | 2 +-
.../handler/DeleteReportCommandHandler.java | 2 +-
.../handler/RegisterDatatableCommandHandler.java | 5 +-
.../handler/UpdateDatatableCommandHandler.java | 2 +-
...pdateOneToManyDatatableEntryCommandHandler.java | 6 +-
...UpdateOneToOneDatatableEntryCommandHandler.java | 6 +-
.../handler/UpdateReportCommandHandler.java | 2 +-
.../ReportCommandFromApiJsonDeserializer.java | 2 +-
.../EntityDatatableChecksDataValidator.java | 17 +-
...tityDatatableChecksReadPlatformServiceImpl.java | 2 +-
.../service/EntityDatatableChecksReadService.java | 2 +-
.../EntityDatatableChecksWritePlatformService.java | 10 +-
...ityDatatableChecksWritePlatformServiceImpl.java | 17 +-
.../dataqueries/service/GenericDataService.java | 2 +-
.../service/GenericDataServiceImpl.java | 46 +-
.../dataqueries/service/ReadReportingService.java | 14 +-
.../service/ReadReportingServiceImpl.java | 178 +-
.../service/ReadWriteNonCoreDataService.java | 2 +-
.../service/ReadWriteNonCoreDataServiceImpl.java | 220 +-
.../service/ReportWritePlatformService.java | 2 +-
.../service/ReportWritePlatformServiceImpl.java | 14 +-
.../api/DocumentManagementApiResource.java | 85 +-
.../api/DocumentManagementApiResourceSwagger.java | 14 +-
.../documentmanagement/api/ImagesApiResource.java | 12 +-
.../api/ImagesApiResourceSwagger.java | 1 +
.../command/DocumentCommand.java | 2 +-
.../command/DocumentCommandValidator.java | 12 +-
.../contentrepository/ContentRepositoryUtils.java | 19 +-
.../FileSystemContentRepository.java | 5 +-
.../contentrepository/S3ContentRepository.java | 5 +-
.../documentmanagement/data/DocumentData.java | 2 +-
.../documentmanagement/data/ImageData.java | 2 +-
.../documentmanagement/domain/Document.java | 2 +-
.../domain/DocumentRepository.java | 2 +-
.../documentmanagement/domain/Image.java | 2 +-
.../documentmanagement/domain/ImageRepository.java | 2 +-
.../documentmanagement/domain/StorageType.java | 1 +
.../exception/ContentManagementException.java | 8 +-
.../exception/DocumentNotFoundException.java | 4 +-
...idEntityTypeForDocumentManagementException.java | 2 +-
.../service/DocumentReadPlatformService.java | 2 +-
.../service/DocumentReadPlatformServiceImpl.java | 2 +-
.../service/DocumentWritePlatformService.java | 5 +-
...umentWritePlatformServiceJpaRepositoryImpl.java | 26 +-
.../service/ImageReadPlatformService.java | 2 +-
.../service/ImageReadPlatformServiceImpl.java | 11 +-
...ImageWritePlatformServiceJpaRepositoryImpl.java | 10 +-
.../FineractEntityAccessConstants.java | 9 +-
.../api/FineractEntityApiResource.java | 4 +-
.../api/FineractEntityApiResourceConstants.java | 4 +-
.../data/FineractEntityAccessData.java | 7 +-
.../data/FineractEntityDataValidator.java | 28 +-
.../data/FineractEntityRelationData.java | 2 +-
.../data/FineractEntityToEntityMappingData.java | 4 +-
.../entityaccess/domain/FineractEntity.java | 8 +-
.../entityaccess/domain/FineractEntityAccess.java | 36 +-
.../domain/FineractEntityAccessRepository.java | 3 +-
.../FineractEntityAccessRepositoryWrapper.java | 7 +-
.../domain/FineractEntityAccessType.java | 16 +-
.../domain/FineractEntityRelation.java | 33 +-
.../domain/FineractEntityRelationRepository.java | 2 +-
.../FineractEntityRelationRepositoryWrapper.java | 11 +-
.../domain/FineractEntityToEntityMapping.java | 7 +-
.../FineractEntityToEntityMappingRepository.java | 8 +-
...ractEntityToEntityMappingRepositoryWrapper.java | 6 +-
.../entityaccess/domain/FineractEntityType.java | 35 +-
...FineractEntityAccessConfigurationException.java | 11 +-
.../FineractEntityAccessNotFoundException.java | 6 +-
...ineractEntityMappingConfigurationException.java | 5 +-
...FineractEntityToEntityMappingDateException.java | 5 +-
.../NotOfficeSpecificProductException.java | 8 +-
.../CreateEntityToEntityMappingCommandHandler.java | 2 +-
.../UpdateEntityToEntityMappingCommandHandler.java | 2 +-
.../service/FineractEntityAccessReadService.java | 8 +-
.../FineractEntityAccessReadServiceImpl.java | 73 +-
.../service/FineractEntityAccessUtil.java | 76 +-
.../service/FineractEntityAccessWriteService.java | 4 +-
.../FineractEntityAccessWriteServiceImpl.java | 23 +-
.../fineract/infrastructure/gcm/GcmConstants.java | 4 +-
.../gcm/api/DeviceRegistrationApiConstants.java | 1 +
.../gcm/api/DeviceRegistrationApiResource.java | 2 +-
.../gcm/domain/DeviceRegistration.java | 3 +-
.../gcm/domain/DeviceRegistrationData.java | 9 +-
.../gcm/domain/DeviceRegistrationRepository.java | 8 +-
.../DeviceRegistrationRepositoryWrapper.java | 6 +-
.../infrastructure/gcm/domain/Message.java | 20 +-
.../infrastructure/gcm/domain/MulticastResult.java | 12 +-
.../gcm/domain/NotificationConfigurationData.java | 8 +-
.../fineract/infrastructure/gcm/domain/Result.java | 8 +-
.../fineract/infrastructure/gcm/domain/Sender.java | 222 +-
.../DeviceRegistrationNotFoundException.java | 10 +-
.../gcm/exception/InvalidRequestException.java | 3 +-
.../DeviceRegistrationReadPlatformServiceImpl.java | 35 +-
...DeviceRegistrationWritePlatformServiceImpl.java | 48 +-
.../gcm/service/NotificationSenderService.java | 36 +-
.../infrastructure/hooks/api/HookApiConstants.java | 14 +-
.../infrastructure/hooks/api/HookApiResource.java | 104 +-
.../hooks/api/HookApiResourceSwagger.java | 30 +-
.../fineract/infrastructure/hooks/data/Event.java | 3 +-
.../hooks/data/EventResultSetExtractor.java | 20 +-
.../fineract/infrastructure/hooks/data/Field.java | 10 +-
.../infrastructure/hooks/data/HookData.java | 36 +-
.../hooks/data/HookTemplateData.java | 6 +-
.../fineract/infrastructure/hooks/domain/Hook.java | 4 +-
.../hooks/domain/HookConfiguration.java | 10 +-
.../hooks/domain/HookConfigurationRepository.java | 7 +-
.../hooks/domain/HookRepository.java | 7 +-
.../infrastructure/hooks/domain/HookResource.java | 6 +-
.../infrastructure/hooks/domain/HookTemplate.java | 2 +-
.../hooks/domain/HookTemplateRepository.java | 4 +-
.../infrastructure/hooks/event/HookEvent.java | 3 +-
.../hooks/exception/HookNotFoundException.java | 9 +-
.../exception/HookTemplateNotFoundException.java | 10 +-
.../hooks/handler/CreateHookCommandHandler.java | 3 +-
.../hooks/handler/DeleteHookCommandHandler.java | 3 +-
.../hooks/handler/UpdateHookCommandHandler.java | 6 +-
.../hooks/listener/FineractHookListener.java | 17 +-
.../hooks/processor/HookProcessor.java | 4 +-
.../hooks/processor/HookProcessorProvider.java | 9 +-
.../hooks/processor/ProcessorHelper.java | 25 +-
.../hooks/processor/TwilioHookProcessor.java | 61 +-
.../hooks/processor/WebHookProcessor.java | 31 +-
.../hooks/processor/WebHookService.java | 22 +-
.../HookCommandFromApiJsonDeserializer.java | 74 +-
.../hooks/service/HookReadPlatformService.java | 2 +-
.../hooks/service/HookReadPlatformServiceImpl.java | 69 +-
.../HookWritePlatformServiceJpaRepositoryImpl.java | 153 +-
.../jobs/annotation/CronMethodParser.java | 14 +-
.../jobs/api/SchedulerApiResource.java | 16 +-
.../jobs/api/SchedulerApiResourceSwagger.java | 6 +-
.../jobs/api/SchedulerJobApiConstants.java | 17 +-
.../jobs/api/SchedulerJobApiResource.java | 45 +-
.../jobs/api/SchedulerJobApiResourceSwagger.java | 11 +-
.../jobs/data/JobDetailDataValidator.java | 6 +-
.../jobs/data/JobDetailHistoryData.java | 2 +-
.../infrastructure/jobs/domain/JobParameter.java | 15 +-
.../jobs/domain/JobParameterRepository.java | 2 +-
.../jobs/domain/ScheduledJobDetailRepository.java | 3 +-
.../jobs/domain/ScheduledJobRunHistory.java | 4 +-
.../domain/ScheduledJobRunHistoryRepository.java | 4 +-
.../jobs/exception/JobNotFoundException.java | 2 +-
.../exception/OperationNotAllowedException.java | 6 +-
.../infrastructure/jobs/service/JobName.java | 59 +-
.../jobs/service/JobRegisterServiceImpl.java | 26 +-
...dularWritePlatformServiceJpaRepositoryImpl.java | 4 +-
.../jobs/service/SchedulerJobListener.java | 14 +-
.../service/SchedulerJobRunnerReadServiceImpl.java | 15 +-
.../jobs/service/SchedulerServiceConstants.java | 2 +-
.../jobs/service/SchedulerTriggerListener.java | 8 +-
.../infrastructure/openjpa/OpenJpaDialect.java | 38 +-
.../openjpa/OpenJpaVendorAdapter.java | 54 +-
.../report/annotation/ReportService.java | 2 +-
.../provider/ReportingProcessServiceProvider.java | 5 +-
.../report/service/ReportingProcessService.java | 2 +-
.../ReportMailingJobConstants.java | 26 +-
.../api/ReportMailingJobApiResource.java | 98 +-
.../api/ReportMailingJobApiResourceSwagger.java | 41 +-
.../api/ReportMailingJobRunHistoryApiResource.java | 28 +-
...portMailingJobRunHistoryApiResourceSwagger.java | 7 +-
.../data/ReportMailingJobConfigurationData.java | 1 +
.../data/ReportMailingJobData.java | 34 +-
.../ReportMailingJobEmailAttachmentFileFormat.java | 20 +-
.../data/ReportMailingJobEmailData.java | 1 +
.../data/ReportMailingJobPreviousRunStatus.java | 9 +-
.../data/ReportMailingJobRunHistoryData.java | 9 +-
...ortMailingJobStretchyReportParamDateOption.java | 32 +-
.../data/ReportMailingJobTimelineData.java | 4 +-
.../reportmailingjob/domain/ReportMailingJob.java | 97 +-
.../domain/ReportMailingJobConfiguration.java | 6 +-
.../ReportMailingJobConfigurationRepository.java | 4 +-
.../ReportMailingJobEmailAttachmentFileFormat.java | 24 +-
.../domain/ReportMailingJobRepository.java | 4 +-
.../domain/ReportMailingJobRepositoryWrapper.java | 11 +-
.../domain/ReportMailingJobRunHistory.java | 11 +-
.../ReportMailingJobRunHistoryRepository.java | 3 +-
...rtMailingJobConfigurationNotFoundException.java | 7 +-
.../ReportMailingJobNotFoundException.java | 7 +-
...eportMailingJobRunHistoryNotFoundException.java | 8 +-
.../CreateReportMailingJobCommandHandler.java | 1 +
.../DeleteReportMailingJobCommandHandler.java | 1 +
.../UpdateReportMailingJobCommandHandler.java | 1 +
.../reportmailingjob/helper/IPv4Helper.java | 54 +-
...MailingJobConfigurationReadPlatformService.java | 1 +
...ingJobConfigurationReadPlatformServiceImpl.java | 5 +-
.../service/ReportMailingJobEmailService.java | 4 +-
.../service/ReportMailingJobEmailServiceImpl.java | 35 +-
.../ReportMailingJobReadPlatformService.java | 7 +-
.../ReportMailingJobReadPlatformServiceImpl.java | 29 +-
...ortMailingJobRunHistoryReadPlatformService.java | 10 +-
...ailingJobRunHistoryReadPlatformServiceImpl.java | 12 +-
.../ReportMailingJobWritePlatformService.java | 4 +
.../ReportMailingJobWritePlatformServiceImpl.java | 123 +-
.../util/ReportMailingJobDateUtil.java | 27 +-
.../validation/ReportMailingJobValidator.java | 151 +-
.../security/api/AuthenticationApiResource.java | 22 +-
.../api/AuthenticationApiResourceSwagger.java | 5 +-
.../security/api/TwoFactorApiResource.java | 24 +-
.../api/TwoFactorConfigurationApiResource.java | 16 +-
.../security/api/UserDetailsApiResource.java | 22 +-
.../api/UserDetailsApiResourceSwagger.java | 5 +-
.../InvalidateTFAccessTokenCommandHandler.java | 22 +-
.../UpdateTwoFactorConfigCommandHandler.java | 9 +-
.../constants/TwoFactorConfigurationConstants.java | 20 +-
.../security/data/AuthenticatedOauthUserData.java | 2 +-
.../security/data/AuthenticatedUserData.java | 4 +-
.../infrastructure/security/data/OTPMetadata.java | 3 +-
.../infrastructure/security/data/OTPRequest.java | 7 +-
.../security/data/PlatformRequestLog.java | 2 +-
.../data/TwoFactorConfigurationValidator.java | 38 +-
.../domain/BasicPasswordEncodablePlatformUser.java | 2 +-
.../security/domain/OTPRequestRepository.java | 1 -
.../security/domain/PlatformUser.java | 2 +-
.../security/domain/PlatformUserRepository.java | 2 +-
.../security/domain/TFAccessToken.java | 13 +-
.../security/domain/TFAccessTokenRepository.java | 2 +-
.../security/domain/TwoFactorConfiguration.java | 11 +-
.../domain/TwoFactorConfigurationRepository.java | 4 +-
.../exception/ForcePasswordResetException.java | 5 +-
.../exception/InvalidTenantIdentiferException.java | 2 +-
.../exception/NoAuthorizationException.java | 2 +-
.../OTPDeliveryMethodInvalidException.java | 4 +-
.../security/exception/ResetPasswordException.java | 5 +-
.../InsecureTwoFactorAuthenticationFilter.java | 13 +-
.../TenantAwareBasicAuthenticationFilter.java | 20 +-
.../filter/TenantAwareTenantIdentifierFilter.java | 23 +-
.../filter/TwoFactorAuthenticationFilter.java | 58 +-
.../service/BasicAuthTenantDetailsService.java | 2 +-
.../service/BasicAuthTenantDetailsServiceJdbc.java | 6 +-
.../security/service/JdbcTenantDetailsService.java | 2 +-
.../security/service/PlatformPasswordEncoder.java | 2 +-
.../security/service/PlatformSecurityContext.java | 2 +-
.../service/PlatformUserDetailsService.java | 2 +-
.../security/service/RandomOTPGenerator.java | 2 +-
.../security/service/RandomPasswordGenerator.java | 2 +-
.../SpringSecurityPlatformSecurityContext.java | 19 +-
.../TenantAwareJpaPlatformUserDetailsService.java | 2 +-
.../security/service/TenantDetailsService.java | 2 +-
.../service/TwoFactorConfigurationService.java | 11 +-
.../service/TwoFactorConfigurationServiceImpl.java | 88 +-
.../security/service/TwoFactorServiceImpl.java | 85 +-
.../security/service/TwoFactorUtils.java | 8 +-
.../security/utils/ColumnValidator.java | 80 +-
.../infrastructure/security/utils/SQLBuilder.java | 102 +-
.../security/utils/SQLInjectionValidator.java | 66 +-
.../security/vote/SelfServiceUserAccessVote.java | 11 +-
.../infrastructure/sms/SmsApiConstants.java | 2 +-
.../infrastructure/sms/api/SmsApiResource.java | 6 +-
.../fineract/infrastructure/sms/data/SmsData.java | 2 +-
.../infrastructure/sms/data/SmsDataValidator.java | 9 +-
.../sms/data/SmsMessageApiQueueResourceData.java | 1 +
.../sms/data/SmsMessageApiReportResourceData.java | 5 +-
.../sms/data/SmsMessageApiResponseData.java | 1 +
.../sms/data/SmsMessageDeliveryReportData.java | 8 +-
.../infrastructure/sms/domain/SmsMessage.java | 22 +-
.../sms/domain/SmsMessageAssembler.java | 6 +-
.../sms/domain/SmsMessageEnumerations.java | 10 +-
.../sms/domain/SmsMessageRepository.java | 2 +-
.../sms/domain/SmsMessageStatusType.java | 5 +-
.../sms/exception/SmsNotFoundException.java | 2 +-
.../sms/handler/CreateSmsCommandHandler.java | 2 +-
.../sms/handler/DeleteSmsCommandHandler.java | 2 +-
.../sms/handler/UpdateSmsCommandHandler.java | 2 +-
.../scheduler/SmsMessageScheduledJobService.java | 13 +-
.../SmsMessageScheduledJobServiceImpl.java | 97 +-
.../sms/service/SmsReadPlatformServiceImpl.java | 16 +-
.../sms/service/SmsWritePlatformService.java | 2 +-
.../SmsWritePlatformServiceJpaRepositoryImpl.java | 11 +-
.../survey/api/PovertyLineApiResource.java | 3 +-
.../survey/api/SurveyApiConstants.java | 3 +-
.../survey/api/SurveyApiResource.java | 22 +-
.../survey/api/SurveyApiResourceSwagger.java | 15 +-
.../survey/data/LikelihoodDataValidator.java | 6 +-
.../survey/data/LikelihoodStatus.java | 4 +-
.../survey/data/PovertyLineData.java | 5 +-
.../survey/data/PpiPovertyLineData.java | 5 +-
.../infrastructure/survey/data/SurveyData.java | 3 +-
.../survey/domain/LikelihoodRepository.java | 6 +-
.../handler/FullFilSurveyCommandHandler.java | 3 +-
.../handler/RegisterSurveyCommandHandler.java | 1 -
.../handler/UpdateLikelihoodCommandHandler.java | 1 -
.../survey/service/PovertyLineServiceImpl.java | 18 +-
.../survey/service/ReadLikelihoodService.java | 1 +
.../survey/service/ReadSurveyServiceImpl.java | 22 +-
.../survey/service/WriteLikelihoodServiceImpl.java | 4 +-
.../interoperation/api/InteropApiResource.java | 217 +-
.../interoperation/api/InteropWrapperBuilder.java | 4 +-
.../interoperation/data/ExtensionData.java | 8 +-
.../fineract/interoperation/data/GeoCodeData.java | 8 +-
.../interoperation/data/InteropAccountData.java | 62 +-
.../data/InteropIdentifierAccountResponseData.java | 7 +-
.../data/InteropIdentifierRequestData.java | 15 +-
.../data/InteropIdentifiersResponseData.java | 3 +-
.../data/InteropQuoteRequestData.java | 38 +-
.../data/InteropQuoteResponseData.java | 24 +-
.../interoperation/data/InteropRequestData.java | 36 +-
.../interoperation/data/InteropResponseData.java | 15 +-
.../data/InteropTransactionData.java | 60 +-
.../data/InteropTransactionRequestData.java | 31 +-
.../InteropTransactionRequestResponseData.java | 20 +-
.../data/InteropTransactionTypeData.java | 23 +-
.../data/InteropTransactionsData.java | 5 +-
.../data/InteropTransferRequestData.java | 21 +-
.../data/InteropTransferResponseData.java | 19 +-
.../fineract/interoperation/data/MoneyData.java | 12 +-
.../interoperation/domain/InteropActionState.java | 3 +-
.../interoperation/domain/InteropAmountType.java | 3 +-
.../interoperation/domain/InteropIdentifier.java | 33 +-
.../domain/InteropIdentifierRepository.java | 3 +-
.../domain/InteropIdentifierType.java | 9 +-
.../domain/InteropInitiatorType.java | 5 +-
.../domain/InteropTransactionRole.java | 5 +-
.../domain/InteropTransactionScenario.java | 6 +-
.../domain/InteropTransferActionType.java | 4 +-
.../handler/CommitInteropTransferHandler.java | 2 +-
.../handler/CreateInteropIdentifierHandler.java | 2 +-
.../handler/CreateInteropQuoteHandler.java | 2 +-
.../handler/CreateInteropRequestHandler.java | 2 +-
.../handler/DeleteInteropIdentifierHandler.java | 2 +-
.../handler/PrepareInteropTransferHandler.java | 2 +-
.../serialization/InteropDataValidator.java | 13 +-
.../interoperation/service/InteropService.java | 12 +-
.../interoperation/service/InteropServiceImpl.java | 126 +-
.../fineract/interoperation/util/MathUtil.java | 118 +-
.../fineract/mix/api/MixReportApiResource.java | 8 +-
.../fineract/mix/api/MixTaxonomyApiResource.java | 12 +-
.../mix/api/MixTaxonomyMappingApiResource.java | 6 +-
.../apache/fineract/mix/data/MixTaxonomyData.java | 2 +-
.../fineract/mix/data/MixTaxonomyMappingData.java | 2 +-
.../apache/fineract/mix/data/NamespaceData.java | 2 +-
.../org/apache/fineract/mix/data/XBRLData.java | 2 +-
.../mix/domain/MixTaxonomyMappingRepository.java | 5 +-
.../MixTaxonomyMappingReadPlatformServiceImpl.java | 2 +-
.../MixTaxonomyReadPlatformServiceImpl.java | 2 +-
.../service/NamespaceReadPlatformServiceImpl.java | 2 +-
.../apache/fineract/mix/service/XBRLBuilder.java | 5 +-
.../fineract/mix/service/XBRLResultService.java | 2 +-
.../mix/service/XBRLResultServiceImpl.java | 73 +-
.../notification/api/NotificationApiResource.java | 30 +-
.../cache/CacheNotificationResponseHeader.java | 4 +-
.../config/MessagingConfiguration.java | 22 +-
.../notification/data/NotificationData.java | 3 +-
.../fineract/notification/data/TopicData.java | 6 +-
.../fineract/notification/domain/Notification.java | 2 +-
.../notification/domain/NotificationMapper.java | 1 -
.../domain/NotificationRepository.java | 1 -
.../apache/fineract/notification/domain/Topic.java | 3 +-
.../notification/domain/TopicRepository.java | 2 +
.../notification/domain/TopicSubscriber.java | 3 +-
.../domain/TopicSubscriberRepository.java | 1 +
.../NotificationEventListener.java | 19 +-
.../eventandlistener/NotificationEventService.java | 1 +
.../eventandlistener/SpringEventListener.java | 19 +-
.../eventandlistener/SpringEventPublisher.java | 1 +
.../service/NotificationDomainServiceImpl.java | 327 +-
...NotificationGeneratorReadRepositoryWrapper.java | 2 -
...ficationGeneratorReadRepositoryWrapperImpl.java | 2 +-
.../NotificationGeneratorWritePlatformService.java | 2 +-
.../NotificationMapperReadRepositoryWrapper.java | 1 -
.../NotificationMapperWritePlatformService.java | 1 -
.../NotificationReadPlatformServiceImpl.java | 53 +-
.../service/NotificationWritePlatformService.java | 9 +-
.../NotificationWritePlatformServiceImpl.java | 49 +-
.../notification/service/TopicDomainService.java | 18 +-
.../service/TopicDomainServiceImpl.java | 36 +-
.../TopicSubscriberReadPlatformServiceImpl.java | 2 +-
...riberWritePlatformServiceJpaRepositoryImpl.java | 2 +-
.../holiday/api/HolidaysApiResource.java | 58 +-
.../holiday/api/HolidaysApiResourceSwagger.java | 30 +-
.../holiday/data/HolidayDataValidator.java | 26 +-
.../organisation/holiday/domain/Holiday.java | 17 +-
.../holiday/domain/HolidayRepositoryWrapper.java | 3 +-
.../holiday/domain/HolidayStatusType.java | 2 +-
.../holiday/domain/RescheduleType.java | 35 +-
.../exception/HolidayNotFoundException.java | 2 +-
.../holiday/service/HolidayEnumerations.java | 4 +-
.../service/HolidayReadPlatformServiceImpl.java | 5 +-
.../organisation/holiday/service/HolidayUtil.java | 5 +-
...lidayWritePlatformServiceJpaRepositoryImpl.java | 27 +-
.../monetary/api/CurrenciesApiResource.java | 17 +-
.../monetary/api/CurrenciesApiResourceSwagger.java | 29 +-
.../data/ApplicationCurrencyConfigurationData.java | 2 +-
.../organisation/monetary/data/CurrencyData.java | 22 +-
.../organisation/monetary/data/MoneyData.java | 2 +-
.../monetary/domain/ApplicationCurrency.java | 2 +-
.../domain/ApplicationCurrencyRepository.java | 6 +-
.../ApplicationCurrencyRepositoryWrapper.java | 2 +-
.../monetary/domain/MonetaryCurrency.java | 2 +-
.../organisation/monetary/domain/Money.java | 6 +-
.../organisation/monetary/domain/MoneyHelper.java | 6 +-
.../monetary/exception/CurrencyInUseException.java | 3 +-
.../exception/CurrencyNotFoundException.java | 2 +-
.../OrganizationalCurrencyNotFoundException.java | 6 +-
.../handler/UpdateCurrencyCommandHandler.java | 2 +-
.../CurrencyCommandFromApiJsonDeserializer.java | 8 +-
.../service/CurrencyReadPlatformService.java | 2 +-
.../service/CurrencyReadPlatformServiceImpl.java | 2 +-
.../service/CurrencyWritePlatformService.java | 2 +-
...rencyWritePlatformServiceJpaRepositoryImpl.java | 5 +-
.../OrganisationCurrencyReadPlatformService.java | 2 +-
...rganisationCurrencyReadPlatformServiceImpl.java | 2 +-
.../office/api/OfficeTransactionsApiResource.java | 8 +-
.../office/api/OfficesApiResource.java | 52 +-
.../office/api/OfficesApiResourceSwagger.java | 26 +-
.../organisation/office/data/OfficeData.java | 15 +-
.../office/data/OfficeTransactionData.java | 2 +-
.../organisation/office/domain/Office.java | 2 +-
.../office/domain/OfficeRepositoryWrapper.java | 11 +-
.../office/domain/OfficeTransaction.java | 5 +-
.../office/domain/OrganisationCurrency.java | 2 +-
.../domain/OrganisationCurrencyRepository.java | 4 +-
.../OrganisationCurrencyRepositoryWrapper.java | 2 +-
.../office/exception/OfficeNotFoundException.java | 2 +-
.../OfficeTransactionNotFoundException.java | 2 +-
.../office/handler/CreateOfficeCommandHandler.java | 2 +-
.../CreateOfficeTransactionCommandHandler.java | 2 +-
.../DeleteOfficeTransactionCommandHandler.java | 2 +-
.../office/handler/UpdateOfficeCommandHandler.java | 2 +-
.../OfficeCommandFromApiJsonDeserializer.java | 12 +-
...eTransactionCommandFromApiJsonDeserializer.java | 8 +-
.../office/service/OfficeReadPlatformService.java | 2 +-
.../service/OfficeReadPlatformServiceImpl.java | 17 +-
.../office/service/OfficeWritePlatformService.java | 2 +-
...fficeWritePlatformServiceJpaRepositoryImpl.java | 17 +-
.../api/ProvisioningCategoryApiResource.java | 6 +-
.../api/ProvisioningCriteriaApiResource.java | 65 +-
.../ProvisioningCriteriaApiResourceSwagger.java | 22 +-
.../constants/ProvisioningCriteriaConstants.java | 1 +
.../data/ProvisioningCategoryData.java | 4 +-
.../data/ProvisioningCriteriaData.java | 18 +-
.../data/ProvisioningCriteriaDefinitionData.java | 8 +-
.../domain/LoanProductProvisionCriteria.java | 9 +-
.../domain/ProvisioningCategoryRepository.java | 4 +-
.../provisioning/domain/ProvisioningCriteria.java | 50 +-
.../domain/ProvisioningCriteriaDefinition.java | 11 +-
.../ProvisioningCriteriaDefinitionRepository.java | 4 +-
.../domain/ProvisioningCriteriaRepository.java | 4 +-
...ovisioningCriteriaCannotBeDeletedException.java | 3 +-
...eProvisioningCriteriaRequestCommandHandler.java | 5 +-
...eProvisioningCategoryRequestCommandHandler.java | 3 +-
...eProvisioningCriteriaRequestCommandHandler.java | 3 +-
...isioningCriteriaDefinitionJsonDeserializer.java | 117 +-
.../ProvisioningCategoryReadPlatformService.java | 3 +-
...rovisioningCategoryReadPlatformServiceImpl.java | 6 +-
.../ProvisioningCategoryWritePlatformService.java | 5 +-
...egoryWritePlatformServiceJpaRepositoryImpl.java | 17 +-
.../service/ProvisioningCriteriaAssembler.java | 31 +-
.../ProvisioningCriteriaReadPlatformService.java | 9 +-
...rovisioningCriteriaReadPlatformServiceImpl.java | 29 +-
.../ProvisioningCriteriaWritePlatformService.java | 5 +-
...teriaWritePlatformServiceJpaRepositoryImpl.java | 89 +-
.../organisation/staff/api/StaffApiResource.java | 60 +-
.../staff/api/StaffApiResourceSwagger.java | 16 +-
.../staff/data/BulkTransferLoanOfficerData.java | 2 +-
.../data/StaffAccountSummaryCollectionData.java | 2 +-
.../organisation/staff/data/StaffData.java | 17 +-
.../staff/domain/StaffEnumerations.java | 2 +-
.../staff/domain/StaffOrganisationalRoleType.java | 2 +-
.../organisation/staff/domain/StaffRepository.java | 2 +-
.../staff/domain/StaffRepositoryWrapper.java | 9 +-
.../staff/exception/StaffNotFoundException.java | 2 +-
.../staff/exception/StaffRoleException.java | 5 +-
.../staff/handler/CreateStaffCommandHandler.java | 2 +-
.../staff/handler/UpdateStaffCommandHandler.java | 2 +-
.../StaffCommandFromApiJsonDeserializer.java | 20 +-
.../staff/service/StaffReadPlatformService.java | 2 +-
.../service/StaffReadPlatformServiceImpl.java | 94 +-
.../staff/service/StaffWritePlatformService.java | 2 +-
...StaffWritePlatformServiceJpaRepositoryImpl.java | 19 +-
.../teller/api/CashierApiResource.java | 6 +-
.../organisation/teller/api/TellerApiResource.java | 133 +-
.../teller/api/TellerApiResourceSwagger.java | 49 +-
.../teller/api/TellerJournalApiResource.java | 6 +-
.../organisation/teller/data/CashierData.java | 99 +-
.../teller/data/CashierTransactionData.java | 40 +-
.../data/CashierTransactionDataValidator.java | 81 +-
.../data/CashierTransactionTypeTotalsData.java | 14 +-
.../data/CashierTransactionsWithSummaryData.java | 49 +-
.../organisation/teller/data/TellerData.java | 55 +-
.../teller/data/TellerJournalData.java | 38 +-
.../teller/data/TellerTransactionData.java | 38 +-
.../organisation/teller/domain/Cashier.java | 36 +-
.../teller/domain/CashierRepository.java | 3 +-
.../teller/domain/CashierRepositoryWrapper.java | 4 +-
.../teller/domain/CashierTransaction.java | 33 +-
.../domain/CashierTransactionRepository.java | 3 +-
.../organisation/teller/domain/CashierTxnType.java | 39 +-
.../organisation/teller/domain/Teller.java | 28 +-
.../organisation/teller/domain/TellerJournal.java | 3 +-
.../teller/domain/TellerRepository.java | 4 +-
.../teller/domain/TellerRepositoryWrapper.java | 9 +-
.../organisation/teller/domain/TellerStatus.java | 7 +-
.../teller/domain/TellerTransactionRepository.java | 6 +-
.../teller/exception/CashierAlreadyAlloacated.java | 6 +-
...hierDateRangeOutOfTellerDateRangeException.java | 6 +-
.../exception/CashierExistForTellerException.java | 3 +-
.../CashierInsufficientAmountException.java | 6 +-
.../teller/exception/CashierNotFoundException.java | 3 +-
.../exception/InvalidDateInputException.java | 7 +-
.../teller/exception/TellerNotFoundException.java | 3 +-
.../AllocateCashToCashierCommandHandler.java | 4 +-
.../AllocateCashierToTellerCommandHandler.java | 7 +-
.../teller/handler/CreateTellerCommandHandler.java | 5 +-
.../DeleteCashierAllocationCommandHandler.java | 7 +-
.../teller/handler/DeleteTellerCommandHandler.java | 4 +-
.../handler/ModifyCashierCommandHandler.java | 5 +-
.../SettleCashFromCashierCommandHandler.java | 4 +-
.../UpdateCashierAllocationCommandHandler.java | 7 +-
.../teller/handler/UpdateTellerCommandHandler.java | 4 +-
.../TellerCommandFromApiJsonDeserializer.java | 8 +-
.../service/CashierWritePlatformService.java | 3 +-
.../TellerManagementReadPlatformService.java | 4 +-
.../TellerManagementReadPlatformServiceImpl.java | 148 +-
.../TellerTransactionWritePlatformService.java | 3 +-
.../teller/service/TellerWritePlatformService.java | 32 +-
.../service/TellerWritePlatformServiceJpaImpl.java | 59 +-
.../organisation/teller/util/DateRange.java | 5 +-
.../workingdays/api/WorkingDaysApiConstants.java | 8 +-
.../workingdays/api/WorkingDaysApiResource.java | 25 +-
.../api/WorkingDaysApiResourceSwagger.java | 9 +
.../workingdays/data/AdjustedDateDetailsDTO.java | 3 +-
.../workingdays/data/WorkingDayValidator.java | 16 +-
.../workingdays/data/WorkingDaysData.java | 6 +-
.../domain/RepaymentRescheduleType.java | 6 +-
.../workingdays/domain/WorkingDays.java | 22 +-
.../domain/WorkingDaysEnumerations.java | 33 +-
.../domain/WorkingDaysRepositoryWrapper.java | 2 +-
.../exception/WorkingDaysNotFoundException.java | 2 +-
.../handler/UpdateWorkingDaysCommandHandler.java | 4 +-
.../WorkingDaysReadPlatformServiceImpl.java | 15 +-
.../workingdays/service/WorkingDaysUtil.java | 3 +-
.../portfolio/account/AccountDetailConstants.java | 3 +-
.../portfolio/account/PortfolioAccountType.java | 2 +-
.../account/api/AccountTransfersApiConstants.java | 2 +-
.../account/api/AccountTransfersApiResource.java | 92 +-
.../api/AccountTransfersApiResourceSwagger.java | 141 +-
.../api/StandingInstructionApiConstants.java | 9 +-
.../api/StandingInstructionApiResource.java | 135 +-
.../api/StandingInstructionApiResourceSwagger.java | 144 +-
.../api/StandingInstructionHistoryApiResource.java | 38 +-
...andingInstructionHistoryApiResourceSwagger.java | 24 +-
.../portfolio/account/data/AccountTransferDTO.java | 10 +-
.../account/data/AccountTransferData.java | 6 +-
.../data/AccountTransfersDataValidator.java | 42 +-
.../data/AccountTransfersDetailDataValidator.java | 6 +-
.../account/data/StandingInstructionDTO.java | 4 +-
.../account/data/StandingInstructionData.java | 7 +-
.../data/StandingInstructionDataValidator.java | 189 +-
.../account/domain/AccountAssociationType.java | 2 +-
.../domain/AccountAssociationsRepository.java | 7 +-
.../account/domain/AccountTransferAssembler.java | 2 +-
.../domain/AccountTransferDetailAssembler.java | 8 +-
.../domain/AccountTransferDetailRepository.java | 4 +-
.../account/domain/AccountTransferDetails.java | 13 +-
.../domain/AccountTransferRecurrenceType.java | 2 +-
.../account/domain/AccountTransferRepository.java | 6 +-
.../domain/AccountTransferStandingInstruction.java | 28 +-
.../account/domain/AccountTransferTransaction.java | 13 +-
.../account/domain/AccountTransferType.java | 2 +-
.../domain/StandingInstructionAssembler.java | 2 +-
.../domain/StandingInstructionPriority.java | 2 +-
.../domain/StandingInstructionRepository.java | 11 +-
.../account/domain/StandingInstructionStatus.java | 2 +-
.../account/domain/StandingInstructionType.java | 2 +-
.../AccountTransferNotFoundException.java | 2 +-
.../StandingInstructionNotFoundException.java | 2 +-
.../CreateAccountTransferCommandHandler.java | 2 +-
.../handler/RefundByTransferCommandHandler.java | 2 +-
...AccountAssociationsReadPlatformServiceImpl.java | 15 +-
.../service/AccountTransferEnumerations.java | 2 +-
.../AccountTransfersReadPlatformService.java | 9 +-
.../AccountTransfersReadPlatformServiceImpl.java | 433 +-
.../AccountTransfersWritePlatformService.java | 2 +-
.../AccountTransfersWritePlatformServiceImpl.java | 72 +-
.../PortfolioAccountReadPlatformService.java | 2 +-
.../PortfolioAccountReadPlatformServiceImpl.java | 57 +-
...ndingInstructionHistoryReadPlatformService.java | 2 +-
...gInstructionHistoryReadPlatformServiceImpl.java | 3 +-
.../StandingInstructionReadPlatformService.java | 2 +-
...StandingInstructionReadPlatformServiceImpl.java | 27 +-
.../StandingInstructionWritePlatformService.java | 2 +-
...tandingInstructionWritePlatformServiceImpl.java | 31 +-
.../data/AccountSummaryCollectionData.java | 39 +-
.../data/GuarantorAccountSummaryData.java | 10 +-
.../data/LoanAccountSummaryData.java | 19 +-
.../data/SavingsAccountSummaryData.java | 10 +-
.../accountdetails/data/SavingsSummaryCustom.java | 19 +-
.../data/ShareAccountSummaryData.java | 23 +-
.../accountdetails/domain/AccountType.java | 7 +-
.../service/AccountDetailsReadPlatformService.java | 2 +-
...etailsReadPlatformServiceJpaRepositoryImpl.java | 317 +-
.../service/AccountEnumerations.java | 3 +-
.../accounts/api/AccountsApiResource.java | 150 +-
.../accounts/api/AccountsApiResourceSwagger.java | 125 +-
.../accounts/constants/AccountsApiConstants.java | 5 +-
.../constants/ShareAccountApiConstants.java | 26 +-
.../portfolio/accounts/data/AccountData.java | 1 -
.../exceptions/ShareAccountNotFoundException.java | 5 +-
.../accounts/service/AccountsCommandsService.java | 3 +-
.../api/EntityFieldConfigurationApiResources.java | 23 +-
...ntityFieldConfigurationApiResourcesSwagger.java | 9 +-
.../portfolio/address/data/AddressData.java | 59 +-
.../portfolio/address/data/ClientAddressData.java | 4 +-
.../address/data/FieldConfigurationData.java | 13 +-
.../fineract/portfolio/address/domain/Address.java | 21 +-
.../exception/AddressNotFoundException.java | 4 +-
.../AddressCommandFromApiJsonDeserializer.java | 24 +-
.../service/AddressReadPlatformService.java | 1 +
.../service/AddressReadPlatformServiceImpl.java | 36 +-
.../service/AddressWritePlatformService.java | 1 +
.../service/AddressWritePlatformServiceImpl.java | 40 +-
.../FieldConfigurationReadPlatformService.java | 1 +
.../FieldConfigurationReadPlatformServiceImpl.java | 12 +-
.../portfolio/calendar/CalendarConstants.java | 15 +-
.../calendar/api/CalendarsApiResource.java | 16 +-
.../portfolio/calendar/data/CalendarData.java | 176 +-
.../calendar/data/CalendarHistoryDataWrapper.java | 8 +-
.../portfolio/calendar/domain/Calendar.java | 74 +-
.../calendar/domain/CalendarFrequencyType.java | 11 +-
.../domain/CalendarInstanceRepository.java | 14 +-
.../domain/CalendarInstanceRepositoryWrapper.java | 3 +-
.../calendar/domain/CalendarRepositoryWrapper.java | 3 +-
.../calendar/domain/CalendarWeekDaysType.java | 8 +-
.../calendar/exception/CalendarDateException.java | 2 +-
.../CalendarEntityTypeNotSupportedException.java | 2 +-
.../CalendarInstanceNotFoundException.java | 5 +-
.../exception/CalendarNotFoundException.java | 2 +-
...lendarParameterUpdateNotSupportedException.java | 2 +-
.../MeetingFrequencyMismatchException.java | 5 +-
.../exception/NotValidRecurringDateException.java | 2 +-
.../handler/DeleteCalendarCommandHandler.java | 2 +-
.../CalendarCommandFromApiJsonDeserializer.java | 127 +-
.../CalendarDropdownReadPlatformService.java | 3 +-
.../CalendarDropdownReadPlatformServiceImpl.java | 1 +
.../calendar/service/CalendarEnumerations.java | 14 +-
.../service/CalendarReadPlatformService.java | 2 -
.../service/CalendarReadPlatformServiceImpl.java | 53 +-
.../portfolio/calendar/service/CalendarUtils.java | 122 +-
...endarWritePlatformServiceJpaRepositoryImpl.java | 90 +-
.../portfolio/charge/api/ChargesApiResource.java | 40 +-
.../charge/api/ChargesApiResourceSwagger.java | 61 +-
.../fineract/portfolio/charge/data/ChargeData.java | 32 +-
.../fineract/portfolio/charge/domain/Charge.java | 83 +-
.../portfolio/charge/domain/ChargeAppliesTo.java | 15 +-
.../charge/domain/ChargeCalculationType.java | 17 +-
.../portfolio/charge/domain/ChargePaymentMode.java | 2 +-
.../portfolio/charge/domain/ChargeTimeType.java | 17 +-
...eDueAtDisbursementCannotBePenaltyException.java | 2 +-
.../exception/ChargeIsNotActiveException.java | 2 +-
.../exception/ChargeMustBePenaltyException.java | 2 +-
...ChargeParameterUpdateNotSupportedException.java | 2 +-
.../LoanChargeCannotBeAddedException.java | 2 +-
.../LoanChargeCannotBeDeletedException.java | 9 +-
.../LoanChargeCannotBePayedException.java | 9 +-
.../LoanChargeCannotBeUpdatedException.java | 9 +-
.../LoanChargeCannotBeWaivedException.java | 5 +-
.../exception/LoanChargeNotFoundException.java | 2 +-
.../LoanChargeWithoutMandatoryFieldException.java | 2 +-
...avingsAccountChargeCannotBeWaivedException.java | 9 +-
.../SavingsAccountChargeNotFoundException.java | 7 +-
...ccountChargeWithoutMandatoryFieldException.java | 2 +-
...ccountChargeWithoutMandatoryFieldException.java | 2 +-
.../CreateChargeDefinitionCommandHandler.java | 2 +-
.../DeleteChargeDefinitionCommandHandler.java | 2 +-
.../UpdateChargeDefinitionCommandHandler.java | 2 +-
...geDefinitionCommandFromApiJsonDeserializer.java | 22 +-
.../service/ChargeDropdownReadPlatformService.java | 6 +-
.../ChargeDropdownReadPlatformServiceImpl.java | 6 +-
.../charge/service/ChargeEnumerations.java | 23 +-
.../charge/service/ChargeReadPlatformService.java | 2 +-
.../service/ChargeReadPlatformServiceImpl.java | 4 +-
...hargeWritePlatformServiceJpaRepositoryImpl.java | 35 +-
.../client/api/ClientAddressApiResources.java | 65 +-
.../api/ClientAddressApiResourcesSwagger.java | 24 +-
.../portfolio/client/api/ClientApiConstants.java | 34 +-
.../client/api/ClientChargesApiResource.java | 74 +-
.../api/ClientChargesApiResourceSwagger.java | 44 +-
.../api/ClientFamilyMembersApiResources.java | 53 +-
.../client/api/ClientIdentifiersApiResource.java | 64 +-
.../api/ClientIdentifiersApiResourceSwagger.java | 40 +-
.../client/api/ClientTransactionsApiResource.java | 31 +-
.../api/ClientTransactionsApiResourceSwagger.java | 29 +-
.../portfolio/client/api/ClientsApiResource.java | 179 +-
.../client/api/ClientsApiResourceSwagger.java | 112 +-
.../client/command/ClientIdentifierCommand.java | 17 +-
.../client/command/ClientNoteCommand.java | 8 +-
.../client/data/ClientApiCollectionConstants.java | 33 +-
.../fineract/portfolio/client/data/ClientData.java | 223 +-
.../portfolio/client/data/ClientDataValidator.java | 148 +-
.../client/data/ClientFamilyMembersData.java | 50 +-
.../client/data/ClientIdentifierData.java | 5 +-
.../portfolio/client/data/ClientNonPersonData.java | 19 +-
.../portfolio/client/data/ClientTimelineData.java | 2 +-
.../client/domain/AccountNumberGenerator.java | 10 +-
.../fineract/portfolio/client/domain/Client.java | 80 +-
.../portfolio/client/domain/ClientAddress.java | 6 +-
.../client/domain/ClientAddressRepository.java | 7 +-
.../domain/ClientAddressRepositoryWrapper.java | 8 +-
.../domain/ClientChargeRepositoryWrapper.java | 3 +-
.../client/domain/ClientEnumerations.java | 5 +-
.../client/domain/ClientFamilyMembers.java | 308 +-
.../domain/ClientFamilyMembersRepository.java | 3 +-
.../portfolio/client/domain/ClientIdentifier.java | 11 +-
.../client/domain/ClientIdentifierRepository.java | 2 +-
.../client/domain/ClientIdentifierStatus.java | 11 +-
.../portfolio/client/domain/ClientNonPerson.java | 22 +-
.../client/domain/ClientNonPersonRepository.java | 2 +-
.../domain/ClientNonPersonRepositoryWrapper.java | 8 +-
.../portfolio/client/domain/ClientRepository.java | 2 +-
.../client/domain/ClientRepositoryWrapper.java | 18 +-
.../portfolio/client/domain/ClientStatus.java | 14 +-
.../portfolio/client/domain/ClientTransaction.java | 4 +-
.../client/domain/ClientTransferDetails.java | 17 +-
.../domain/ClientTransferDetailsRepository.java | 2 +-
.../ClientTransferDetailsRepositoryWrapper.java | 2 +-
.../exception/ClientActiveForUpdateException.java | 4 +-
.../ClientIdentifierNotFoundException.java | 2 +-
.../ClientMustBePendingToBeDeletedException.java | 6 +-
...ClientNonPersonNotFoundByClientIdException.java | 3 +-
.../ClientNonPersonNotFoundException.java | 3 +-
.../client/exception/ClientNotFoundException.java | 4 +-
.../ClientTransactionCannotBeUndoneException.java | 2 +-
.../DuplicateClientIdentifierException.java | 11 +-
.../client/exception/ImageNotFoundException.java | 2 +-
.../handler/ActivateClientCommandHandler.java | 2 +-
.../handler/AddClientAddressCommandHandler.java | 1 +
.../AddClientFamilyMemberCommandHandler.java | 9 +-
.../client/handler/CloseClientCommandHandler.java | 2 +-
.../CreateClientIdentifierCommandHandler.java | 2 +-
.../client/handler/DeleteClientCommandHandler.java | 2 +-
.../DeleteClientFamilyMemberCommandHandler.java | 7 +-
.../DeleteClientIdentifierCommandHandler.java | 2 +-
.../client/handler/RejectClientCommandHandler.java | 6 +-
.../handler/UndoRejectClientCommandHandler.java | 11 +-
.../handler/UndoWithdrawalCommandHandler.java | 13 +-
.../client/handler/UpdateClientCommandHandler.java | 2 +-
.../UpdateClientFamilyMemberCommandHandler.java | 6 +-
.../UpdateClientIdentifierCommandHandler.java | 2 +-
.../UpdateClientSavingsAccountCommandHandler.java | 2 +-
.../handler/WithdrawClientCommandHandler.java | 21 +-
...FamilyMemberCommandFromApiJsonDeserializer.java | 202 +-
...ntIdentifierCommandFromApiJsonDeserializer.java | 4 +-
.../ClientAddressReadPlatformServiceImpl.java | 7 +-
...hargeWritePlatformServiceJpaRepositoryImpl.java | 11 +-
.../ClientFamilyMembersReadPlatformService.java | 3 +-
...ClientFamilyMembersReadPlatformServiceImpl.java | 55 +-
.../ClientFamilyMembersWritePlatformService.java | 7 +-
...lientFamilyMembersWritePlatformServiceImpl.java | 305 +-
.../ClientIdentifierReadPlatformService.java | 2 +-
.../ClientIdentifierReadPlatformServiceImpl.java | 6 +-
.../ClientIdentifierWritePlatformService.java | 2 +-
...ifierWritePlatformServiceJpaRepositoryImpl.java | 21 +-
.../client/service/ClientReadPlatformService.java | 2 +-
.../service/ClientReadPlatformServiceImpl.java | 99 +-
.../client/service/ClientWritePlatformService.java | 3 +-
...lientWritePlatformServiceJpaRepositoryImpl.java | 183 +-
.../portfolio/client/service/LoanStatusMapper.java | 2 +-
.../collateral/api/CollateralApiConstants.java | 4 +-
.../collateral/api/CollateralsApiResource.java | 60 +-
.../api/CollateralsApiResourceSwagger.java | 44 +-
.../collateral/command/CollateralCommand.java | 24 +-
.../portfolio/collateral/data/CollateralData.java | 2 +-
.../collateral/domain/LoanCollateral.java | 38 +-
.../CollateralCannotBeCreatedException.java | 9 +-
.../CollateralCannotBeDeletedException.java | 9 +-
.../CollateralCannotBeUpdatedException.java | 9 +-
.../exception/CollateralNotFoundException.java | 2 +-
.../handler/CreateCollateralCommandHandler.java | 2 +-
.../handler/DeleteCollateralCommandHandler.java | 2 +-
.../handler/UpdateCollateralCommandHandler.java | 2 +-
.../CollateralCommandFromApiJsonDeserializer.java | 5 +-
.../service/CollateralReadPlatformServiceImpl.java | 12 +-
.../service/CollateralWritePlatformService.java | 2 +-
...teralWritePlatformServiceJpaRepositoryImpl.java | 29 +-
.../collectionsheet/CollectionSheetConstants.java | 2 +-
.../api/CollectionSheetApiResourceSwagger.java | 20 +-
.../api/CollectionSheetApiResourse.java | 15 +-
.../CollectionSheetBulkDisbursalCommand.java | 2 +-
.../CollectionSheetBulkRepaymentCommand.java | 2 +-
.../command/SingleDisbursalCommand.java | 2 +-
.../command/SingleRepaymentCommand.java | 2 +-
.../CollectionSheetTransactionDataValidator.java | 127 +-
.../collectionsheet/data/IndividualClientData.java | 4 +-
.../data/IndividualCollectionSheetData.java | 2 +-
.../IndividualCollectionSheetLoanFlatData.java | 2 +-
.../collectionsheet/data/JLGClientData.java | 22 +-
.../data/JLGCollectionSheetData.java | 2 +-
.../data/JLGCollectionSheetFlatData.java | 8 +-
.../collectionsheet/data/JLGGroupData.java | 10 +-
.../collectionsheet/data/LoanDueData.java | 2 +-
.../collectionsheet/data/SavingsDueData.java | 5 +-
...ulkDisbursalCommandFromApiJsonDeserializer.java | 6 +-
...ulkRepaymentCommandFromApiJsonDeserializer.java | 11 +-
...heetGenerateCommandFromApiJsonDeserializer.java | 16 +-
.../CollectionSheetReadPlatformServiceImpl.java | 160 +-
...SheetWritePlatformServiceJpaRepositoryImpl.java | 6 +-
.../common/BusinessEventNotificationConstants.java | 61 +-
.../portfolio/common/domain/DayOfWeekType.java | 12 +-
.../portfolio/common/domain/DaysInMonthType.java | 3 +-
.../portfolio/common/domain/DaysInYearType.java | 2 +-
.../portfolio/common/domain/NthDayType.java | 12 +-
.../common/domain/PeriodFrequencyType.java | 7 +-
.../service/BusinessEventNotifierServiceImpl.java | 6 +-
.../common/service/CommonEnumerations.java | 28 +-
.../service/DropdownReadPlatformServiceImpl.java | 2 +-
.../api/FloatingRatesApiResource.java | 81 +-
.../api/FloatingRatesApiResourceSwagger.java | 40 +-
.../floatingrates/data/FloatingRateData.java | 30 +-
.../floatingrates/data/FloatingRatePeriodData.java | 25 +-
.../floatingrates/data/InterestRatePeriodData.java | 9 +-
.../floatingrates/domain/FloatingRate.java | 97 +-
.../floatingrates/domain/FloatingRatePeriod.java | 22 +-
.../domain/FloatingRateRepository.java | 12 +-
.../domain/FloatingRateRepositoryWrapper.java | 6 +-
.../exception/FloatingRateNotFoundException.java | 6 +-
.../handler/CreateFloatingRateCommandHandler.java | 6 +-
.../handler/UpdateFloatingRateCommandHandler.java | 6 +-
.../serialization/FloatingRateDataValidator.java | 226 +-
.../FloatingRateWritePlatformServiceImpl.java | 57 +-
.../FloatingRatesReadPlatformServiceImpl.java | 169 +-
.../portfolio/fund/api/FundsApiResource.java | 26 +-
.../fund/api/FundsApiResourceSwagger.java | 24 +-
.../fineract/portfolio/fund/data/FundData.java | 2 +-
.../fineract/portfolio/fund/domain/Fund.java | 2 +-
.../portfolio/fund/domain/FundRepository.java | 2 +-
.../fund/exception/FundNotFoundException.java | 2 +-
.../fund/handler/CreateFundCommandHandler.java | 2 +-
.../fund/handler/UpdateFundCommandHandler.java | 2 +-
.../FundCommandFromApiJsonDeserializer.java | 8 +-
.../fund/service/FundReadPlatformService.java | 2 +-
.../fund/service/FundReadPlatformServiceImpl.java | 2 +-
.../fund/service/FundWritePlatformService.java | 2 +-
.../FundWritePlatformServiceJpaRepositoryImpl.java | 21 +-
.../portfolio/group/api/CentersApiResource.java | 127 +-
.../group/api/CentersApiResourceSwagger.java | 97 +-
.../group/api/GroupingTypesApiConstants.java | 28 +-
.../portfolio/group/api/GroupsApiResource.java | 277 +-
.../group/api/GroupsApiResourceSwagger.java | 147 +-
.../group/api/GroupsLevelApiResource.java | 6 +-
.../fineract/portfolio/group/data/CenterData.java | 92 +-
.../portfolio/group/data/GroupGeneralData.java | 179 +-
.../portfolio/group/data/GroupLevelData.java | 2 +-
.../portfolio/group/data/GroupRoleData.java | 14 +-
.../portfolio/group/data/GroupSummary.java | 2 +-
.../portfolio/group/data/GroupTimelineData.java | 34 +-
.../fineract/portfolio/group/domain/Group.java | 27 +-
.../portfolio/group/domain/GroupLevel.java | 2 +-
.../group/domain/GroupRepositoryWrapper.java | 7 +-
.../group/domain/GroupRoleRepositoryWrapper.java | 3 +-
.../group/domain/GroupingTypeEnumerations.java | 2 +-
.../portfolio/group/domain/GroupingTypeStatus.java | 2 +-
.../exception/ClientExistInGroupException.java | 4 +-
.../exception/GroupExistsInCenterException.java | 6 +-
...pMemberCountNotInPermissibleRangeException.java | 5 +-
.../GroupMemberNotFoundInGSIMException.java | 11 +-
.../GroupMustBePendingToBeDeletedException.java | 2 +-
.../exception/GroupNotExistsInCenterException.java | 2 +-
.../handler/ActivateCenterCommandHandler.java | 2 +-
.../group/handler/ActivateGroupCommandHandler.java | 2 +-
.../AssociateClientsToGroupCommandHandler.java | 2 +-
.../group/handler/CreateCenterCommandHandler.java | 2 +-
.../group/handler/CreateGroupCommandHandler.java | 2 +-
.../group/handler/DeleteCenterCommandHandler.java | 2 +-
.../group/handler/DeleteGroupCommandHandler.java | 2 +-
...DisassociateClientsFromGroupCommandHandler.java | 2 +-
.../SaveCenterCollectionSheetCommandHandler.java | 2 +-
.../SaveGroupCollectionSheetCommandHandler.java | 2 +-
.../handler/UnassignGroupStaffCommandHandler.java | 2 +-
.../UnassignStaffFromCenterCommandHandler.java | 2 +-
.../group/handler/UpdateCenterCommandHandler.java | 2 +-
.../group/handler/UpdateGroupCommandHandler.java | 2 +-
.../serialization/GroupRolesDataValidator.java | 6 +-
.../serialization/GroupingTypesDataValidator.java | 105 +-
.../group/service/AllGroupTypesDataMapper.java | 4 +-
.../service/CenterReadPlatformServiceImpl.java | 73 +-
.../group/service/GroupReadPlatformService.java | 2 +-
.../service/GroupReadPlatformServiceImpl.java | 98 +-
...TypesWritePlatformServiceJpaRepositoryImpl.java | 76 +-
.../InterestIncentiveApiConstants.java | 6 +-
.../InterestRateChartApiConstants.java | 24 +-
.../InterestRateChartSlabApiConstants.java | 2 +-
.../api/InterestRateChartSlabsApiResource.java | 60 +-
.../InterestRateChartSlabsApiResourceSwagger.java | 52 +-
.../api/InterestRateChartsApiResource.java | 59 +-
.../api/InterestRateChartsApiResourceSwagger.java | 45 +-
.../data/InterestIncentiveDataValidator.java | 10 +-
.../data/InterestRateChartData.java | 31 +-
.../data/InterestRateChartDataValidator.java | 23 +-
.../data/InterestRateChartRepository.java | 2 +-
.../data/InterestRateChartRepositoryWrapper.java | 3 +-
.../data/InterestRateChartSlabData.java | 2 +-
.../data/InterestRateChartSlabDataValidator.java | 18 +-
.../data/InterestRateChartSlabRepository.java | 5 +-
.../InterestRateChartSlabRepositoryWrapper.java | 10 +-
.../domain/InterestIncentivesFields.java | 6 +-
.../domain/InterestRateChart.java | 57 +-
.../domain/InterestRateChartFields.java | 5 +-
.../domain/InterestRateChartSlab.java | 6 +-
.../domain/InterestRateChartSlabFields.java | 8 +-
.../InterestRateChartNotFoundException.java | 2 +-
.../InterestRateChartSlabNotFoundException.java | 6 +-
.../CreateInterestRateChartCommandHandler.java | 2 +-
.../CreateInterestRateChartSlabCommandHandler.java | 2 +-
.../DeleteInterestRateChartCommandHandler.java | 2 +-
.../DeleteInterestRateChartSlabCommandHandler.java | 4 +-
.../UpdateInterestRateChartCommandHandler.java | 2 +-
.../UpdateInterestRateChartSlabCommandHandler.java | 4 +-
.../incentive/InterestIncentiveAttributeName.java | 2 +-
.../incentive/InterestIncentiveEntityType.java | 2 +-
.../incentive/InterestIncentiveType.java | 2 +-
...terestIncentiveDropdownReadPlatformService.java | 2 +-
.../service/InterestIncentivesEnumerations.java | 2 +-
.../service/InterestRateChartAssembler.java | 5 +-
...terestRateChartDropdownReadPlatformService.java | 2 +-
...stRateChartDropdownReadPlatformServiceImpl.java | 2 +-
.../service/InterestRateChartEnumerations.java | 16 +-
.../InterestRateChartReadPlatformService.java | 6 +-
.../InterestRateChartReadPlatformServiceImpl.java | 25 +-
.../service/InterestRateChartSlabAssembler.java | 9 +-
.../InterestRateChartSlabReadPlatformService.java | 2 +-
...terestRateChartSlabReadPlatformServiceImpl.java | 19 +-
.../InterestRateChartSlabWritePlatformService.java | 2 +-
...tSlabWritePlatformServiceJpaRepositoryImpl.java | 10 +-
.../InterestRateChartWritePlatformService.java | 2 +-
...ChartWritePlatformServiceJpaRepositoryImpl.java | 2 +-
.../loanaccount/api/BulkLoansApiResource.java | 6 +-
.../loanaccount/api/LoanApiConstants.java | 8 +-
.../loanaccount/api/LoanChargesApiResource.java | 101 +-
.../api/LoanChargesApiResourceSwagger.java | 64 +-
.../api/LoanDisbursementDetailApiResource.java | 12 +-
.../loanaccount/api/LoanScheduleApiResource.java | 20 +-
.../api/LoanScheduleApiResourceSwagger.java | 16 +-
.../api/LoanTransactionsApiResource.java | 63 +-
.../api/LoanTransactionsApiResourceSwagger.java | 44 +-
.../loanaccount/api/LoansApiResource.java | 405 +-
.../loanaccount/api/LoansApiResourceSwagger.java | 136 +-
.../loanaccount/command/LoanChargeCommand.java | 2 +-
.../loanaccount/command/LoanUpdateCommand.java | 8 +-
.../command/UndoStateTransitionCommand.java | 2 +-
.../command/UpdateLoanOfficerCommand.java | 14 +-
.../loanaccount/data/DisbursementData.java | 39 +-
.../portfolio/loanaccount/data/GLIMContainer.java | 68 +-
.../loanaccount/data/GlimRepaymentTemplate.java | 118 +-
.../GroupLoanIndividualMonitoringAccountData.java | 40 +-
.../loanaccount/data/LoanAccountData.java | 453 +-
.../data/LoanApplicationTimelineData.java | 28 +-
.../loanaccount/data/LoanApprovalData.java | 22 +-
.../portfolio/loanaccount/data/LoanChargeData.java | 3 +-
.../loanaccount/data/LoanChargePaidByData.java | 6 +-
.../loanaccount/data/LoanChargePaidDetail.java | 6 +-
.../loanaccount/data/LoanConvenienceData.java | 2 +-
.../data/LoanInterestRecalculationData.java | 3 +-
.../loanaccount/data/LoanScheduleAccrualData.java | 10 +-
.../loanaccount/data/LoanStatusEnumData.java | 2 +-
.../loanaccount/data/LoanSummaryData.java | 6 +-
.../loanaccount/data/LoanTermVariationsData.java | 4 +-
.../data/LoanTermVariationsDataWrapper.java | 6 +-
.../loanaccount/data/LoanTransactionData.java | 196 +-
.../loanaccount/data/LoanTransactionEnumData.java | 2 +-
.../loanaccount/data/PaidInAdvanceData.java | 15 +-
.../data/RepaymentScheduleRelatedLoanData.java | 9 +-
.../loanaccount/data/ScheduleGeneratorDTO.java | 13 +-
.../domain/DefaultLoanLifecycleStateMachine.java | 2 +-
.../domain/GLIMAccountInfoRepository.java | 9 +-
.../GroupLoanIndividualMonitoringAccount.java | 169 +-
.../portfolio/loanaccount/domain/Loan.java | 572 +--
.../domain/LoanAccountDomainService.java | 6 +-
.../domain/LoanAccountDomainServiceJpa.java | 105 +-
.../portfolio/loanaccount/domain/LoanCharge.java | 73 +-
.../loanaccount/domain/LoanChargePaidBy.java | 3 +-
.../domain/LoanDisbursementDetails.java | 11 +-
.../loanaccount/domain/LoanInstallmentCharge.java | 7 +-
.../domain/LoanInterestRecalculationDetails.java | 11 +-
.../domain/LoanRepaymentDataComparator.java | 2 +-
.../domain/LoanRepaymentScheduleInstallment.java | 54 +-
...LoanRepaymentScheduleInstallmentRepository.java | 4 +-
.../LoanRepaymentScheduleProcessingWrapper.java | 17 +-
...paymentScheduleTransactionProcessorFactory.java | 2 +-
.../loanaccount/domain/LoanRepository.java | 2 +-
.../loanaccount/domain/LoanRepositoryWrapper.java | 138 +-
...oanRescheduleRequestToTermVariationMapping.java | 5 +-
.../portfolio/loanaccount/domain/LoanStatus.java | 2 +-
.../loanaccount/domain/LoanSubStatus.java | 5 +-
.../portfolio/loanaccount/domain/LoanSummary.java | 17 +-
.../loanaccount/domain/LoanSummaryWrapper.java | 11 +-
.../loanaccount/domain/LoanTermVariationType.java | 8 +-
.../loanaccount/domain/LoanTermVariations.java | 6 +-
.../loanaccount/domain/LoanTopupDetails.java | 54 +-
.../loanaccount/domain/LoanTrancheCharge.java | 12 +-
.../domain/LoanTrancheDisbursementCharge.java | 10 +-
.../loanaccount/domain/LoanTransaction.java | 101 +-
...oanTransactionProcessingStrategyRepository.java | 6 +-
.../domain/LoanTransactionRepository.java | 2 +-
.../LoanTransactionToRepaymentScheduleMapping.java | 6 +-
.../loanaccount/domain/LoanTransactionType.java | 9 +-
...tLoanRepaymentScheduleTransactionProcessor.java | 40 +-
.../LoanRepaymentScheduleTransactionProcessor.java | 2 +-
...eLoanRepaymentScheduleTransactionProcessor.java | 9 +-
...tLoanRepaymentScheduleTransactionProcessor.java | 6 +-
...eLoanRepaymentScheduleTransactionProcessor.java | 9 +-
...yLoanRepaymentScheduleTransactionProcessor.java | 4 +-
...rLoanRepaymentScheduleTransactionProcessor.java | 13 +-
...rLoanRepaymentScheduleTransactionProcessor.java | 13 +-
...ILoanRepaymentScheduleTransactionProcessor.java | 22 +-
.../exception/DateMismatchException.java | 17 +-
.../InvalidLoanStateTransitionException.java | 2 +-
.../InvalidLoanTransactionTypeException.java | 2 +-
.../exception/InvalidLoanTypeException.java | 2 +-
.../InvalidPaidInAdvanceAmountException.java | 7 +-
.../exception/InvalidRefundDateException.java | 9 +-
...ttedAndPendingApprovalStateCannotBeDeleted.java | 6 +-
...tedAndPendingApprovalStateCannotBeModified.java | 6 +-
.../exception/LoanDisbursalException.java | 5 +-
.../exception/LoanNotFoundException.java | 2 +-
.../LoanOfficerAssignmentDateException.java | 3 +-
.../exception/LoanOfficerAssignmentException.java | 8 +-
.../LoanTemplateTypeRequiredException.java | 2 +-
.../LoanTransactionNotFoundException.java | 6 +-
...sactionProcessingStrategyNotFoundException.java | 6 +-
...sbursalAndFirstRepaymentViolationException.java | 6 +-
.../NotSupportedLoanTemplateTypeException.java | 2 +-
.../UndoLastTrancheDisbursementException.java | 6 +-
.../loanaccount/guarantor/GuarantorConstants.java | 8 +-
.../guarantor/api/GuarantorsApiResource.java | 31 +-
.../guarantor/command/GuarantorCommand.java | 32 +-
.../loanaccount/guarantor/data/GuarantorData.java | 39 +-
.../guarantor/data/GuarantorFundingData.java | 8 +-
.../loanaccount/guarantor/data/ObligeeData.java | 15 +-
.../loanaccount/guarantor/domain/Guarantor.java | 13 +-
.../guarantor/domain/GuarantorFundStatusType.java | 2 +-
.../guarantor/domain/GuarantorFundingDetails.java | 2 +-
.../domain/GuarantorFundingRepository.java | 4 +-
.../GuarantorFundingTransactionRepository.java | 6 +-
.../guarantor/domain/GuarantorRepository.java | 2 +-
.../guarantor/domain/GuarantorType.java | 1 +
.../exception/GuarantorNotFoundException.java | 6 +-
.../exception/InvalidGuarantorException.java | 12 +-
.../handler/CreateGuarantorCommandHandler.java | 2 +-
.../handler/DeleteGuarantorCommandHandler.java | 2 +-
.../handler/UpdateGuarantorCommandHandler.java | 2 +-
.../GuarantorCommandFromApiJsonDeserializer.java | 19 +-
.../service/GuarantorDomainServiceImpl.java | 7 +-
.../service/GuarantorReadPlatformService.java | 3 +-
.../service/GuarantorReadPlatformServiceImpl.java | 47 +-
.../service/GuarantorWritePlatformService.java | 2 +-
...ntorWritePlatformServiceJpaRepositoryIImpl.java | 37 +-
...AndDeleteLoanDisburseDetailsCommandHandler.java | 2 +-
.../handler/AddLoanChargeCommandHandler.java | 2 +-
.../BulkUpdateLoanOfficerCommandHandler.java | 2 +-
.../CloseLoanAsRescheduledCommandHandler.java | 2 +-
.../handler/CloseLoanCommandHandler.java | 2 +-
.../handler/DeleteLoanChargeCommandHandler.java | 2 +-
.../handler/DisburseLoanCommandHandler.java | 2 +-
.../DisburseLoanToSavingsCommandHandler.java | 2 +-
.../GLIMApplicationRejectionCommandHandler.java | 25 +-
.../handler/GLIMBulkRepaymentCommandHandler.java | 2 +-
.../GLIMLoanApplicationApprovalCommandHandler.java | 20 +-
.../GlimLoanApplicationDisburseCommandHandler.java | 5 +-
.../LoanApplicationApprovalCommandHandler.java | 2 +-
.../LoanApplicationApprovalUndoCommandHandler.java | 2 +-
.../LoanApplicationDeletionCommandHandler.java | 2 +-
.../LoanApplicationModificationCommandHandler.java | 2 +-
.../LoanApplicationRejectedCommandHandler.java | 2 +-
.../LoanApplicationSubmittalCommandHandler.java | 2 +-
...licationWithdrawnByApplicantCommandHandler.java | 2 +-
.../handler/LoanRefundByCashCommandHandler.java | 2 +-
.../LoanRepaymentAdjustmentCommandHandler.java | 2 +-
.../handler/LoanRepaymentCommandHandler.java | 2 +-
.../handler/PayLoanChargeCommandHandler.java | 2 +-
.../handler/RemoveLoanOfficerCommandHandler.java | 2 +-
.../handler/UndoDisbursalLoanCommandHandler.java | 2 +-
.../handler/UndoGLIMLoanApplicationApproval.java | 25 +-
.../UndoGLIMLoanDisbursalCommandHandler.java | 7 +-
.../UndoLastDisbursalLoanCommandHandler.java | 2 +-
.../handler/UndoWriteOffLoanCommandHandler.java | 2 +-
.../handler/UpdateLoanChargeCommandHandler.java | 2 +-
.../UpdateLoanDisbuseDateCommandHandler.java | 2 +-
.../handler/UpdateLoanOfficerCommandHandler.java | 2 +-
.../WaiveInterestPortionOnLoanCommandHandler.java | 2 +-
.../handler/WaiveLoanChargeCommandHandler.java | 2 +-
.../handler/WriteOffLoanCommandHandler.java | 2 +-
.../loanschedule/data/LoanScheduleDTO.java | 3 +-
.../loanschedule/data/LoanScheduleData.java | 2 +-
.../loanschedule/data/LoanScheduleParams.java | 2 +-
.../loanschedule/data/LoanSchedulePeriodData.java | 22 +-
.../loanschedule/data/OverdueLoanScheduleData.java | 1 -
.../domain/AbstractLoanScheduleGenerator.java | 323 +-
.../loanschedule/domain/AprCalculator.java | 42 +-
...liningBalanceInterestLoanScheduleGenerator.java | 10 +-
.../DefaultLoanScheduleGeneratorFactory.java | 2 +-
.../DefaultPaymentPeriodsInOneYearCalculator.java | 4 +-
.../domain/DefaultScheduledDateGenerator.java | 17 +-
.../loanschedule/domain/FinanicalFunctions.java | 2 +-
.../domain/FlatInterestLoanScheduleGenerator.java | 17 +-
.../loanschedule/domain/LoanApplicationTerms.java | 248 +-
.../domain/LoanRepaymentScheduleHistory.java | 10 +-
.../LoanRepaymentScheduleHistoryRepository.java | 3 +-
.../loanschedule/domain/LoanScheduleGenerator.java | 2 +-
.../loanschedule/domain/LoanScheduleModel.java | 4 +-
.../LoanScheduleModelDisbursementPeriod.java | 3 +-
.../domain/LoanScheduleModelPeriod.java | 1 +
.../domain/LoanScheduleModelRepaymentPeriod.java | 3 +-
.../domain/PaymentPeriodsInOneYearCalculator.java | 2 +-
.../domain/ScheduledDateGenerator.java | 2 +-
.../service/LoanScheduleAssembler.java | 159 +-
...LoanScheduleCalculationPlatformServiceImpl.java | 27 +-
...LoanScheduleHistoryReadPlatformServiceImpl.java | 24 +-
.../LoanScheduleHistoryWritePlatformService.java | 5 +-
...oanScheduleHistoryWritePlatformServiceImpl.java | 4 +-
.../RescheduleLoansApiConstants.java | 10 +-
.../api/RescheduleLoansApiResource.java | 47 +-
.../data/LoanRescheduleRequestData.java | 10 +-
.../data/LoanRescheduleRequestDataValidator.java | 93 +-
.../data/LoanRescheduleRequestEnumerations.java | 23 +-
.../data/LoanRescheduleRequestTimelineData.java | 11 +-
.../rescheduleloan/domain/LoanRescheduleModel.java | 15 +-
.../domain/LoanRescheduleRequest.java | 43 +-
.../domain/LoanRescheduleRequestRepository.java | 3 +-
.../LoanRescheduleRequestNotFoundException.java | 10 +-
...ApproveLoanRescheduleRequestCommandHandler.java | 4 +-
.../CreateLoanRescheduleRequestCommandHandler.java | 3 +-
.../RejectLoanRescheduleRequestCommandHandler.java | 4 +-
.../LoanReschedulePreviewPlatformServiceImpl.java | 16 +-
.../LoanRescheduleRequestReadPlatformService.java | 8 +-
...anRescheduleRequestReadPlatformServiceImpl.java | 6 +-
...nRescheduleRequestWritePlatformServiceImpl.java | 91 +-
...alculateLoanScheduleQueryFromApiJsonHelper.java | 61 +-
.../LoanApplicationCommandFromApiJsonHelper.java | 352 +-
.../LoanApplicationTransitionApiJsonValidator.java | 31 +-
.../serialization/LoanEventApiJsonValidator.java | 82 +-
.../LoanUpdateCommandFromApiJsonDeserializer.java | 2 +-
.../VariableLoanScheduleFromApiJsonValidator.java | 10 +-
.../service/BulkLoansReadPlatformServiceImpl.java | 2 +-
.../GLIMAccountInfoReadPlatformService.java | 22 +-
.../GLIMAccountInfoReadPlatformServiceImpl.java | 160 +-
.../GLIMAccountInfoWritePlatformService.java | 2 +-
.../GLIMAccountInfoWritePlatformServiceImpl.java | 47 +-
.../service/LoanAccrualPlatformService.java | 1 +
.../service/LoanAccrualPlatformServiceImpl.java | 5 +-
.../service/LoanAccrualWritePlatformService.java | 3 +-
.../LoanAccrualWritePlatformServiceImpl.java | 13 +-
.../LoanApplicationWritePlatformService.java | 2 +-
...ationWritePlatformServiceJpaRepositoryImpl.java | 641 ++-
.../service/LoanArrearsAgingServiceImpl.java | 61 +-
.../loanaccount/service/LoanAssembler.java | 43 +-
.../loanaccount/service/LoanChargeAssembler.java | 9 +-
.../LoanChargePaidByReadPlatformServiceImpl.java | 71 +-
.../service/LoanChargeReadPlatformService.java | 3 +-
.../service/LoanChargeReadPlatformServiceImpl.java | 7 +-
.../service/LoanReadPlatformService.java | 7 +-
.../service/LoanReadPlatformServiceImpl.java | 367 +-
.../loanaccount/service/LoanSchedularService.java | 3 +-
.../service/LoanSchedularServiceImpl.java | 96 +-
.../loanaccount/service/LoanUtilService.java | 71 +-
.../service/LoanWritePlatformService.java | 2 +-
.../LoanWritePlatformServiceJpaRepositoryImpl.java | 475 +-
.../service/RecalculateInterestPoster.java | 22 +-
.../loanproduct/LoanProductConstants.java | 11 +-
.../loanproduct/api/LoanProductsApiResource.java | 106 +-
.../api/LoanProductsApiResourceSwagger.java | 277 +-
.../portfolio/loanproduct/data/LoanOverdueDTO.java | 1 -
.../loanproduct/data/LoanProductData.java | 194 +-
.../data/LoanProductInterestRecalculationData.java | 12 +-
.../data/TransactionProcessingStrategyData.java | 2 +-
.../loanproduct/domain/AmortizationMethod.java | 3 +-
.../domain/InterestCalculationPeriodMethod.java | 3 +-
.../loanproduct/domain/InterestMethod.java | 4 +-
.../domain/InterestRecalculationPeriodMethod.java | 1 +
.../portfolio/loanproduct/domain/LoanProduct.java | 224 +-
.../domain/LoanProductBorrowerCycleVariations.java | 18 +-
.../domain/LoanProductConfigurableAttributes.java | 36 +-
.../domain/LoanProductFloatingRates.java | 9 +-
.../LoanProductInterestRecalculationDetails.java | 17 +-
.../domain/LoanProductMinMaxConstraints.java | 19 +-
.../loanproduct/domain/LoanProductParamType.java | 2 +-
.../domain/LoanProductRelatedDetail.java | 66 +-
.../loanproduct/domain/LoanProductRepository.java | 2 +-
.../domain/LoanProductTrancheDetails.java | 3 +-
.../domain/LoanProductValueConditionType.java | 2 +-
.../domain/LoanRescheduleStrategyMethod.java | 4 +-
.../domain/LoanTransactionProcessingStrategy.java | 6 +-
.../domain/RecalculationFrequencyType.java | 1 +
.../exception/InvalidCurrencyException.java | 2 +-
.../exception/InvalidLendingStrategy.java | 2 +-
...nnotBeModifiedDueToNonClosedLoansException.java | 3 +-
.../exception/LoanProductNotFoundException.java | 2 +-
.../exception/NotInMinMaxRangeException.java | 2 +-
.../handler/CreateLoanProductCommandHandler.java | 2 +-
.../handler/UpdateLoanProductCommandHandler.java | 2 +-
.../productmix/api/ProductMixApiResource.java | 7 +-
.../productmix/data/ProductMixData.java | 3 +-
.../serialization/ProductMixDataValidator.java | 6 +-
...ctMixWritePlatformServiceJpaRepositoryImpl.java | 3 +-
.../serialization/LoanProductDataValidator.java | 775 ++--
.../service/LoanDropdownReadPlatformService.java | 4 +-
.../LoanDropdownReadPlatformServiceImpl.java | 5 +-
.../loanproduct/service/LoanEnumerations.java | 68 +-
.../service/LoanProductReadPlatformService.java | 2 +-
.../LoanProductReadPlatformServiceImpl.java | 65 +-
.../service/LoanProductWritePlatformService.java | 2 +-
...oductWritePlatformServiceJpaRepositoryImpl.java | 62 +-
.../portfolio/meeting/MeetingApiConstants.java | 2 +-
.../portfolio/meeting/api/MeetingsApiResource.java | 11 +-
.../meeting/attendance/AttendanceType.java | 2 +-
.../attendance/domain/ClientAttendance.java | 3 +-
.../AttendanceDropdownReadPlatformService.java | 2 +-
.../attendance/service/AttendanceEnumerations.java | 2 +-
.../ClientAttendanceReadPlatformServiceImpl.java | 2 +-
.../meeting/data/MeetingDataValidator.java | 9 +-
.../fineract/portfolio/meeting/domain/Meeting.java | 24 +-
.../meeting/domain/MeetingRepositoryWrapper.java | 3 +-
.../meeting/exception/MeetingDateException.java | 2 +-
.../exception/MeetingNotFoundException.java | 2 +-
.../MeetingNotSupportedResourceException.java | 2 +-
.../handler/DeleteMeetingCommandHandler.java | 2 +-
.../service/MeetingReadPlatformServiceImpl.java | 2 +-
...etingWritePlatformServiceJpaRepositoryImpl.java | 65 +-
.../portfolio/note/api/NotesApiResource.java | 65 +-
.../note/api/NotesApiResourceSwagger.java | 40 +-
.../portfolio/note/command/NoteCommand.java | 2 +-
.../fineract/portfolio/note/data/NoteData.java | 2 +-
.../fineract/portfolio/note/domain/Note.java | 3 +-
.../portfolio/note/domain/NoteRepository.java | 2 +-
.../fineract/portfolio/note/domain/NoteType.java | 5 +-
.../note/exception/NoteNotFoundException.java | 6 +-
.../NoteResourceNotSupportedException.java | 2 +-
.../note/handler/DeleteNoteCommandHandler.java | 2 +-
.../NoteCommandFromApiJsonDeserializer.java | 8 +-
.../note/service/NoteReadPlatformService.java | 2 +-
.../note/service/NoteReadPlatformServiceImpl.java | 10 +-
.../NoteWritePlatformServiceJpaRepositoryImpl.java | 13 +-
.../paymentdetail/PaymentDetailConstants.java | 2 +-
.../paymentdetail/data/PaymentDetailData.java | 21 +-
.../paymentdetail/domain/PaymentDetail.java | 2 +-
.../domain/PaymentDetailRepository.java | 2 +-
.../service/PaymentDetailWritePlatformService.java | 2 +-
...etailWritePlatformServiceJpaRepositoryImpl.java | 2 +-
.../paymenttype/api/PaymentTypeApiResource.java | 35 +-
.../api/PaymentTypeApiResourceConstants.java | 3 +-
.../api/PaymentTypeApiResourceSwagger.java | 32 +-
.../paymenttype/data/PaymentTypeData.java | 15 +-
.../paymenttype/data/PaymentTypeDataValidator.java | 23 +-
.../exception/PaymentTypeNotFoundException.java | 4 -
.../handler/UpdatePaymentTypeCommandHandler.java | 2 +-
.../service/PaymentTypeReadPlatformService.java | 1 +
.../service/PaymentTypeWriteServiceImpl.java | 6 +-
.../products/api/ProductsApiResource.java | 54 +-
.../products/api/ProductsApiResourceSwagger.java | 152 +-
.../products/constants/ProductsApiConstants.java | 5 +-
.../portfolio/products/data/ProductData.java | 1 -
.../exception/ProductNotFoundException.java | 4 +-
.../exception/ResourceNotFoundException.java | 5 +-
.../products/service/ProductCommandsService.java | 4 +-
.../service/ProductReadPlatformService.java | 2 +-
.../portfolio/rate/api/RateApiConstants.java | 10 +-
.../portfolio/rate/api/RateApiResource.java | 150 +-
.../fineract/portfolio/rate/data/RateData.java | 34 +-
.../fineract/portfolio/rate/domain/Rate.java | 251 +-
.../portfolio/rate/domain/RateAppliesTo.java | 67 +-
.../portfolio/rate/domain/RateRepository.java | 8 +-
.../rate/domain/RateRepositoryWrapper.java | 53 +-
.../rate/exception/RateAlreadyExistException.java | 5 +-
.../rate/exception/RateNotFoundException.java | 13 +-
.../rate/handler/CreateRateCommandHandler.java | 21 +-
.../rate/handler/UpdateRateCommandHandler.java | 23 +-
...teDefinitionCommandFromApiJsonDeserializer.java | 112 +-
.../portfolio/rate/service/RateAssembler.java | 59 +-
.../portfolio/rate/service/RateEnumerations.java | 32 +-
.../portfolio/rate/service/RateReadService.java | 15 +-
.../rate/service/RateReadServiceImpl.java | 183 +-
.../portfolio/rate/service/RateWriteService.java | 3 +-
.../rate/service/RateWriteServiceImpl.java | 15 +-
.../savings/DepositAccountOnClosureType.java | 10 +-
.../DepositAccountOnHoldTransactionType.java | 2 +-
.../portfolio/savings/DepositAccountType.java | 2 +-
.../portfolio/savings/DepositsApiConstants.java | 94 +-
.../savings/PreClosurePenalInterestOnType.java | 1 +
.../portfolio/savings/RecurringDepositType.java | 1 +
.../savings/SavingsAccountTransactionType.java | 11 +-
.../portfolio/savings/SavingsApiConstants.java | 18 +-
.../SavingsCompoundingInterestPeriodType.java | 2 +-
.../SavingsInterestCalculationDaysInYearType.java | 2 +-
.../savings/SavingsInterestCalculationType.java | 2 +-
.../savings/SavingsPeriodFrequencyType.java | 1 +
.../savings/SavingsPostingInterestPeriodType.java | 2 +-
.../savings/SavingsWithdrawalFeesType.java | 2 +-
...itAccountOnHoldFundTransactionsApiResource.java | 11 +-
...FixedDepositAccountTransactionsApiResource.java | 22 +-
.../api/FixedDepositAccountsApiResource.java | 172 +-
.../FixedDepositAccountsApiResourceSwagger.java | 124 +-
.../api/FixedDepositProductsApiResource.java | 50 +-
.../FixedDepositProductsApiResourceSwagger.java | 156 +-
...rringDepositAccountTransactionsApiResource.java | 78 +-
...positAccountTransactionsApiResourceSwagger.java | 52 +-
.../api/RecurringDepositAccountsApiResource.java | 164 +-
...RecurringDepositAccountsApiResourceSwagger.java | 120 +-
.../api/RecurringDepositProductsApiResource.java | 51 +-
...RecurringDepositProductsApiResourceSwagger.java | 161 +-
.../api/SavingsAccountChargesApiResource.java | 108 +-
.../SavingsAccountChargesApiResourceSwagger.java | 69 +-
.../api/SavingsAccountTransactionsApiResource.java | 19 +-
.../savings/api/SavingsAccountsApiResource.java | 215 +-
.../api/SavingsAccountsApiResourceSwagger.java | 96 +-
.../savings/api/SavingsApiSetConstants.java | 60 +-
.../savings/api/SavingsProductsApiResource.java | 58 +-
.../api/SavingsProductsApiResourceSwagger.java | 212 +-
.../savings/data/ClosingOfSavingsAccounts.java | 17 +-
.../portfolio/savings/data/DepositAccountData.java | 56 +-
.../savings/data/DepositAccountDataValidator.java | 114 +-
.../data/DepositAccountInterestRateChartData.java | 10 +-
.../DepositAccountInterestRateChartSlabData.java | 8 +-
.../data/DepositAccountOnHoldTransactionData.java | 7 +-
.../DepositAccountTransactionDataValidator.java | 54 +-
.../portfolio/savings/data/DepositProductData.java | 22 +-
.../savings/data/DepositProductDataValidator.java | 174 +-
.../savings/data/FixedDepositAccountData.java | 131 +-
.../savings/data/FixedDepositProductData.java | 111 +-
.../portfolio/savings/data/GSIMContainer.java | 5 +-
...roupSavingsIndividualMonitoringAccountData.java | 148 +-
.../savings/data/RecurringDepositAccountData.java | 110 +-
.../savings/data/RecurringDepositProductData.java | 98 +-
.../savings/data/SavingsAccountAnnualFeeData.java | 2 +-
.../SavingsAccountApplicationTimelineData.java | 2 +-
.../savings/data/SavingsAccountChargeData.java | 7 +-
.../data/SavingsAccountChargeDataValidator.java | 8 +-
.../savings/data/SavingsAccountConstant.java | 37 +-
.../portfolio/savings/data/SavingsAccountData.java | 231 +-
.../savings/data/SavingsAccountDataDTO.java | 4 +-
.../savings/data/SavingsAccountDataValidator.java | 91 +-
.../savings/data/SavingsAccountStatusEnumData.java | 2 +-
.../data/SavingsAccountSubStatusEnumData.java | 6 +-
.../savings/data/SavingsAccountSummaryData.java | 4 +-
.../savings/data/SavingsAccountTransactionDTO.java | 4 +-
.../data/SavingsAccountTransactionData.java | 73 +-
.../SavingsAccountTransactionDataValidator.java | 23 +-
.../data/SavingsAccountTransactionEnumData.java | 2 +-
.../portfolio/savings/data/SavingsActivation.java | 7 +-
.../portfolio/savings/data/SavingsApproval.java | 7 +-
.../portfolio/savings/data/SavingsProductData.java | 92 +-
.../savings/data/SavingsProductDataValidator.java | 321 +-
.../savings/data/TransactionDateData.java | 2 +-
.../savings/domain/DepositAccountAssembler.java | 33 +-
.../domain/DepositAccountDomainService.java | 11 +-
.../domain/DepositAccountDomainServiceJpa.java | 64 +-
.../domain/DepositAccountInterestRateChart.java | 4 +-
.../DepositAccountInterestRateChartSlabs.java | 7 +-
.../domain/DepositAccountOnHoldTransaction.java | 2 +-
.../DepositAccountOnHoldTransactionRepository.java | 6 +-
.../domain/DepositAccountRecurringDetail.java | 9 +-
.../domain/DepositAccountTermAndPreClosure.java | 20 +-
.../savings/domain/DepositPreClosureDetail.java | 2 +-
.../domain/DepositProductAmountDetails.java | 5 +-
.../savings/domain/DepositProductAssembler.java | 26 +-
.../domain/DepositProductRecurringDetail.java | 2 +-
.../domain/DepositProductTermAndPreClosure.java | 2 +-
.../savings/domain/DepositRecurringDetail.java | 2 +-
.../savings/domain/DepositTermDetail.java | 20 +-
.../savings/domain/FixedDepositAccount.java | 47 +-
.../domain/FixedDepositAccountRepository.java | 6 +-
.../savings/domain/FixedDepositProduct.java | 20 +-
.../domain/FixedDepositProductRepository.java | 6 +-
.../portfolio/savings/domain/GSIMRepositoy.java | 8 +-
.../domain/GroupSavingsIndividualMonitoring.java | 160 +-
.../savings/domain/RecurringDepositAccount.java | 84 +-
.../domain/RecurringDepositAccountRepository.java | 6 +-
.../savings/domain/RecurringDepositProduct.java | 2 +-
.../domain/RecurringDepositProductRepository.java | 6 +-
.../RecurringDepositScheduleInstallment.java | 16 +-
.../portfolio/savings/domain/SavingsAccount.java | 275 +-
.../savings/domain/SavingsAccountAssembler.java | 16 +-
.../savings/domain/SavingsAccountCharge.java | 50 +-
.../domain/SavingsAccountChargeAssembler.java | 8 +-
.../domain/SavingsAccountChargeRepository.java | 4 +-
.../SavingsAccountChargeRepositoryWrapper.java | 3 +-
.../domain/SavingsAccountDomainService.java | 2 +-
.../domain/SavingsAccountDomainServiceJpa.java | 11 +-
.../savings/domain/SavingsAccountRepository.java | 4 +-
.../domain/SavingsAccountRepositoryWrapper.java | 37 +-
.../savings/domain/SavingsAccountStatusType.java | 2 +-
.../domain/SavingsAccountSubStatusEnum.java | 12 +-
.../savings/domain/SavingsAccountSummary.java | 3 +-
.../savings/domain/SavingsAccountTransaction.java | 69 +-
.../SavingsAccountTransactionComparator.java | 2 +-
.../SavingsAccountTransactionRepository.java | 4 +-
.../SavingsAccountTransactionSummaryWrapper.java | 6 +-
.../portfolio/savings/domain/SavingsHelper.java | 20 +-
.../portfolio/savings/domain/SavingsProduct.java | 39 +-
.../savings/domain/SavingsProductAssembler.java | 6 +-
.../domain/SavingsProductChargeAssembler.java | 8 +-
.../savings/domain/SavingsProductRepository.java | 2 +-
.../domain/interest/AnnualCompoundingPeriod.java | 15 +-
.../domain/interest/BiAnnualCompoundingPeriod.java | 15 +-
.../domain/interest/CompoundInterestHelper.java | 5 +-
.../savings/domain/interest/CompoundingPeriod.java | 3 +-
.../domain/interest/DailyCompoundingPeriod.java | 14 +-
.../savings/domain/interest/EndOfDayBalance.java | 18 +-
.../domain/interest/MonthlyCompoundingPeriod.java | 15 +-
.../savings/domain/interest/PostingPeriod.java | 94 +-
.../interest/QuarterlyCompoundingPeriod.java | 15 +-
...tAccountInterestRateChartNotFoundException.java | 6 +-
.../exception/DepositAccountNotFoundException.java | 6 +-
...positAccountTransactionNotAllowedException.java | 8 +-
.../FixedDepositProductNotFoundException.java | 2 +-
.../InsufficientAccountBalanceException.java | 2 +-
.../exception/PostInterestAsOnDateException.java | 23 +-
.../RecurringDepositProductNotFoundException.java | 2 +-
.../exception/SavingsAccountNotFoundException.java | 5 +-
...SavingsAccountTransactionNotFoundException.java | 5 +-
...ingsActivityPriorToClientTransferException.java | 2 +-
.../SavingsOfficerAssignmentDateException.java | 5 +-
.../SavingsOfficerUnassignmentDateException.java | 1 -
.../SavingsOfficerUnassignmentException.java | 3 +-
.../exception/SavingsProductNotFoundException.java | 2 +-
...ransferTransactionsCannotBeUndoneException.java | 2 +-
.../TransactionUpdateNotAllowedException.java | 5 +-
.../ActivateFixedDepositAccountCommandHandler.java | 2 +-
...ivateRecurringDepositAccountCommandHandler.java | 2 +-
.../ActivateSavingsAccountCommandHandler.java | 2 +-
.../AddSavingsAccountChargeCommandHandler.java | 2 +-
...ApplyAnnualFeeSavingsAccountCommandHandler.java | 2 +-
...eInterestFixedDepositAccountCommandHandler.java | 2 +-
...erestRecurringDepositAccountCommandHandler.java | 2 +-
...culateInterestSavingsAccountCommandHandler.java | 2 +-
.../CloseFixedDepositAccountCommandHandler.java | 2 +-
.../savings/handler/CloseGSIMCommandHandler.java | 6 +-
...CloseRecurringDepositAccountCommandHandler.java | 2 +-
.../CreateFixedDepositProductCommandHandler.java | 2 +-
...reateRecurringDepositProductCommandHandler.java | 2 +-
.../CreateSavingsProductCommandHandler.java | 2 +-
.../DeleteFixedDepositProductCommandHandler.java | 2 +-
...eleteRecurringDepositProductCommandHandler.java | 2 +-
.../DeleteSavingsAccountChargeCommandHandler.java | 2 +-
.../DeleteSavingsProductCommandHandler.java | 2 +-
.../DepositSavingsAccountCommandHandler.java | 2 +-
...itAccountApplicationApprovalCommandHandler.java | 2 +-
...countApplicationApprovalUndoCommandHandler.java | 2 +-
...itAccountApplicationDeletionCommandHandler.java | 2 +-
...countApplicationModificationCommandHandler.java | 2 +-
...itAccountApplicationRejectedCommandHandler.java | 2 +-
...tAccountApplicationSubmittalCommandHandler.java | 2 +-
...licationWithdrawnByApplicantCommandHandler.java | 2 +-
.../FixedDepositAccountDepositCommandHandler.java | 2 +-
...DepositTransactionAdjustmentCommandHandler.java | 2 +-
.../GSIMAccountActivationCommandHandler.java | 6 +-
.../GSIMApplicationApprovalCommandHandler.java | 10 +-
.../GSIMApplicationModificationCommandHandler.java | 27 +-
.../handler/GSIMApplicationRejectionHandler.java | 9 +-
.../GSIMApplicationSubmittalCommandHandler.java | 9 +-
.../savings/handler/GSIMDepositCommandHandler.java | 2 -
.../handler/GSIMUndoApprovalCommandHandler.java | 6 +-
.../PaySavingsAccountChargeCommandHandler.java | 2 +-
...tInterestFixedDepositAccountCommandHandler.java | 2 +-
...erestRecurringDepositAccountCommandHandler.java | 2 +-
.../PostInterestSavingsAccountCommandHandler.java | 2 +-
...tureCloseFixedDepositAccountCommandHandler.java | 2 +-
...CloseRecurringDepositAccountCommandHandler.java | 5 +-
...itAccountApplicationApprovalCommandHandler.java | 6 +-
...countApplicationApprovalUndoCommandHandler.java | 2 +-
...itAccountApplicationDeletionCommandHandler.java | 2 +-
...countApplicationModificationCommandHandler.java | 2 +-
...itAccountApplicationRejectedCommandHandler.java | 2 +-
...tAccountApplicationSubmittalCommandHandler.java | 2 +-
...licationWithdrawnByApplicantCommandHandler.java | 2 +-
...curringDepositAccountDepositCommandHandler.java | 2 +-
...itAccountUpdateDepositAmountCommandHandler.java | 2 +-
...DepositTransactionAdjustmentCommandHandler.java | 5 +-
...gsAccountApplicationApprovalCommandHandler.java | 2 +-
...countApplicationApprovalUndoCommandHandler.java | 2 +-
...countApplicationModificationCommandHandler.java | 2 +-
...gsAccountApplicationRejectedCommandHandler.java | 2 +-
...sAccountApplicationSubmittalCommandHandler.java | 2 +-
...licationWithdrawnByApplicantCommandHandler.java | 2 +-
...ansactionFixedDepositAccountCommandHandler.java | 2 +-
...ctionRecurringDepositAccountCommandHandler.java | 5 +-
...ndoTransactionSavingsAccountCommandHandler.java | 2 +-
.../UpdateFixedDepositProductCommandHandler.java | 2 +-
...pdateRecurringDepositProductCommandHandler.java | 2 +-
.../UpdateSavingsAccountChargeCommandHandler.java | 2 +-
.../UpdateSavingsProductCommandHandler.java | 2 +-
...ateWithHoldTaxSavingsAccountCommandHandler.java | 2 +-
.../WaiveSavingsAccountChargeCommandHandler.java | 2 +-
.../WithdrawSavingsAccountCommandHandler.java | 2 +-
...ithdrawalFixedDepositAccountCommandHandler.java | 2 +-
...rawalRecurringDepositAccountCommandHandler.java | 2 +-
...ntInterestRateChartReadPlatformServiceImpl.java | 19 +-
...ntOnHoldTransactionReadPlatformServiceImpl.java | 3 +-
...untPreMatureCalculationPlatformServiceImpl.java | 18 +-
.../service/DepositAccountReadPlatformService.java | 3 +-
.../DepositAccountReadPlatformServiceImpl.java | 235 +-
.../DepositAccountWritePlatformService.java | 2 +-
...countWritePlatformServiceJpaRepositoryImpl.java | 108 +-
...ositApplicationProcessWritePlatformService.java | 2 +-
...ocessWritePlatformServiceJpaRepositoryImpl.java | 61 +-
.../DepositProductReadPlatformServiceImpl.java | 54 +-
.../DepositsDropdownReadPlatformService.java | 2 +-
.../DepositsDropdownReadPlatformServiceImpl.java | 12 +-
.../FixedDepositProductWritePlatformService.java | 2 +-
...oductWritePlatformServiceJpaRepositoryImpl.java | 20 +-
.../savings/service/GSIMReadPlatformService.java | 4 +-
.../service/GSIMReadPlatformServiceImpl.java | 573 ++-
...gsIndividualMonitoringWritePlatformService.java | 7 +-
...dividualMonitoringWritePlatformServiceImpl.java | 80 +-
...ecurringDepositProductWritePlatformService.java | 2 +-
...oductWritePlatformServiceJpaRepositoryImpl.java | 16 +-
...countApplicationTransitionApiJsonValidator.java | 2 +-
...avingsAccountChargeReadPlatformServiceImpl.java | 27 +-
.../service/SavingsAccountReadPlatformService.java | 9 +-
.../SavingsAccountReadPlatformServiceImpl.java | 188 +-
.../SavingsAccountWritePlatformService.java | 3 +-
...countWritePlatformServiceJpaRepositoryImpl.java | 177 +-
...ingsApplicationProcessWritePlatformService.java | 2 +-
...ocessWritePlatformServiceJpaRepositoryImpl.java | 339 +-
.../SavingsDropdownReadPlatformService.java | 2 +-
.../SavingsDropdownReadPlatformServiceImpl.java | 14 +-
.../savings/service/SavingsEnumerations.java | 185 +-
.../SavingsProductReadPlatformServiceImpl.java | 26 +-
.../SavingsProductWritePlatformService.java | 2 +-
...oductWritePlatformServiceJpaRepositoryImpl.java | 20 +-
.../savings/service/SavingsSchedularService.java | 1 -
.../service/SavingsSchedularServiceImpl.java | 15 +-
.../fineract/portfolio/search/SearchConstants.java | 11 +-
.../portfolio/search/api/SearchApiResource.java | 41 +-
.../search/api/SearchApiResourceSwagger.java | 8 +-
.../search/data/AdHocQueryDataValidator.java | 142 +-
.../search/data/AdHocQuerySearchConstants.java | 12 +-
.../portfolio/search/data/SearchConditions.java | 35 +-
.../fineract/portfolio/search/data/SearchData.java | 5 +-
.../service/SearchReadPlatformServiceImpl.java | 12 +-
.../api/SelfAccountTransferApiResource.java | 201 +-
.../api/SelfAccountTransferApiResourceSwagger.java | 29 +-
.../api/SelfBeneficiariesTPTApiResource.java | 103 +-
.../SelfBeneficiariesTPTApiResourceSwagger.java | 39 +-
.../self/account/data/SelfAccountTemplateData.java | 29 +-
.../self/account/data/SelfAccountTransferData.java | 3 +-
.../data/SelfAccountTransferDataValidator.java | 132 +-
.../account/data/SelfBeneficiariesTPTData.java | 10 +-
.../data/SelfBeneficiariesTPTDataValidator.java | 104 +-
.../self/account/domain/SelfBeneficiariesTPT.java | 9 +-
.../domain/SelfBeneficiariesTPTRepository.java | 5 +-
.../BeneficiaryTransferLimitExceededException.java | 3 +-
...TPTTransactionAmountLimitExceededException.java | 7 +-
.../InvalidAccountInformationException.java | 13 +-
.../exception/InvalidBeneficiaryException.java | 7 +-
.../AddSelfBeneficiariesTPTCommandHandler.java | 7 +-
.../DeleteSelfBeneficiariesTPTCommandHandler.java | 7 +-
.../UpdateSelfBeneficiariesTPTCommandHandler.java | 7 +-
.../service/SelfAccountTransferReadService.java | 3 +-
.../SelfAccountTransferReadServiceImpl.java | 59 +-
.../SelfBeneficiariesTPTReadPlatformService.java | 3 +-
...elfBeneficiariesTPTReadPlatformServiceImpl.java | 84 +-
...lfBeneficiariesTPTWritePlatformServiceImpl.java | 67 +-
.../self/client/api/SelfClientsApiResource.java | 144 +-
.../client/api/SelfClientsApiResourceSwagger.java | 88 +-
.../self/client/data/SelfClientDataValidator.java | 21 +-
.../AppuserClientMapperReadServiceImpl.java | 16 +-
.../self/loanaccount/api/SelfLoansApiResource.java | 143 +-
.../api/SelfLoansApiResourceSwagger.java | 172 +-
.../loanaccount/data/SelfLoansDataValidator.java | 98 +-
.../service/AppuserLoansMapperReadServiceImpl.java | 14 +-
.../self/pockets/api/PocketApiResource.java | 98 +-
.../self/pockets/api/PocketApiResourceSwagger.java | 36 +-
.../pockets/data/PocketAccountMappingData.java | 6 +-
.../self/pockets/data/PocketDataValidator.java | 43 +-
.../portfolio/self/pockets/domain/Pocket.java | 6 +-
.../self/pockets/domain/PocketAccountMapping.java | 6 +-
.../PocketAccountMappingRepositoryWrapper.java | 7 +-
.../self/pockets/domain/PocketRepository.java | 2 +-
.../pockets/domain/PocketRepositoryWrapper.java | 5 +-
.../MappingIdNotLinkedToPocketException.java | 5 +-
.../DelinkAccountsFromPocketCommandHandler.java | 1 +
.../service/AccountEntityServiceFactory.java | 19 +-
.../service/AccountEntityServiceForLoanImpl.java | 6 +-
.../AccountEntityServiceForSavingsImpl.java | 3 +-
.../AccountEntityServiceForShareAccountsImpl.java | 1 -
...ocketAccountMappingReadPlatformServiceImpl.java | 10 +-
.../service/PocketWritePlatformService.java | 1 -
.../service/PocketWritePlatformServiceImpl.java | 14 +-
.../products/api/SelfLoanProductsApiResource.java | 217 +-
.../api/SelfSavingsProductsApiResource.java | 3 +-
.../products/api/SelfShareProductsApiResource.java | 9 +-
.../self/registration/SelfServiceApiConstants.java | 14 +-
.../api/SelfServiceRegistrationApiResource.java | 9 +-
.../domain/SelfServiceRegistrationRepository.java | 4 +-
.../SelfServiceRegistrationNotFoundException.java | 4 +-
...erviceRegistrationWritePlatformServiceImpl.java | 20 +-
.../self/runreport/SelfRunReportApiResource.java | 32 +-
.../runreport/SelfRunReportApiResourceSwagger.java | 30 +-
.../self/savings/api/SelfSavingsApiResource.java | 89 +-
.../savings/api/SelfSavingsApiResourceSwagger.java | 76 +-
.../savings/data/SelfSavingsDataValidator.java | 110 +-
.../AppuserSavingsMapperReadServiceImpl.java | 17 +-
.../api/SelfAuthenticationApiResource.java | 12 +-
.../api/SelfAuthenticationApiResourceSwagger.java | 16 +-
.../self/security/api/SelfUserApiResource.java | 54 +-
.../security/api/SelfUserApiResourceSwagger.java | 16 +-
.../security/api/SelfUserDetailsApiResource.java | 21 +-
.../api/SelfUserDetailsApiResourceSwagger.java | 16 +-
.../api/SelfShareAccountsApiResource.java | 231 +-
.../api/SelfShareAccountsApiResourceSwagger.java | 168 +-
.../data/SelfShareAccountsDataValidator.java | 14 +-
...ShareAccountsMapperReadPlatformServiceImpl.java | 18 +-
.../self/spm/api/SelfScorecardApiResource.java | 13 +-
.../portfolio/self/spm/api/SelfSpmApiResource.java | 6 +-
.../data/ShareAccountApplicationTimelineData.java | 8 +-
.../shareaccounts/data/ShareAccountChargeData.java | 12 +-
.../shareaccounts/data/ShareAccountData.java | 87 +-
.../data/ShareAccountDividendData.java | 12 +-
.../data/ShareAccountStatusEnumData.java | 2 +-
.../data/ShareAccountTransactionData.java | 16 +-
.../data/ShareAccountTransactionEnumData.java | 1 -
.../domain/PurchasedSharesStatusType.java | 6 +-
.../shareaccounts/domain/ShareAccount.java | 91 +-
.../shareaccounts/domain/ShareAccountCharge.java | 18 +-
.../domain/ShareAccountChargePaidBy.java | 29 +-
.../domain/ShareAccountDividendRepository.java | 4 +-
.../domain/ShareAccountRepository.java | 1 -
.../domain/ShareAccountRepositoryWrapper.java | 12 +-
.../domain/ShareAccountStatusType.java | 2 +-
.../domain/ShareAccountTransaction.java | 134 +-
.../IssueableSharesExceededException.java | 2 +-
.../ActivateShareAccountCommandHandler.java | 8 +-
.../ApplyAddtionalSharesCommandHandler.java | 8 +-
.../ApproveAddtionalSharesCommandHandler.java | 8 +-
.../handler/ApproveShareAccountCommandHandler.java | 8 +-
.../handler/CloseShareAccountCommandHandler.java | 8 +-
.../handler/CreateShareAccountCommandHandler.java | 8 +-
.../handler/RedeemSharesCommandHandler.java | 8 +-
.../RejectAddtionalSharesCommandHandler.java | 8 +-
.../handler/RejectShareAccountCommandHandler.java | 8 +-
.../UndoApproveShareAccountCommandHandler.java | 8 +-
.../handler/UpdateShareAccountCommandHandler.java | 4 +-
.../serialization/ShareAccountDataSerializer.java | 363 +-
.../PurchasedSharesReadPlatformService.java | 2 +-
.../PurchasedSharesReadPlatformServiceImpl.java | 57 +-
.../ShareAccountChargeReadPlatformService.java | 2 +-
.../ShareAccountChargeReadPlatformServiceImpl.java | 75 +-
.../service/ShareAccountCommandsServiceImpl.java | 35 +-
...hareAccountDividendReadPlatformServiceImpl.java | 3 +-
.../service/ShareAccountReadPlatformService.java | 3 +-
.../ShareAccountReadPlatformServiceImpl.java | 49 +-
.../service/ShareAccountSchedularService.java | 2 -
.../service/ShareAccountWritePlatformService.java | 18 +-
...countWritePlatformServiceJpaRepositoryImpl.java | 85 +-
.../shareaccounts/service/SharesEnumerations.java | 36 +-
.../shareproducts/SharePeriodFrequencyType.java | 1 +
.../api/ShareDividendApiResource.java | 6 +-
.../shareproducts/data/ShareProductData.java | 24 +-
.../data/ShareProductMarketPriceData.java | 10 +-
.../shareproducts/domain/ShareProduct.java | 35 +-
.../domain/ShareProductDividendPayOutDetails.java | 2 +-
.../domain/ShareProductDividendStatusType.java | 1 -
...hareProductDividentPayOutDetailsRepository.java | 4 +-
...ductDividentPayOutDetailsRepositoryWrapper.java | 4 +-
.../domain/ShareProductMarketPrice.java | 16 +-
.../domain/ShareProductRepository.java | 1 -
.../domain/ShareProductRepositoryWrapper.java | 11 +-
.../exception/DividendNotFoundException.java | 2 +-
.../exception/ShareAccountsNotFoundException.java | 3 +-
.../handler/CreateShareProductCommandHandler.java | 4 +-
.../handler/UpdateShareProductCommandHandler.java | 4 +-
.../serialization/ShareProductDataSerializer.java | 112 +-
.../service/ShareProductCommandsServiceImpl.java | 10 +-
.../service/ShareProductDividendAssembler.java | 20 +-
...hareProductDividendReadPlatformServiceImpl.java | 3 +-
.../ShareProductDropdownReadPlatformService.java | 2 +-
...hareProductDropdownReadPlatformServiceImpl.java | 4 +-
.../ShareProductReadPlatformServiceImpl.java | 8 +-
...oductWritePlatformServiceJpaRepositoryImpl.java | 54 +-
.../portfolio/tax/api/TaxComponentApiResource.java | 34 +-
.../tax/api/TaxComponentApiResourceSwagger.java | 40 +-
.../portfolio/tax/api/TaxGroupApiResource.java | 33 +-
.../tax/api/TaxGroupApiResourceSwagger.java | 48 +-
.../portfolio/tax/domain/TaxComponent.java | 8 +-
.../portfolio/tax/domain/TaxComponentHistory.java | 13 +-
.../tax/domain/TaxComponentRepositoryWrapper.java | 3 +-
.../fineract/portfolio/tax/domain/TaxGroup.java | 2 +-
.../tax/domain/TaxGroupRepositoryWrapper.java | 3 +-
.../tax/exception/TaxMappingNotFoundException.java | 2 +-
.../portfolio/tax/serialization/TaxValidator.java | 50 +-
.../portfolio/tax/service/TaxAssembler.java | 4 +-
.../tax/service/TaxReadPlatformServiceImpl.java | 4 +-
.../transfer/api/TransferApiConstants.java | 2 +-
.../transfer/data/TransfersDataValidator.java | 38 +-
...ClientNotAwaitingTransferApprovalException.java | 4 +-
...tAwaitingTransferApprovalOrOnHoldException.java | 4 +-
.../exception/TransferNotSupportedException.java | 11 +-
.../AcceptClientTransferCommandHandler.java | 2 +-
...oposeAndAcceptClientTransferCommandHandler.java | 2 +-
.../ProposeClientTransferCommandHandler.java | 2 +-
.../RejectClientTransferCommandHandler.java | 2 +-
...TransferClientsBetweenGroupsCommandHandler.java | 2 +-
.../WithdrawClientTransferCommandHandler.java | 2 +-
.../transfer/service/TransferEventType.java | 5 +-
.../service/TransferWritePlatformService.java | 2 +-
...nsferWritePlatformServiceJpaRepositoryImpl.java | 66 +-
.../service/ScheduledJobRunnerService.java | 2 +-
.../service/ScheduledJobRunnerServiceImpl.java | 134 +-
.../fineract/spm/api/LookupTableApiResource.java | 35 +-
.../fineract/spm/api/ScorecardApiResource.java | 18 +-
.../apache/fineract/spm/api/SpmApiResource.java | 27 +-
.../apache/fineract/spm/data/ComponentData.java | 3 +-
.../apache/fineract/spm/data/LookupTableData.java | 3 +-
.../org/apache/fineract/spm/data/QuestionData.java | 2 +-
.../org/apache/fineract/spm/data/ResponseData.java | 3 +-
.../apache/fineract/spm/data/ScorecardValue.java | 3 -
.../org/apache/fineract/spm/data/SurveyData.java | 5 +-
.../org/apache/fineract/spm/domain/Survey.java | 8 +-
.../fineract/spm/domain/SurveyValidator.java | 4 +-
.../SurveyResponseNotAvailableException.java | 3 +-
.../spm/repository/LookupTableRepository.java | 1 +
.../spm/repository/ScorecardRepository.java | 1 +
.../fineract/spm/service/LookupTableService.java | 3 +-
.../spm/service/ScorecardReadPlatformService.java | 3 +-
.../service/ScorecardReadPlatformServiceImpl.java | 3 +-
.../fineract/spm/service/ScorecardService.java | 3 +-
.../apache/fineract/spm/service/SpmService.java | 28 +-
.../fineract/spm/util/LookupTableMapper.java | 4 +-
.../apache/fineract/spm/util/ScorecardMapper.java | 30 +-
.../fineract/spm/util/SurveyApiConstants.java | 3 +-
.../org/apache/fineract/spm/util/SurveyMapper.java | 25 +-
.../template/api/TemplatesApiResource.java | 48 +-
.../template/api/TemplatesApiResourcesSwagger.java | 17 +
.../apache/fineract/template/domain/Template.java | 38 +-
.../template/domain/TemplateEntitySerializer.java | 4 +-
.../template/domain/TemplateFunctions.java | 2 +-
.../template/domain/TemplateTypeSerializer.java | 4 +-
.../exception/TemplateNotFoundException.java | 2 +-
.../template/service/JpaTemplateDomainService.java | 40 +-
.../template/service/TemplateMergeService.java | 16 +-
.../fineract/template/service/TrustModifier.java | 9 +-
.../api/PasswordPreferencesApiConstants.java | 3 +-
.../api/PasswordPreferencesApiResource.java | 23 +-
.../api/PasswordPreferencesApiResourceSwagger.java | 5 +
.../api/PermissionsApiResource.java | 33 +-
.../api/PermissionsApiResourceSwagger.java | 8 +-
.../useradministration/api/RolesApiResource.java | 59 +-
.../api/RolesApiResourceSwagger.java | 32 +-
.../useradministration/api/UsersApiResource.java | 60 +-
.../api/UsersApiResourceSwagger.java | 22 +
.../command/PermissionsCommand.java | 2 +-
.../useradministration/data/AppUserData.java | 44 +-
.../data/PasswordValidationPolicyData.java | 2 +-
.../useradministration/data/PermissionData.java | 2 +-
.../fineract/useradministration/data/RoleData.java | 4 +-
.../data/RolePermissionsData.java | 2 +-
.../useradministration/domain/AppUser.java | 42 +-
.../domain/AppUserClientMapping.java | 16 +-
.../domain/AppUserPreviousPassword.java | 2 +-
.../domain/AppUserPreviousPasswordRepository.java | 4 +-
.../domain/AppUserRepositoryWrapper.java | 12 +-
.../domain/JpaUserDomainService.java | 6 +-
.../domain/PasswordValidationPolicy.java | 2 +-
.../domain/PasswordValidationPolicyRepository.java | 6 +-
.../useradministration/domain/RoleRepository.java | 2 +-
.../exception/PasswordPreviouslyUsedException.java | 3 +-
.../PasswordValidationPolicyNotFoundException.java | 5 +-
.../PermissionCantBeMakerCheckerableException.java | 2 +-
.../exception/PermissionNotFoundException.java | 2 +-
.../exception/RoleAssociatedException.java | 3 +-
.../exception/RoleNotFoundException.java | 2 +-
.../exception/UserNotFoundException.java | 2 +-
.../exception/UsernameAlreadyExistsException.java | 2 +-
.../handler/CreateRoleCommandHandler.java | 2 +-
.../handler/CreateUserCommandHandler.java | 2 +-
.../handler/DeleteUserCommandHandler.java | 2 +-
...pdateMakerCheckerPermissionsCommandHandler.java | 2 +-
.../UpdatePasswordPreferencesCommandHandler.java | 2 +-
.../handler/UpdateRoleCommandHandler.java | 2 +-
.../UpdateRolePermissionsCommandHandler.java | 2 +-
.../handler/UpdateUserCommandHandler.java | 2 +-
.../PermissionsCommandFromApiJsonDeserializer.java | 2 +-
.../service/AppUserReadPlatformService.java | 2 +-
.../service/AppUserReadPlatformServiceImpl.java | 18 +-
.../service/AppUserWritePlatformService.java | 2 +-
...pUserWritePlatformServiceJpaRepositoryImpl.java | 43 +-
.../PasswordPreferencesWritePlatformService.java | 2 +-
...asswordValidationPolicyReadPlatformService.java | 2 +-
...ordValidationPolicyReadPlatformServiceImpl.java | 2 +-
.../service/PermissionReadPlatformService.java | 2 +-
.../service/PermissionReadPlatformServiceImpl.java | 5 +-
.../service/PermissionWritePlatformService.java | 2 +-
...ssionWritePlatformServiceJpaRepositoryImpl.java | 6 +-
.../service/RoleDataValidator.java | 2 +-
.../service/RoleReadPlatformService.java | 2 +-
.../service/RoleReadPlatformServiceImpl.java | 5 +-
.../service/RoleWritePlatformService.java | 2 +-
.../RoleWritePlatformServiceJpaRepositoryImpl.java | 17 +-
.../service/UserDataValidator.java | 38 +-
.../src/main/resources/META-INF/orm.xml | 24 +-
.../src/main/resources/META-INF/persistence.xml | 16 +-
.../main/resources/META-INF/spring/appContext.xml | 170 +-
.../src/main/resources/META-INF/spring/cache.xml | 24 +-
.../src/main/resources/META-INF/spring/ehcache.xml | 64 +-
.../resources/META-INF/spring/hikariDataSource.xml | 14 +-
.../resources/META-INF/spring/infrastructure.xml | 48 +-
.../main/resources/META-INF/spring/jdbc.properties | 2 +-
.../resources/META-INF/spring/securityContext.xml | 376 +-
.../main/resources/META-INF/spring/spmContext.xml | 6 +-
.../src/main/resources/META-INF/spring/swagger.xml | 2 +-
.../core_db/V100__Group_saving_summary_report.sql | 2 +-
..._add_mulitplesof_to_account_transfers_table.sql | 2 +-
.../core_db/V102__client_attendance_tables.sql | 30 +-
.../V103__cluster_support_for_batch_jobs.sql | 12 +-
.../core_db/V104__permissions_for_transfers.sql | 2 +-
...V105__track_loan_transaction_against_office.sql | 2 +-
.../V106__more_permissions_for_transfers.sql | 2 +-
.../core_db/V107__datatable_code_mappings.sql | 10 +-
.../core_db/V108__client_has_transfer_office.sql | 6 +-
...count_transfer_withdrawal_fee_configuration.sql | 4 +-
.../V10__interest-posting-fields-for-savings.sql | 2 +-
...suspense_account_for_existing_loan_products.sql | 2 +-
...nstraint_approach_for_datatables_by_default.sql | 2 +-
.../core_db/V112__mixreport_sql_support.sql | 112 +-
...3__track_savings_transaction_against_office.sql | 2 +-
...ccount_for_existing_savings_products - Copy.sql | 2 +-
.../core_db/V115__permissions_for_cache_api.sql | 2 +-
.../V116__track_currency_for_journal_entries.sql | 6 +-
.../core_db/V117__loan_charge_from_savings.sql | 26 +-
.../V118_1__savings_charge_patch_update.sql | 4 +-
...e_duplicate_fund_source_to_account_mappings.sql | 2 +-
...pense_account_for_existing_savings_products.sql | 2 +-
...r_income_from_penalties_for savings_product.sql | 2 +-
...18_7__move_withdrawal_annual_fee_to_charges.sql | 294 +-
...verpayments_seperately_in_loan_transactions.sql | 4 +-
.../migrations/core_db/V118__savings_charge.sql | 72 +-
.../core_db/V119__add_template_table.sql | 6 +-
.../core_db/V11__add-payment-details.sql | 20 +-
.../core_db/V120__accounting_running_balance.sql | 4 +-
...accounting_running_balance_for_organization.sql | 2 +-
.../V122__recurring_fee_support_for_savings.sql | 8 +-
.../V123__remove_payment_mode_for_savings.sql | 2 +-
..._column_for_actual_fee_amount_or_percentage.sql | 2 +-
...initial_database_structure_for_sms_outbound.sql | 2 +-
.../migrations/core_db/V127__mobile_no_fields.sql | 2 +-
.../V128__added_loan_installment_charge.sql | 30 +-
.../core_db/V129__client_and_group_timeline.sql | 2 +-
.../V12__add_external_id_to_couple_of_tables.sql | 14 +-
.../core_db/V130__calendar-history-table.sql | 36 +-
...V131__holiday-status-column-and-permissions.sql | 6 +-
.../core_db/V132__borrower_cycle_changes.sql | 24 +-
...3__adding_payment_detail_with_journal_entry.sql | 8 +-
.../V136_1__update_script_strechy_parameter.sql | 2 +-
.../V137__added_is_active_column_in_m_staff.sql | 2 +-
...me_for_m_product_loan_and_m_savings_product.sql | 16 +-
...ue_for_is_active_updated_to_true_in_m_staff.sql | 4 +-
...ed_payment_detail_id_in_ac_gl_journal_entry.sql | 4 +-
.../core_db/V140__added_loan_charge_status.sql | 2 +-
.../core_db/V144__spelling_mistake_corrections.sql | 2 +-
...add_force_password_reset_in_c_configuration.sql | 2 +-
.../sql/migrations/core_db/V146__tranche_loans.sql | 42 +-
.../V147__tranche_loans_column_name_changes.sql | 6 +-
.../migrations/core_db/V148__overdraft_changes.sql | 14 +-
.../V149__add_created_date_savings_transaction.sql | 4 +-
.../core_db/V14__rename_status_id_to_enum.sql | 2 +-
.../core_db/V150__basic_savings_report.sql | 2 +-
...V151__add_default_savings_account_to_client.sql | 4 +-
.../core_db/V152__added_grace_for_over_due.sql | 4 +-
.../core_db/V153__Insert_missed_permissions.sql | 2 +-
.../sql/migrations/core_db/V154__aging_details.sql | 2 +-
.../core_db/V155__stretchy_into_pentaho.sql | 2 -
.../V156__added_loan_saving_txns_pentaho.sql | 2 +-
.../core_db/V157__overdue_charge_improvements.sql | 18 +-
...action_id_column_m_portfolio_command_source.sql | 2 +-
.../migrations/core_db/V15__center_permissions.sql | 2 +-
...Allow_nullValue_For_principal_on_lonProduct.sql | 2 +-
.../core_db/V160__standing_instruction_changes.sql | 184 +-
.../core_db/V161__added_accrual_batch_job.sql | 6 +-
.../core_db/V162__overdue_charge_batch_job.sql | 2 +-
.../core_db/V163__added_npa_for_loans.sql | 6 +-
.../core_db/V164__fd_and_rd_deposit_tables.sql | 4 +-
...d_permission_for_disburse_to_saving_account.sql | 2 +-
...posit_amount_to_product_term_and_preclosure.sql | 8 +-
...er_fixed_deposit_interest_to_linked_account.sql | 6 +-
...reports_to_core_reports_use_report_to_false.sql | 2 +-
.../V16__drop_min_max_column_on_loan_table.sql | 12 +-
...pdate_deposit_accounts_maturity_details_job.sql | 2 +-
...171__added_mandatory_savings_and_rd_changes.sql | 98 +-
.../V172__accounting_changes_for_transfers.sql | 18 +-
.../resources/sql/migrations/core_db/V173__ppi.sql | 80 +-
.../V175__added_incentive_interest_rates.sql | 66 +-
...176__updates_to_financial_activity_accounts.sql | 8 +-
.../V177__cleanup_for_client_incentives.sql | 2 +-
..._updates_to_financial_activity_accounts_pt2.sql | 2 +-
..._action_names_for_maker_checker_permissions.sql | 2 +-
.../core_db/V17__update_stretchy_reporting_ddl.sql | 2 +-
..._vs_awaitingdisbursal_and_groupnamesbystaff.sql | 2 +-
.../core_db/V181__standing_instruction_logging.sql | 18 +-
...ded_min_required_balance_to_savings_product.sql | 8 +-
..._added_min_balance_for_interest_calculation.sql | 4 +-
...te_min_required_balance_for_savings_product.sql | 4 +-
..._add_accrual_till_date_for_periodic_accrual.sql | 2 +-
.../core_db/V186__added_periodic_accrual_job.sql | 2 +-
.../V187__added_permission_to_periodic_accrual.sql | 2 +-
...8__add_savingscharge_inactivate_permissions.sql | 2 +-
.../V189__m_loan_interest_recalculation_tables.sql | 36 +-
...ssociategroup_disassociategroup_permissions.sql | 2 +-
...update_gl_account_increase_size_of_name_col.sql | 2 +-
.../core_db/V192__interest_recalculate_job.sql | 2 +-
.../V193__added_column_joiningDate_for_staff.sql | 2 +-
...nterestComponent_for_interest_recalculation.sql | 2 +-
...V195__moved_rest_frequency_to_product_level.sql | 12 +-
..._added_loan_running_balance_to_transactions.sql | 2 +-
...pdated_loan_running_balance_of_transactions.sql | 8 +-
...removed_extra_columns_from_schedule_history.sql | 38 +-
.../core_db/V1__mifosplatform-core-ddl-latest.sql | 40 +-
.../sql/migrations/core_db/V201__webhooks.sql | 2 -
.../V202__savings_officer_history_table.sql | 1 -
...ert_script_for_charges_paid_by_for_accruals.sql | 2 +-
...or_charge_and_interest_waiver_with_accruals.sql | 6 +-
.../V206__interest_posting_configuration.sql | 2 +-
.../core_db/V207__min_max_clients_per_group.sql | 4 +-
.../V208__min_max_clients_in_group_redux.sql | 6 +-
.../V210__track_manually_adjusted_transactions.sql | 2 +-
..._days_between_disbursal_and_first_repayment.sql | 2 +-
...V212__add_NthDay_and_DayOfWeek_columns_loan.sql | 2 +-
...ay_and_DayOfWeek_columns_should_be_nullable.sql | 4 +-
.../V215__guarantee_on_hold_fund_changes.sql | 24 +-
.../V216__adding_loan_proposed_amount_to_loan.sql | 4 +-
..._client_substatus_and_codevalue_description.sql | 11 +-
..._and_datetime_for_loan_savings_transactions.sql | 10 +-
..._guarantor_on_hold_fund_changes_for_account.sql | 69 +-
.../V21__activation-permissions-for-clients.sql | 2 +-
.../core_db/V220__account_number_preferences.sql | 12 +-
.../V221__add_version_for_m_savings_account.sql | 2 +-
...antor_on_hold_fund_changes_for_transactions.sql | 15 +-
.../V223__add_version_for_m_loan_account.sql | 2 +-
.../V224__client_lifecycle_adding_statuses.sql | 26 +-
...ation_for_enforcing_calendars_for_jlg_loans.sql | 2 +-
.../core_db/V227__loan-refund-permissions.sql | 15 +-
.../core_db/V228__entity_to_entity_access.sql | 42 +-
.../core_db/V229__teller_cash_management.sql | 204 +-
...alter-group-for-consistency-add-permissions.sql | 2 +-
...0__role_status_and_correspoding_permissions.sql | 2 +-
...__m_cashier_transaction_added_currency_code.sql | 2 +-
.../core_db/V232__insert_center_closure_reason.sql | 2 +-
.../core_db/V233__Savings_Transaction_Receipt.sql | 6 +-
.../core_db/V234__opening_balaces_setup.sql | 46 +-
.../core_db/V235__add_ugd_template_id_m_hook.sql | 2 +-
...36__individual_collection_sheet_permissions.sql | 2 +-
...7__add_threshold_config_for_last_instalment.sql | 8 +-
.../V238__update_staff_display_name_length.sql | 4 +-
...sable-configuration-for-client-group-status.sql | 2 +-
...ars_aging_config_for_interest_recalculation.sql | 6 +-
.../migrations/core_db/V241__fixed_emi_changes.sql | 4 +-
.../V242__entitytoentitymappingrelation.sql | 32 +-
.../V243__alter_loan_disbursement_details.sql | 2 +-
.../V244__staff_assignment_history_table.sql | 2 +-
.../migrations/core_db/V245__open_rd_changes.sql | 1 -
...__drop_group_client_foreign_key_from_m_loan.sql | 2 +-
...pelling_principalThresholdForLastInstalment.sql | 2 +-
.../V248__added_password_never_expired_to_User.sql | 2 +-
.../core_db/V249__workingdays_permissions.sql | 3 -
...client-foreign-key-constraint-in-loan-table.sql | 2 +-
.../core_db/V250__password_validation_policy.sql | 5 -
.../migrations/core_db/V251__paymentType_table.sql | 46 +-
.../V252__bug_fix_teller_cash_management.sql | 10 +-
.../V253__product_loan_configurable_attributes.sql | 4 +-
.../core_db/V254__General_Ledger_Report.sql | 21 +-
.../V255__pre_close_interest_period_config.sql | 2 +-
...56__Update script for General_Ledger_report.sql | 6 +-
.../core_db/V257__staff_image_association.sql | 6 +-
.../core_db/V258__interest_compounding_changes.sql | 16 +-
.../core_db/V259__alter_working_days.sql | 2 +-
...ipt for Client_Loan_Account_Schedule_Report.sql | 4 +-
.../core_db/V262__accountNumber_for_groups.sql | 2 +-
.../sql/migrations/core_db/V263__mifos_reports.sql | 3 -
.../V265__modify_external_service_schema.sql | 17 +-
.../sql/migrations/core_db/V266__client_fees.sql | 97 +-
.../V267__client_transaction_permissions.sql | 2 +-
.../core_db/V268__update_gmail_password.sql | 2 +-
.../V269__increased_calendar_title_length .sql | 6 +-
..._add-support-for-withdrawal-fees-on-savings.sql | 2 +-
.../V270__add_rounding_mode_configuration.sql | 4 +-
.../V271__accounting_for_client_charges.sql | 8 +-
.../V272__loan_tranche_disbursement_charge.sql | 28 +-
.../sql/migrations/core_db/V273__oauth_changes.sql | 1 -
.../core_db/V274__Loan_Reschedule_Code_Value.sql | 4 -
...n_transaction_to_repayment_schedule_mapping.sql | 28 +-
.../core_db/V276__loan_recalulated_till_date.sql | 2 +-
.../core_db/V277__Loan_Product_Provisioning.sql | 129 +-
.../V278__LoanTransactionProcessingStrategy.sql | 9 +-
.../migrations/core_db/V279__floating_rates.sql | 76 +-
.../V27__add-loan-type-column-to-loan-table.sql | 2 +-
.../core_db/V280__spm_framework_initial_tables.sql | 18 +-
..._add_configuration_param_backdate-penalties.sql | 1 -
.../core_db/V282__CustomerSelfService.sql | 16 +-
.../core_db/V283__Variable_Installments.sql | 30 +-
.../migrations/core_db/V284__update_codevalue.sql | 2 +-
.../core_db/V285__undo_last_tranche_script.sql | 1 -
.../V286__partial_period_interest_calcualtion.sql | 13 +-
.../migrations/core_db/V289__client_non_person.sql | 35 +-
...28__accounting-abstractions-and-autoposting.sql | 74 +-
.../V290__shares_dividends_permissions_script.sql | 2 +-
.../V291__organisation_start_date_config.sql | 2 +-
...93__interest_rate_chart_support_for_amounts.sql | 18 +-
.../V296__skip_repayment_on first-day_of_month.sql | 2 +-
.../core_db/V297__Adding_Meeting_Time_column.sql | 2 +-
.../core_db/V298__savings_interest_tax.sql | 177 +-
.../migrations/core_db/V299__share_products.sql | 98 +-
...V29__add-support-for-annual-fees-on-savings.sql | 2 +-
.../V2__mifosx-base-reference-data-utf8.sql | 30 +-
...figuration_for_allow_changing_of_emi_amount.sql | 4 +-
...301__recurring_moratorium_principal_periods.sql | 6 +-
.../V302__add_status_to_client_identifier.sql | 1 -
...customer_self_service_third_party_transfers.sql | 22 +-
...y_freq_and_insertion_script_for_accrual_job.sql | 20 +-
...__add_domancy_tracking_job_to_savings_group.sql | 6 +-
.../migrations/core_db/V307__add_share_notes.sql | 2 +-
...d_interest_recalculation_in_savings_account.sql | 5 +-
.../V309__add_loan_write_off_reason_code.sql | 2 +-
...add-referenceNumber-to-acc_gl_journal_entry.sql | 2 +-
...titytoentityaccess_to_entitytoentitymapping.sql | 4 +-
.../core_db/V311__foreclosure_details.sql | 6 +-
.../V312__add_is_mandatory_to_code_value.sql | 2 +-
.../core_db/V313__multi_rescheduling_script.sql | 64 +-
...ed_with_disbursement_date_in_m_product_loan.sql | 2 +-
.../V316__address_module_tables_metadat.sql | 118 +-
.../core_db/V317__report_mailing_job_module.sql | 6 +-
.../sql/migrations/core_db/V318__topuploan.sql | 23 +-
.../migrations/core_db/V319__client_undoreject.sql | 6 +-
.../V321__boolean_field_As_Interest_PostedOn.sql | 2 +-
.../core_db/V322_1__scheduled_email_campaign.sql | 53 +-
.../core_db/V322_2__email_business_rules.sql | 2 +-
.../sql/migrations/core_db/V322__sms_campaign.sql | 114 +-
.../migrations/core_db/V324__datatable_checks.sql | 24 +-
.../core_db/V325__add_is_staff_client_data.sql | 2 +-
...26__data_migration_for_client_tr_gl_entries.sql | 2 +-
.../core_db/V327__creditbureau_configuration.sql | 8 +-
.../V329__sms_messages_without_campaign.sql | 2 +-
...disassociate-clients-from-group-permissions.sql | 2 +-
...V330__savings_account_transaction_releaseId.sql | 13 +-
.../core_db/V331__holiday_schema_changes.sql | 2 +-
.../V332__self_service_registration_schema.sql | 28 +-
.../sql/migrations/core_db/V333__adhocquery.sql | 28 +-
.../core_db/V334__notification_module_tables.sql | 2 -
.../core_db/V335__self_service_user_role.sql | 2 +-
.../core_db/V336__sms_campaign_notification.sql | 29 +-
.../core_db/V337__equal_amortization.sql | 2 +-
.../core_db/V338__two_factor_authentication.sql | 2 +-
.../core_db/V339__report-run-frequency.sql | 2 +-
.../core_db/V340__nullable-adhoc-email.sql | 2 +-
.../migrations/core_db/V341__m_import_document.sql | 2 +-
...d_paging_recalculate_interest_for_loans_job.sql | 2 +-
.../V345__reports_for_self_service_user.sql | 3 +-
.../V346__nullable_saving_product_description.sql | 2 +-
.../core_db/V348__m_trial_balance_table.sql | 14 +-
.../core_db/V349__client_transfer_details.sql | 40 +-
.../migrations/core_db/V351__pocket_mapping.sql | 26 +-
.../sql/migrations/core_db/V352__interop_init.sql | 34 +-
.../V354__self_service_user_unique_for_client.sql | 2 +-
.../core_db/V356__GSIM_migration_script.sql | 38 +-
.../core_db/V357__GLIM_migration_script.sql | 40 +-
.../V358__fixed_deposit_rollover_transfer.sql | 2 +-
...35__add_hierarchy_column_for_acc_gl_account.sql | 2 +-
.../V36__add_tag_id_column_for_acc_gl_account.sql | 2 +-
.../core_db/V39__payment-channels-updates.sql | 10 +-
.../V40__add_permissions_for_accounting_rule.sql | 2 +-
...efault_value_for_id_for_acc_accounting_rule.sql | 2 +-
.../core_db/V43__accounting-for-savings.sql | 2 +-
.../V44__document-increase-size-of-column-type.sql | 2 +-
.../core_db/V45__create_acc_rule_tags_table.sql | 20 +-
.../migrations/core_db/V48__adding-S3-Support.sql | 44 +-
...V49__track-loan-charge-payment-transactions.sql | 18 +-
.../V50__add-grace-settings-to-loan-product.sql | 2 +-
...-details-related-to-installment-performance.sql | 2 +-
...boolean_support_cols_to_acc_accounting_rule.sql | 2 +-
...ck-advance-and-late-payments-on-installment.sql | 2 +-
.../V54__charge-to-income-account-mappings.sql | 4 +-
...dditional-transaction-processing-strategies.sql | 2 +-
.../V56__track-overpaid-amount-on-loans.sql | 2 +-
...bit_and_credit_accounts_acc_accounting_rule.sql | 4 +-
.../core_db/V58__create-holiday-tables_changed.sql | 16 +-
...V59__add_group_roles_schema_and_permissions.sql | 26 +-
...__update-savings-product-and-account-tables.sql | 2 +-
.../core_db/V60__quipo_dashboard_reports.sql | 96 +-
.../core_db/V61__txn_running_balance_example.sql | 64 +-
.../V62__add_staff_id_to_m_client_changed.sql | 2 +-
...nc_disbursement_with_meeting_column_to_loan.sql | 2 +-
.../V64__add_permission_for_assign_staff.sql | 2 +-
.../core_db/V65__fix_rupee_symbol_issues.sql | 2 +-
.../V68__quipo_dashboard_reports_updated.sql | 96 +-
.../core_db/V69__loans_in_advance_initialise.sql | 2 +-
.../V6__add_min_max_principal_column_to_loan.sql | 8 +-
.../V70__quipo_program_detail_query_fix.sql | 4 +-
...nsert_reschedule_repayment_to_configuration.sql | 2 +-
.../core_db/V72__add_m_loan_counter_changes.sql | 26 +-
...cheduled_to_and_processed_column_to_holiday.sql | 4 +-
.../V74__alter_m_loan_counter_table_add_group.sql | 4 +-
...ule-repayments-on-holidays_to_configuration.sql | 2 +-
.../core_db/V77__alter_m_product_loan_changes.sql | 2 +-
.../core_db/V79__schedule_jobs_tables.sql | 50 +-
.../V7__remove_read_makerchecker_permission.sql | 1 -
.../core_db/V80__schedule_jobs_tables_updates.sql | 18 +-
.../core_db/V81__savings_related_changes.sql | 2 +-
...dule_jobs_tables_updates_for_running_status.sql | 4 +-
.../core_db/V83__non-working-days-table.sql | 10 +-
.../V84__undo_savings_transaction_permission.sql | 2 +-
.../core_db/V85__product_mix_related_changes.sql | 20 +-
.../core_db/V86__update-working-days.sql | 2 +-
.../core_db/V87__add_permission_for_scheduler.sql | 2 +-
...__added_update_constrain_for_scheduler_jobs.sql | 2 +-
.../core_db/V89__added_scheduler_group.sql | 2 +-
...posit-transaction-permissions-if-they-exist.sql | 1 -
...ion_settings_for_holiday_and_non_workingday.sql | 2 +-
.../core_db/V91__apply_annual_fees_permission.sql | 2 +-
.../core_db/V93__loan_transaction_external_id.sql | 2 +-
.../core_db/V94__added_savings_accont type.sql | 2 +-
.../V96__savings_accounts_transfers_table.sql | 2 +-
...d_permission_for_adjust_savings_transaction.sql | 2 +-
.../V98__added_currency_roundof_for_multipleof.sql | 12 +-
...n_max_constraint_column_to_loan_loanproduct.sql | 56 +-
.../V2__externalize-connection-properties.sql | 2 +-
.../list_db/V3__deadlock-retry-properties.sql | 2 +-
...columns_and_tenants_server_connection_table.sql | 77 +-
.../sql/migrations/sample_data/barebones_db.sql | 4424 +++++++++---------
.../migrations/sample_data/interop_sample_data.sql | 2 +-
.../migrations/sample_data/load_sample_data.sql | 4902 ++++++++++----------
.../src/main/resources/swagger-ui/response.json | 2 +-
fineract-provider/src/main/webapp/WEB-INF/web.xml | 14 +-
.../accounting/common/AccountingConstantsTest.java | 9 +-
.../provider/CommandHandlerProviderTest.java | 5 +-
.../java/org/apache/fineract/common/Utils.java | 5 +-
.../ClasspathHellDuplicatesCheckExtension.java | 20 +-
.../ClasspathHellDuplicatesCheckRuleTest.java | 9 +-
.../classdupes/ClasspathHellDuplicatesChecker.java | 137 +-
...TestsWithoutDatabaseAndNoJobsConfiguration.java | 6 +-
.../core/exception/MultiExceptionTest.java | 4 +-
.../security/utils/SQLBuilderTest.java | 11 +-
.../mix/report/service/XBRLBuilderTest.java | 7 +-
.../org/apache/fineract/notification/Listener.java | 4 +-
.../apache/fineract/notification/StorageTest.java | 49 +-
...nRepaymentScheduleTransactionProcessorTest.java | 3 +-
...nRepaymentScheduleTransactionProcessorTest.java | 3 +-
.../LoanProductRelatedDetailTestHelper.java | 10 +-
.../LoanRepaymentScheduleInstallmentBuilder.java | 2 +-
.../loanaccount/LoanScheduleTestDataHelper.java | 4 +-
.../portfolio/loanaccount/MoneyBuilder.java | 2 +-
.../template/TemplateMergeServiceTest.java | 4 +-
2899 files changed, 44580 insertions(+), 46109 deletions(-)
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index ef46d57..f6d1554 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -119,7 +119,7 @@ dependencyManagement {
// FINERACT-940 && FINERACT-966 https://github.com/spotbugs/spotbugs/issues/1128
exclude 'xpp3:xpp3'
exclude 'pull-parser:pull-parser'
- }
+ }
dependencySet(group: 'com.sun.jersey', version: jerseyVersion) {
entry 'jersey-core'
@@ -156,8 +156,8 @@ project.ext.mysqlPassword='mysql'
group = 'org.apache.fineract'
buildDir = new File(rootProject.projectDir, "../build")
repositories {
- jcenter()
- // mavenLocal() // useful for local dev using MariaDB4j SNAPSHOTs (not needed for real-world non-SNAPHOT builds)
+ jcenter()
+ // mavenLocal() // useful for local dev using MariaDB4j SNAPSHOTs (not needed for real-world non-SNAPHOT builds)
}
// If we are running Gradle within Eclipse to enhance classes with OpenJPA,
@@ -167,7 +167,7 @@ if (project.hasProperty('env') && project.getProperty('env') == 'eclipse')
sourceSets.main.java.outputDir = new File(rootProject.projectDir, "bin/main")
}
-eclipse
+eclipse
{
project {
buildCommand([ LaunchConfigHandle: "<project>/.externalToolBuilders/OpenJPA Enhance Builder.launch" ], 'org.eclipse.ui.externaltools.ExternalToolBuilder')
@@ -206,12 +206,12 @@ spotless {
java {
importOrder() //sort imports alphabetically
- removeUnusedImports()
+ removeUnusedImports()
eclipse().configFile '../config/fineractdev-formatter.xml'
endWithNewline()
trimTrailingWhitespace()
}
-
+
lineEndings 'UNIX'
}
@@ -299,25 +299,25 @@ rat {
}
configurations {
- providedRuntime // needed for Spring Boot executable WAR
+ providedRuntime // needed for Spring Boot executable WAR
providedCompile
- compile() {
- exclude module: 'hibernate-entitymanager'
- exclude module: 'hibernate-validator'
- exclude module: 'activation'
- exclude module: 'bcmail-jdk14'
- exclude module: 'bcprov-jdk14'
- exclude module: 'bctsp-jdk14'
- exclude module: 'c3p0'
- exclude module: 'stax-api'
- exclude module: 'jaxb-api'
- exclude module: 'jaxb-impl'
- exclude module: 'jboss-logging'
- exclude module: 'itext-rtf'
- exclude module: 'classworlds'
- }
- runtime
- all*.exclude module: 'jul-to-slf4j' // see FINERACT-700 re. ClassCircularityError: java/util/logging/LogRecord
+ compile() {
+ exclude module: 'hibernate-entitymanager'
+ exclude module: 'hibernate-validator'
+ exclude module: 'activation'
+ exclude module: 'bcmail-jdk14'
+ exclude module: 'bcprov-jdk14'
+ exclude module: 'bctsp-jdk14'
+ exclude module: 'c3p0'
+ exclude module: 'stax-api'
+ exclude module: 'jaxb-api'
+ exclude module: 'jaxb-impl'
+ exclude module: 'jboss-logging'
+ exclude module: 'itext-rtf'
+ exclude module: 'classworlds'
+ }
+ runtime
+ all*.exclude module: 'jul-to-slf4j' // see FINERACT-700 re. ClassCircularityError: java/util/logging/LogRecord
}
tasks.withType(JavaCompile) {
@@ -489,21 +489,21 @@ pmd {
*/
war {
- from('../licenses/binary/') { // notice the parens
- into "WEB-INF/licenses/binary/" // no leading slash
- }
- from('../LICENSE_RELEASE') { // notice the parens
- into "WEB-INF/" // no leading slash
- }
- from('../NOTICE_RELEASE') { // notice the parens
- into "WEB-INF/" // no leading slash
- }
- rename ('LICENSE_RELEASE', 'LICENSE')
- rename ('NOTICE_RELEASE', 'NOTICE')
-
- from('../DISCLAIMER') { // notice the parens
- into "WEB-INF/" // no leading slash
- }
+ from('../licenses/binary/') { // notice the parens
+ into "WEB-INF/licenses/binary/" // no leading slash
+ }
+ from('../LICENSE_RELEASE') { // notice the parens
+ into "WEB-INF/" // no leading slash
+ }
+ from('../NOTICE_RELEASE') { // notice the parens
+ into "WEB-INF/" // no leading slash
+ }
+ rename ('LICENSE_RELEASE', 'LICENSE')
+ rename ('NOTICE_RELEASE', 'NOTICE')
+
+ from('../DISCLAIMER') { // notice the parens
+ into "WEB-INF/" // no leading slash
+ }
war.finalizedBy(bootWar)
}
@@ -588,7 +588,7 @@ if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
sourceSets {
integrationTest {
- compileClasspath += main.output + test.output
+ compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
@@ -608,20 +608,20 @@ task integrationTest(type:Test) {
}
integrationTest {
- useJUnitPlatform()
- testLogging { // FINERACT-927
- events "skipped", "failed"
- showStandardStreams = false
- exceptionFormat "full"
- }
+ useJUnitPlatform()
+ testLogging { // FINERACT-927
+ events "skipped", "failed"
+ showStandardStreams = false
+ exceptionFormat "full"
+ }
}
test {
- useJUnitPlatform()
- testLogging { // FINERACT-927
- events "skipped", "failed"
- showStandardStreams = false
- exceptionFormat "full"
- }
+ useJUnitPlatform()
+ testLogging { // FINERACT-927
+ events "skipped", "failed"
+ showStandardStreams = false
+ exceptionFormat "full"
+ }
}
diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml
index 11098de..d9022f0 100644
--- a/fineract-provider/config/checkstyle/checkstyle.xml
+++ b/fineract-provider/config/checkstyle/checkstyle.xml
@@ -47,7 +47,7 @@
<property name="fileExtensions" value="java"/>
</module>
-->
-
+
<module name="TreeWalker">
<module name="SuppressWarningsHolder" />
<module name="RegexpSinglelineJava">
@@ -114,7 +114,7 @@
</module>
<module name="UpperEll"/>
<module name="NeedBraces"/>
- <module name="ArrayTypeStyle"/>
+ <module name="ArrayTypeStyle"/>
<module name="NoLineWrap"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
@@ -144,14 +144,14 @@
<module name="MutableException"/>
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidHidingCauseExceptionCheck" />
-
-
-
+
+
+
<module name="OuterTypeFilename"/>
-
-
-
+
+
+
<module name="LeftCurly" />
<module name="RightCurly">
<property name="option" value="alone"/>
@@ -168,12 +168,12 @@
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="ParenPad" />
-
+
<module name="MultipleVariableDeclarations"/>
-
+
<module name="MissingSwitchDefault"/>
-
+
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="EmptyLineSeparator">
@@ -211,7 +211,7 @@
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
-
+
<module name="ConstantName" />
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle
index e059d85..cba17e4 100644
--- a/fineract-provider/dependencies.gradle
+++ b/fineract-provider/dependencies.gradle
@@ -22,12 +22,12 @@ dependencies {
spotbugsPlugins "jp.skypencil.findbugs.slf4j:bug-pattern:1.5.0@jar"
spotbugs 'com.github.spotbugs:spotbugs:4.0.4'
- // Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'.
- // Note that we never use 'api', because Fineract at least currently is a simple monolithic application ("WAR"), not a library.
- // We also (normally should have) no need to ever use 'compileOnly'.
+ // Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'.
+ // Note that we never use 'api', because Fineract at least currently is a simple monolithic application ("WAR"), not a library.
+ // We also (normally should have) no need to ever use 'compileOnly'.
- // implementation dependencies are directly used (compiled against) in src/main (and src/test)
- //
+ // implementation dependencies are directly used (compiled against) in src/main (and src/test)
+ //
implementation(
//'ch.vorburger.mariaDB4j:mariaDB4j:2.4.0',
@@ -79,50 +79,50 @@ dependencies {
'com.github.spotbugs:spotbugs-annotations',
)
implementation ('io.swagger:swagger-jersey-jaxrs') {
- exclude group: 'javax.validation'
+ exclude group: 'javax.validation'
}
implementation ('org.apache.activemq:activemq-broker') {
exclude group: 'org.apache.geronimo.specs'
}
implementation ('org.springframework.boot:spring-boot-starter-data-jpa') {
- exclude group: 'org.hibernate'
+ exclude group: 'org.hibernate'
+ }
+ implementation ('org.apache.openjpa:openjpa') {
+ exclude group: 'org.eclipse.persistence'
+ exclude group: 'org.apache.geronimo.specs'
}
- implementation ('org.apache.openjpa:openjpa') {
- exclude group: 'org.eclipse.persistence'
- exclude group: 'org.apache.geronimo.specs'
- }
implementation ('org.quartz-scheduler:quartz') {
exclude group: 'com.zaxxer', module: 'HikariCP-java7'
}
implementation ('com.amazonaws:aws-java-sdk-s3') {
- exclude group: 'commons-logging'
+ exclude group: 'commons-logging'
}
implementation ('org.mnode.ical4j:ical4j') {
- exclude group: 'commons-logging'
+ exclude group: 'commons-logging'
}
implementation ('org.ehcache:ehcache') {
exclude group: 'org.glassfish.jaxb', module: 'jaxb-runtime'
}
- // runtimeOnly dependencies are things that Fineract code has no direct compile time dependency on, but which must be present at run-time
- runtimeOnly(
+ // runtimeOnly dependencies are things that Fineract code has no direct compile time dependency on, but which must be present at run-time
+ runtimeOnly(
'org.apache.bval:org.apache.bval.bundle',
'org.springframework.boot:spring-boot-starter-actuator',
// Although fineract (at the time of writing) doesn't have any compile time dep. on httpclient,
// it's useful to have this for the Spring Boot TestRestTemplate http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-rest-templates-test-utility
'org.apache.httpcomponents:httpclient',
- )
+ )
- // testCompile dependencies are ONLY used in src/test and/or src/integrationTest, not src/main.
- // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
- //
+ // testCompile dependencies are ONLY used in src/test and/or src/integrationTest, not src/main.
+ // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
+ //
testImplementation( 'org.mockito:mockito-core',
'org.mockito:mockito-junit-jupiter',
'org.junit.platform:junit-platform-runner', // required to be able to run tests directly under Eclipse, see FINERACT-943 & FINERACT-1021
'io.github.classgraph:classgraph',
'org.awaitility:awaitility'
- )
+ )
testImplementation ('io.rest-assured:rest-assured') {
exclude group: 'commons-logging'
exclude group: 'org.apache.sling'
diff --git a/fineract-provider/properties/oauth/application.properties b/fineract-provider/properties/oauth/application.properties
index 881ad0e..fbe9c9f 100644
--- a/fineract-provider/properties/oauth/application.properties
+++ b/fineract-provider/properties/oauth/application.properties
@@ -26,4 +26,4 @@ management.info.git.mode=FULL
# FINERACT-914
server.forward-headers-strategy=framework
-spring.cache.jcache.config=classpath:/META-INF/spring/ehcache.xml
\ No newline at end of file
+spring.cache.jcache.config=classpath:/META-INF/spring/ehcache.xml
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountNumberPreferencesTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountNumberPreferencesTest.java
index 299f451..d10110d 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountNumberPreferencesTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountNumberPreferencesTest.java
@@ -152,10 +152,11 @@ public class AccountNumberPreferencesTest {
Integer id = (Integer) preferenceId.get("id");
HashMap<String, Object> delResponse = this.accountNumberPreferencesHelper.deleteAccountNumberPreference(id, this.responseSpec,
"");
- LOG.info("Successfully deleted account number preference (ID: {} )",delResponse.get("resourceId"));
+ LOG.info("Successfully deleted account number preference (ID: {} )", delResponse.get("resourceId"));
}
/* Deletion of invalid account preference ID should fail */
- LOG.info("---------------------------------DELETING ACCOUNT NUMBER PREFERENCE WITH INVALID ID------------------------------------------");
+ LOG.info(
+ "---------------------------------DELETING ACCOUNT NUMBER PREFERENCE WITH INVALID ID------------------------------------------");
HashMap<String, Object> deletionError = this.accountNumberPreferencesHelper.deleteAccountNumberPreference(10,
this.responseNotFoundError, "");
@@ -180,25 +181,25 @@ public class AccountNumberPreferencesTest {
}
private void createAccountNumberPreference() {
- this.clientAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper.createClientAccountNumberPreference(
- this.responseSpec, "resourceId");
- LOG.info("Successfully created account number preferences for Client (ID: {})",this.clientAccountNumberPreferenceId);
+ this.clientAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper
+ .createClientAccountNumberPreference(this.responseSpec, "resourceId");
+ LOG.info("Successfully created account number preferences for Client (ID: {})", this.clientAccountNumberPreferenceId);
- this.loanAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper.createLoanAccountNumberPreference(
- this.responseSpec, "resourceId");
+ this.loanAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper
+ .createLoanAccountNumberPreference(this.responseSpec, "resourceId");
LOG.info("Successfully created account number preferences for Loan (ID: {} )", this.loanAccountNumberPreferenceId);
- this.savingsAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper.createSavingsAccountNumberPreference(
- this.responseSpec, "resourceId");
- LOG.info("Successfully created account number preferences for Savings (ID: {})" , this.savingsAccountNumberPreferenceId);
+ this.savingsAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper
+ .createSavingsAccountNumberPreference(this.responseSpec, "resourceId");
+ LOG.info("Successfully created account number preferences for Savings (ID: {})", this.savingsAccountNumberPreferenceId);
- this.groupsAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper.createGroupsAccountNumberPreference(
- this.responseSpec, "resourceId");
- LOG.info("Successfully created account number preferences for Groups (ID: {})" , this.groupsAccountNumberPreferenceId);
+ this.groupsAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper
+ .createGroupsAccountNumberPreference(this.responseSpec, "resourceId");
+ LOG.info("Successfully created account number preferences for Groups (ID: {})", this.groupsAccountNumberPreferenceId);
- this.centerAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper.createCenterAccountNumberPreference(
- this.responseSpec, "resourceId");
- LOG.info("Successfully created account number preferences for Center (ID: {})" ,this.centerAccountNumberPreferenceId);
+ this.centerAccountNumberPreferenceId = (Integer) this.accountNumberPreferencesHelper
+ .createCenterAccountNumberPreference(this.responseSpec, "resourceId");
+ LOG.info("Successfully created account number preferences for Center (ID: {})", this.centerAccountNumberPreferenceId);
this.accountNumberPreferencesHelper.verifyCreationOfAccountNumberPreferences(this.clientAccountNumberPreferenceId,
this.loanAccountNumberPreferenceId, this.savingsAccountNumberPreferenceId, this.groupsAccountNumberPreferenceId,
@@ -211,10 +212,11 @@ public class AccountNumberPreferencesTest {
private void createAccountNumberPreferenceDuplicateData(final String accountType, final String prefixType) {
/* Creating account Preference with duplicate data should fail */
- LOG.info("---------------------------------CREATING ACCOUNT NUMBER PREFERENCE WITH DUPLICATE DATA------------------------------------------");
+ LOG.info(
+ "---------------------------------CREATING ACCOUNT NUMBER PREFERENCE WITH DUPLICATE DATA------------------------------------------");
- HashMap<String, Object> creationError = this.accountNumberPreferencesHelper.createAccountNumberPreferenceWithInvalidData(
- this.responseForbiddenError, accountType, prefixType, "");
+ HashMap<String, Object> creationError = this.accountNumberPreferencesHelper
+ .createAccountNumberPreferenceWithInvalidData(this.responseForbiddenError, accountType, prefixType, "");
Assertions.assertEquals("error.msg.account.number.format.duplicate.account.type",
creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
@@ -224,34 +226,36 @@ public class AccountNumberPreferencesTest {
private void createAccountNumberPreferenceInvalidData(final String accountType, final String prefixType) {
/* Creating account Preference with invalid data should fail */
- LOG.info("---------------------------------CREATING ACCOUNT NUMBER PREFERENCE WITH INVALID DATA------------------------------------------");
+ LOG.info(
+ "---------------------------------CREATING ACCOUNT NUMBER PREFERENCE WITH INVALID DATA------------------------------------------");
- HashMap<String, Object> creationError = this.accountNumberPreferencesHelper.createAccountNumberPreferenceWithInvalidData(
- this.responseValidationError, accountType, prefixType, "");
+ HashMap<String, Object> creationError = this.accountNumberPreferencesHelper
+ .createAccountNumberPreferenceWithInvalidData(this.responseValidationError, accountType, prefixType, "");
- if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals(
- "validation.msg.accountNumberFormat.accountType.is.not.within.expected.range")) {
+ if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE)
+ .equals("validation.msg.accountNumberFormat.accountType.is.not.within.expected.range")) {
Assertions.assertEquals("validation.msg.accountNumberFormat.accountType.is.not.within.expected.range",
creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
- } else if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).equals(
- "validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations")) {
+ } else if (creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE)
+ .equals("validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations")) {
Assertions.assertEquals("validation.msg.accountNumberFormat.prefixType.is.not.one.of.expected.enumerations",
creationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
}
private void updateAccountNumberPreference() {
- HashMap<String, Object> accountNumberPreferences = this.accountNumberPreferencesHelper.updateAccountNumberPreference(
- this.clientAccountNumberPreferenceId, "101", this.responseSpec, "");
+ HashMap<String, Object> accountNumberPreferences = this.accountNumberPreferencesHelper
+ .updateAccountNumberPreference(this.clientAccountNumberPreferenceId, "101", this.responseSpec, "");
- LOG.info("--------------------------UPDATION SUCCESSFUL FOR ACCOUNT NUMBER PREFERENCE ID {}"
- , accountNumberPreferences.get("resourceId"));
+ LOG.info("--------------------------UPDATION SUCCESSFUL FOR ACCOUNT NUMBER PREFERENCE ID {}",
+ accountNumberPreferences.get("resourceId"));
this.accountNumberPreferencesHelper.verifyUpdationOfAccountNumberPreferences((Integer) accountNumberPreferences.get("resourceId"),
this.responseSpec, this.requestSpec);
/* Update invalid account preference id should fail */
- LOG.info("---------------------------------UPDATING ACCOUNT NUMBER PREFERENCE WITH INVALID DATA------------------------------------------");
+ LOG.info(
+ "---------------------------------UPDATING ACCOUNT NUMBER PREFERENCE WITH INVALID DATA------------------------------------------");
/* Invalid Account Type */
HashMap<String, Object> updationError = this.accountNumberPreferencesHelper.updateAccountNumberPreference(9999, "101",
@@ -260,8 +264,8 @@ public class AccountNumberPreferencesTest {
Assertions.assertEquals("error.msg.resource.not.found", updationError.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
/* Invalid Prefix Type */
- HashMap<String, Object> updationError1 = this.accountNumberPreferencesHelper.updateAccountNumberPreference(
- this.clientAccountNumberPreferenceId, "103", this.responseValidationError, "");
+ HashMap<String, Object> updationError1 = this.accountNumberPreferencesHelper
+ .updateAccountNumberPreference(this.clientAccountNumberPreferenceId, "103", this.responseValidationError, "");
Assertions.assertEquals("validation.msg.validation.errors.exist", updationError1.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
@@ -288,8 +292,8 @@ public class AccountNumberPreferencesTest {
this.groupAccountNo = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "accountNo");
if (isAccountPreferenceSetUp) {
- String groupsPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
- this.groupsAccountNumberPreferenceId, "prefixType.value");
+ String groupsPrefixName = (String) this.accountNumberPreferencesHelper
+ .getAccountNumberPreference(this.groupsAccountNumberPreferenceId, "prefixType.value");
if (groupsPrefixName.equals(this.officeName)) {
@@ -313,8 +317,8 @@ public class AccountNumberPreferencesTest {
Assertions.assertTrue(center.getName().equals(name));
if (isAccountPreferenceSetUp) {
- String centerPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
- this.centerAccountNumberPreferenceId, "prefixType.value");
+ String centerPrefixName = (String) this.accountNumberPreferencesHelper
+ .getAccountNumberPreference(this.centerAccountNumberPreferenceId, "prefixType.value");
final String CENTER_URL = "/fineract-provider/api/v1/centers/" + this.centerId + "?" + Utils.TENANT_IDENTIFIER;
if (centerPrefixName.equals(this.officeName)) {
@@ -326,7 +330,6 @@ public class AccountNumberPreferencesTest {
}
}
-
private void createAndValidateClientWithoutAccountPreference() {
this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assertions.assertNotNull(this.clientId);
@@ -337,8 +340,8 @@ public class AccountNumberPreferencesTest {
private void createAndValidateClientBasedOnAccountPreference() {
final String codeName = "ClientType";
String clientAccountNo = null;
- String clientPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
- this.clientAccountNumberPreferenceId, "prefixType.value");
+ String clientPrefixName = (String) this.accountNumberPreferencesHelper
+ .getAccountNumberPreference(this.clientAccountNumberPreferenceId, "prefixType.value");
if (clientPrefixName.equals(this.clientTypeName)) {
/* Retrieve Code id for the Code "ClientType" */
@@ -390,7 +393,7 @@ public class AccountNumberPreferencesTest {
.withInterestRateFrequencyTypeAsYear().build(null);
this.loanProductId = this.loanTransactionHelper.getLoanProductId(loanProductJSON);
- LOG.info("Successfully created loan product (ID: {} )" , this.loanProductId);
+ LOG.info("Successfully created loan product (ID: {} )", this.loanProductId);
}
private void createAndValidateLoanEntity(Boolean isAccountPreferenceSetUp) {
@@ -405,15 +408,15 @@ public class AccountNumberPreferencesTest {
.withSubmittedOnDate(dateString).withExpectedDisbursementDate(dateString).withPrincipalGrace("2").withInterestGrace("2")
.build(this.clientId.toString(), this.loanProductId.toString(), null);
- LOG.info("Loan Application :{}" , loanApplicationJSON);
+ LOG.info("Loan Application :{}", loanApplicationJSON);
this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
String loanAccountNo = (String) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, this.loanId,
"accountNo");
if (isAccountPreferenceSetUp) {
- String loanPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
- this.loanAccountNumberPreferenceId, "prefixType.value");
+ String loanPrefixName = (String) this.accountNumberPreferencesHelper
+ .getAccountNumberPreference(this.loanAccountNumberPreferenceId, "prefixType.value");
if (loanPrefixName.equals(this.officeName)) {
String loanOfficeName = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(), "officeName");
this.validateAccountNumberLengthAndStartsWithPrefix(loanAccountNo, loanOfficeName);
@@ -422,10 +425,10 @@ public class AccountNumberPreferencesTest {
this.loanProductId, "shortName");
this.validateAccountNumberLengthAndStartsWithPrefix(loanAccountNo, loanShortName);
}
- LOG.info("SUCCESSFULLY CREATED LOAN APPLICATION BASED ON ACCOUNT PREFERENCES (ID: {} )",this.loanId );
+ LOG.info("SUCCESSFULLY CREATED LOAN APPLICATION BASED ON ACCOUNT PREFERENCES (ID: {} )", this.loanId);
} else {
this.validateAccountNumberLengthAndStartsWithPrefix(loanAccountNo, null);
- LOG.info("SUCCESSFULLY CREATED LOAN APPLICATION (ID: {} )",loanId);
+ LOG.info("SUCCESSFULLY CREATED LOAN APPLICATION (ID: {} )", loanId);
}
}
@@ -449,7 +452,7 @@ public class AccountNumberPreferencesTest {
.withMinRequiredBalance(minRequiredBalance).withEnforceMinRequiredBalance(enforceMinRequiredBalance)
.withMinimumOpenningBalance(this.MINIMUM_OPENING_BALANCE).build();
this.savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, this.requestSpec, this.responseSpec);
- LOG.info("Sucessfully created savings product (ID: {} )",this.savingsProductId);
+ LOG.info("Sucessfully created savings product (ID: {} )", this.savingsProductId);
}
@@ -458,14 +461,14 @@ public class AccountNumberPreferencesTest {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
- this.savingsId = this.savingsAccountHelper
- .applyForSavingsApplication(this.clientId, this.savingsProductId, ACCOUNT_TYPE_INDIVIDUAL);
+ this.savingsId = this.savingsAccountHelper.applyForSavingsApplication(this.clientId, this.savingsProductId,
+ ACCOUNT_TYPE_INDIVIDUAL);
String savingsAccountNo = (String) this.savingsAccountHelper.getSavingsAccountDetail(this.savingsId, "accountNo");
if (isAccountPreferenceSetUp) {
- String savingsPrefixName = (String) this.accountNumberPreferencesHelper.getAccountNumberPreference(
- this.savingsAccountNumberPreferenceId, "prefixType.value");
+ String savingsPrefixName = (String) this.accountNumberPreferencesHelper
+ .getAccountNumberPreference(this.savingsAccountNumberPreferenceId, "prefixType.value");
if (savingsPrefixName.equals(this.officeName)) {
String savingsOfficeName = (String) ClientHelper.getClient(requestSpec, responseSpec, this.clientId.toString(),
@@ -475,10 +478,10 @@ public class AccountNumberPreferencesTest {
String loanShortName = (String) this.savingsAccountHelper.getSavingsAccountDetail(this.savingsId, "shortName");
this.validateAccountNumberLengthAndStartsWithPrefix(savingsAccountNo, loanShortName);
}
- LOG.info("SUCCESSFULLY CREATED SAVINGS APPLICATION BASED ON ACCOUNT PREFERENCES (ID: {} )",this.loanId);
+ LOG.info("SUCCESSFULLY CREATED SAVINGS APPLICATION BASED ON ACCOUNT PREFERENCES (ID: {} )", this.loanId);
} else {
this.validateAccountNumberLengthAndStartsWithPrefix(savingsAccountNo, null);
- LOG.info("SUCCESSFULLY CREATED SAVINGS APPLICATION (ID:{} )",this.savingsId);
+ LOG.info("SUCCESSFULLY CREATED SAVINGS APPLICATION (ID:{} )", this.savingsId);
}
}
}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountTransferTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountTransferTest.java
index e8a38d4..8989def 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountTransferTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountTransferTest.java
@@ -127,8 +127,8 @@ public class AccountTransferTest {
*/
@AfterEach
public void tearDown() {
- Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount(
- financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
+ Integer deletedFinancialActivityAccountId = financialActivityAccountHelper
+ .deleteFinancialActivityAccount(financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
@@ -214,10 +214,10 @@ public class AccountTransferTest {
HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(toSavingsID);
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying To Savings Account Balance after Account Transfer");
- final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT),
- JournalEntry.TransactionType.CREDIT) };
- final JournalEntry[] office2LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT),
- JournalEntry.TransactionType.DEBIT) };
+ final JournalEntry[] office1LiabilityEntries = {
+ new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT), JournalEntry.TransactionType.CREDIT) };
+ final JournalEntry[] office2LiabilityEntries = {
+ new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT), JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(fromOfficeId, liabilityTransferAccount,
AccountTransferHelper.ACCOUNT_TRANSFER_DATE, office1LiabilityEntries);
@@ -311,10 +311,10 @@ public class AccountTransferTest {
assertEquals(TRANSFER_AMOUNT_ADJUST, toLoanSummaryAfter.get("totalRepayment"),
"Verifying To Loan Repayment Amount after Account Transfer");
- final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
- JournalEntry.TransactionType.CREDIT) };
- final JournalEntry[] office2LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
- JournalEntry.TransactionType.DEBIT) };
+ final JournalEntry[] office1LiabilityEntries = {
+ new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.CREDIT) };
+ final JournalEntry[] office2LiabilityEntries = {
+ new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(fromOfficeId, liabilityTransferAccount,
AccountTransferHelper.ACCOUNT_TRANSFER_DATE, office1LiabilityEntries);
@@ -432,10 +432,10 @@ public class AccountTransferTest {
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying From Savings Account Balance after Account Transfer");
- final JournalEntry[] office1LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
- JournalEntry.TransactionType.CREDIT) };
- final JournalEntry[] office2LiabilityEntries = { new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST),
- JournalEntry.TransactionType.DEBIT) };
+ final JournalEntry[] office1LiabilityEntries = {
+ new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.CREDIT) };
+ final JournalEntry[] office2LiabilityEntries = {
+ new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(fromOfficeId, liabilityTransferAccount,
AccountTransferHelper.ACCOUNT_TRANSFER_DATE, office1LiabilityEntries);
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java
index bef78f2..3540342 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java
@@ -68,6 +68,7 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings({ "unused", "rawtypes", "unchecked", "static-access" })
public class AccountingScenarioIntegrationTest {
+
private final static Logger LOG = LoggerFactory.getLogger(AccountingScenarioIntegrationTest.class);
private static RequestSpecification requestSpec;
private static ResponseSpecification responseSpec;
@@ -94,7 +95,8 @@ public class AccountingScenarioIntegrationTest {
Float SP_WITHDRAWAL_AMOUNT = Float.valueOf(WITHDRAWAL_AMOUNT);
Float SP_WITHDRAWAL_AMOUNT_ADJUSTED = Float.valueOf(WITHDRAWAL_AMOUNT_ADJUSTED);
- private final String[] REPAYMENT_DATE = { "", "04 May 2011", "04 July 2011", "04 September 2011", "04 November 2011", "04 January 2012" };
+ private final String[] REPAYMENT_DATE = { "", "04 May 2011", "04 July 2011", "04 September 2011", "04 November 2011",
+ "04 January 2012" };
private final Float[] REPAYMENT_AMOUNT = { .0f, 2200.0f, 3000.0f, 900.0f, 2000.0f, 2500.0f };
private final Float AMOUNT_TO_BE_WAIVE = 400.0f;
@@ -274,8 +276,8 @@ public class AccountingScenarioIntegrationTest {
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(this.SP_BALANCE, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountInitialEntry);
- this.journalEntryHelper
- .checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE, liablilityAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
+ liablilityAccountInitialEntry);
// First Transaction-Deposit
this.savingsAccountHelper.depositToSavingsAccount(savingsID, DEPOSIT_AMOUNT, SavingsAccountHelper.TRANSACTION_DATE,
@@ -285,10 +287,10 @@ public class AccountingScenarioIntegrationTest {
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance after Deposit");
LOG.info("----------------------Verifying Journal Entry after the Transaction Deposit----------------------------");
- final JournalEntry[] assetAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
- JournalEntry.TransactionType.DEBIT) };
- final JournalEntry[] liabililityAccountFirstTransactionEntry = { new JournalEntry(this.SP_DEPOSIT_AMOUNT,
- JournalEntry.TransactionType.CREDIT) };
+ final JournalEntry[] assetAccountFirstTransactionEntry = {
+ new JournalEntry(this.SP_DEPOSIT_AMOUNT, JournalEntry.TransactionType.DEBIT) };
+ final JournalEntry[] liabililityAccountFirstTransactionEntry = {
+ new JournalEntry(this.SP_DEPOSIT_AMOUNT, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountFirstTransactionEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
liabililityAccountFirstTransactionEntry);
@@ -301,10 +303,10 @@ public class AccountingScenarioIntegrationTest {
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance after Withdrawal");
LOG.info("-------------------Verifying Journal Entry after the Transaction Withdrawal----------------------");
- final JournalEntry[] assetAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
- JournalEntry.TransactionType.CREDIT) };
- final JournalEntry[] liabililityAccountSecondTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT,
- JournalEntry.TransactionType.DEBIT) };
+ final JournalEntry[] assetAccountSecondTransactionEntry = {
+ new JournalEntry(this.SP_WITHDRAWAL_AMOUNT, JournalEntry.TransactionType.CREDIT) };
+ final JournalEntry[] liabililityAccountSecondTransactionEntry = {
+ new JournalEntry(this.SP_WITHDRAWAL_AMOUNT, JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountSecondTransactionEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
liabililityAccountSecondTransactionEntry);
@@ -322,16 +324,15 @@ public class AccountingScenarioIntegrationTest {
Float chargeAmount = (Float) paidCharge.get("amount");
// Withdrawal after adding Charge of type Withdrawal Fee
- this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsID, WITHDRAWAL_AMOUNT_ADJUSTED,
- SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
+ this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsID, WITHDRAWAL_AMOUNT_ADJUSTED, SavingsAccountHelper.TRANSACTION_DATE,
+ CommonConstants.RESPONSE_RESOURCE_ID);
summary = this.savingsAccountHelper.getSavingsSummary(savingsID);
balance = balance - SP_WITHDRAWAL_AMOUNT_ADJUSTED - chargeAmount;
- final JournalEntry[] liabililityAccountThirdTransactionEntry = {
- new JournalEntry(chargeAmount, JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] liabililityAccountThirdTransactionEntry = { new JournalEntry(chargeAmount, JournalEntry.TransactionType.DEBIT),
new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED, JournalEntry.TransactionType.DEBIT) };
- final JournalEntry[] assetAccountThirdTransactionEntry = { new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED,
- JournalEntry.TransactionType.CREDIT) };
+ final JournalEntry[] assetAccountThirdTransactionEntry = {
+ new JournalEntry(this.SP_WITHDRAWAL_AMOUNT_ADJUSTED, JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] incomeAccountThirdTransactionEntry = { new JournalEntry(chargeAmount, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.TRANSACTION_DATE, assetAccountThirdTransactionEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, this.TRANSACTION_DATE,
@@ -464,8 +465,8 @@ public class AccountingScenarioIntegrationTest {
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, RecurringDepositTest.WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
Assertions.assertNotNull(recurringDepositAccountId);
- HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(
- this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
+ HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker
+ .getStatusOfRecurringDepositAccount(this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
@@ -529,13 +530,14 @@ public class AccountingScenarioIntegrationTest {
LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
- return this.fixedDepositAccountHelper
- .applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
+ return this.fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec,
+ this.responseSpec);
}
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, Account... accounts) {
LOG.info("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
- RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
+ RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec,
+ this.responseSpec);
final String recurringDepositProductJSON = recurringDepositProductHelper //
.withPeriodRangeChart()//
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
@@ -554,7 +556,7 @@ public class AccountingScenarioIntegrationTest {
}
@Test
- public void checkPeriodicAccrualAccountingFlow() throws InterruptedException,ParseException {
+ public void checkPeriodicAccrualAccountingFlow() throws InterruptedException, ParseException {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
@@ -667,7 +669,7 @@ public class AccountingScenarioIntegrationTest {
}
@Test
- public void checkPeriodicAccrualAccountingFlow_OVER_PAYMENT() throws InterruptedException,ParseException {
+ public void checkPeriodicAccrualAccountingFlow_OVER_PAYMENT() throws InterruptedException, ParseException {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
@@ -715,14 +717,14 @@ public class AccountingScenarioIntegrationTest {
final JournalEntry[] assetAccountEntry = { new JournalEntry(15000f, JournalEntry.TransactionType.DEBIT),
new JournalEntry(11000f, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountEntry);
- this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, this.REPAYMENT_DATE[1], new JournalEntry(4000f,
- JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, this.REPAYMENT_DATE[1],
+ new JournalEntry(4000f, JournalEntry.TransactionType.CREDIT));
LOG.info("Repayment Done......");
}
@Test
- public void checkPeriodicAccrualAccountingTillCurrentDateFlow() throws InterruptedException,ParseException {
+ public void checkPeriodicAccrualAccountingTillCurrentDateFlow() throws InterruptedException, ParseException {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
@@ -738,8 +740,8 @@ public class AccountingScenarioIntegrationTest {
final float PENALTY_PORTION = 100.0f;
Integer flat = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(FEE_PORTION), false));
- Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(PENALTY_PORTION), true));
+ Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(PENALTY_PORTION), true));
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -766,10 +768,8 @@ public class AccountingScenarioIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- this.loanTransactionHelper.addChargesForLoan(
- loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate),
- dateFormat.format(todayDate.getTime()), String.valueOf(PENALTY_PORTION)));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(flatSpecifiedDueDate), dateFormat.format(todayDate.getTime()), String.valueOf(PENALTY_PORTION)));
todayDate.add(Calendar.DATE, 1);
this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
String.valueOf(flat), dateFormat.format(todayDate.getTime()), String.valueOf(FEE_PORTION)));
@@ -814,7 +814,7 @@ public class AccountingScenarioIntegrationTest {
}
@Test
- public void checkPeriodicAccrualAccountingAPIFlow() throws ParseException{
+ public void checkPeriodicAccrualAccountingAPIFlow() throws ParseException {
final Account assetAccount = this.accountHelper.createAssetAccount();
final Account incomeAccount = this.accountHelper.createIncomeAccount();
final Account expenseAccount = this.accountHelper.createExpenseAccount();
@@ -833,11 +833,11 @@ public class AccountingScenarioIntegrationTest {
Integer flat = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(FEE_PORTION), false));
- Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(PENALTY_PORTION), true));
+ Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(PENALTY_PORTION), true));
- Integer flatNext = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(NEXT_FEE_PORTION), false));
+ Integer flatNext = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(NEXT_FEE_PORTION), false));
Integer flatSpecifiedDueDateNext = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(NEXT_PENALTY_PORTION), true));
@@ -866,29 +866,20 @@ public class AccountingScenarioIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- this.loanTransactionHelper.addChargesForLoan(
- loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate),
- dateFormat.format(todayDate.getTime()), String.valueOf(PENALTY_PORTION)));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(flatSpecifiedDueDate), dateFormat.format(todayDate.getTime()), String.valueOf(PENALTY_PORTION)));
todayDate.add(Calendar.DATE, 1);
String runOndate = dateFormat.format(todayDate.getTime());
- this.loanTransactionHelper
- .addChargesForLoan(
- loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flat), runOndate,
- String.valueOf(FEE_PORTION)));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flat), runOndate, String.valueOf(FEE_PORTION)));
todayDate.add(Calendar.DATE, 1);
- this.loanTransactionHelper.addChargesForLoan(
- loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDateNext),
- dateFormat.format(todayDate.getTime()), String.valueOf(NEXT_PENALTY_PORTION)));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(flatSpecifiedDueDateNext), dateFormat.format(todayDate.getTime()), String.valueOf(NEXT_PENALTY_PORTION)));
- this.loanTransactionHelper.addChargesForLoan(
- loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatNext),
- dateFormat.format(todayDate.getTime()), String.valueOf(NEXT_FEE_PORTION)));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(flatNext), dateFormat.format(todayDate.getTime()), String.valueOf(NEXT_FEE_PORTION)));
// CHECK ACCOUNT ENTRIES
LOG.info("Entries ......");
@@ -986,8 +977,8 @@ public class AccountingScenarioIntegrationTest {
new JournalEntry(FIRST_PRINCIPAL, JournalEntry.TransactionType.CREDIT) };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[1], assetAccountFirstEntry);
LOG.info("CHECKING INCOME: ******************************************");
- this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[1], new JournalEntry(FIRST_INTEREST,
- JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[1],
+ new JournalEntry(FIRST_INTEREST, JournalEntry.TransactionType.CREDIT));
LOG.info("Repayment 1 Done......");
// REPAYMENT 2
@@ -1001,8 +992,8 @@ public class AccountingScenarioIntegrationTest {
new JournalEntry(SECOND_PRINCIPAL, JournalEntry.TransactionType.CREDIT), };
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, this.REPAYMENT_DATE[2], assetAccountSecondEntry);
LOG.info("CHECKING INCOME: ******************************************");
- this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[2], new JournalEntry(
- SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, this.REPAYMENT_DATE[2],
+ new JournalEntry(SECOND_AND_THIRD_INTEREST, JournalEntry.TransactionType.CREDIT));
LOG.info("Repayment 2 Done ......");
// WAIVE INTEREST
@@ -1053,7 +1044,7 @@ public class AccountingScenarioIntegrationTest {
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
- private LocalDate getDateAsLocalDate(String dateAsString) throws ParseException{
+ private LocalDate getDateAsLocalDate(String dateAsString) throws ParseException {
DateFormat df = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
LocalDate date = new LocalDate(df.parse(dateAsString));
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ActuatorIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ActuatorIntegrationTest.java
index d23ecae..af920e1 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ActuatorIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ActuatorIntegrationTest.java
@@ -33,9 +33,8 @@ public class ActuatorIntegrationTest {
@Test
public void testActuatorGitBuildInfo() {
- Response response = RestAssured.given()
- .headers("Content-Type", ContentType.JSON, "Accept", ContentType.JSON).when()
- .get(INFO_URL).then().contentType(ContentType.JSON).extract().response();
+ Response response = RestAssured.given().headers("Content-Type", ContentType.JSON, "Accept", ContentType.JSON).when().get(INFO_URL)
+ .then().contentType(ContentType.JSON).extract().response();
Map<String, String> gitBuildInfo = response.jsonPath().getMap("git");
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchApiTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchApiTest.java
index 1b2d62b..fbbeca9 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchApiTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchApiTest.java
@@ -58,7 +58,8 @@ public class BatchApiTest {
/**
* Sets up the essential settings for the TEST like contentType,
- * expectedStatusCode. It uses the '@BeforeEach' annotation provided by jUnit.
+ * expectedStatusCode. It uses the '@BeforeEach' annotation provided by
+ * jUnit.
*/
@BeforeEach
public void setup() {
@@ -333,10 +334,10 @@ public class BatchApiTest {
}
/**
- * Tests that batch repayment for loans is happening properly.
- * Collected properly 200(OK) status was returned for successful responses.
- * It first creates a new loan and then makes two repayments for it
- * and then verifies that 200(OK) is returned for the repayment requests.
+ * Tests that batch repayment for loans is happening properly. Collected
+ * properly 200(OK) status was returned for successful responses. It first
+ * creates a new loan and then makes two repayments for it and then verifies
+ * that 200(OK) is returned for the repayment requests.
*
* @see org.apache.fineract.batch.command.internal.RepayLoanCommandStrategy
*/
@@ -482,14 +483,15 @@ public class BatchApiTest {
}
/**
- * Test for the successful create client, apply loan,approval and disbursal of a loan using
- * Batch API with enclosingTransaction. A '200' status code is expected on successful activation.
+ * Test for the successful create client, apply loan,approval and disbursal
+ * of a loan using Batch API with enclosingTransaction. A '200' status code
+ * is expected on successful activation.
*
* @see org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy
* @see org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy
*/
@Test
- public void shouldReturnOkStatusOnSuccessfulLoanApprovalAndDisburseWithTransaction(){
+ public void shouldReturnOkStatusOnSuccessfulLoanApprovalAndDisburseWithTransaction() {
final String loanProductJSON = new LoanProductTestBuilder() //
.withPrincipal("10000000.00") //
.withNumberOfRepayments("24") //
@@ -515,7 +517,7 @@ public class BatchApiTest {
// Create a disburseLoan Request
final BatchRequest br4 = BatchHelper.disburseLoanRequest(4744L, 4743L);
- final List<BatchRequest> batchRequests = Arrays.asList(br1,br2,br3,br4);
+ final List<BatchRequest> batchRequests = Arrays.asList(br1, br2, br3, br4);
final String jsonifiedRequest = BatchHelper.toJsonString(batchRequests);
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java
index f3709ef..4bd25bd 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java
@@ -58,7 +58,8 @@ public class BatchRequestsIntegrationTest {
/**
* Sets up the essential settings for the TEST like contentType,
- * expectedStatusCode. It uses the '@BeforeEach' annotation provided by jUnit.
+ * expectedStatusCode. It uses the '@BeforeEach' annotation provided by
+ * jUnit.
*/
@BeforeEach
public void setup() {
@@ -91,7 +92,7 @@ public class BatchRequestsIntegrationTest {
for (Integer i = 0; i < clientsCount; i++) {
clientIDs[i] = ClientHelper.createClient(this.requestSpec, this.responseSpec);
groupID = GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupID.toString(), clientIDs[i].toString());
- LOG.info("client {} has been added to the group {}",clientIDs[i] , groupID);
+ LOG.info("client {} has been added to the group {}", clientIDs[i], groupID);
}
// Generate a random count of number of new loan products to be created
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CenterIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CenterIntegrationTest.java
index d38e328..258487a 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CenterIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CenterIntegrationTest.java
@@ -42,6 +42,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CenterIntegrationTest {
+
private final static Logger LOG = LoggerFactory.getLogger(CenterIntegrationTest.class);
private RequestSpecification requestSpec;
private ResponseSpecification responseSpec;
@@ -106,8 +107,8 @@ public class CenterIntegrationTest {
Assertions.assertNotNull(paginatedList);
Assertions.assertNotNull(list);
- Assertions.assertTrue(Arrays.equals(paginatedList.toArray(new CenterDomain[paginatedList.size()]),
- list.toArray(new CenterDomain[list.size()])));
+ Assertions.assertTrue(
+ Arrays.equals(paginatedList.toArray(new CenterDomain[paginatedList.size()]), list.toArray(new CenterDomain[list.size()])));
}
@Test
@@ -162,7 +163,7 @@ public class CenterIntegrationTest {
Assertions.assertNotNull(center);
Assertions.assertEquals(newName, center.getName());
Assertions.assertEquals(newExternalId, center.getExternalId());
- Assertions.assertEquals((Integer)newStaffId, center.getStaffId());
+ Assertions.assertEquals((Integer) newStaffId, center.getStaffId());
Assertions.assertArrayEquals(newGroupMembers, center.getGroupMembers());
}
@@ -190,8 +191,8 @@ public class CenterIntegrationTest {
map.put("active", "true");
map.put("activationDate", "04 March 2011");
- groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec, "/fineract-provider/api/v1/groups?"
- + Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "groupId");
+ groupMembers[i] = Utils.performServerPost(requestSpec, responseSpec,
+ "/fineract-provider/api/v1/groups?" + Utils.TENANT_IDENTIFIER, new Gson().toJson(map), "groupId");
}
return groupMembers;
}
@@ -200,7 +201,7 @@ public class CenterIntegrationTest {
public void testStaffAssignmentDuringCenterCreation() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
- LOG.info("--------------creating first staff with id------------- {}" , staffId);
+ LOG.info("--------------creating first staff with id------------- {}", staffId);
Assertions.assertNotNull(staffId);
final int centerWithStaffId = CenterHelper.createCenterWithStaffId(this.requestSpec, this.responseSpec, staffId);
@@ -214,15 +215,14 @@ public class CenterIntegrationTest {
@Test
public void testAssignStaffToCenter() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
- LOG.info("--------------creating first staff with id------------- {}" , staffId);
+ LOG.info("--------------creating first staff with id------------- {}", staffId);
Assertions.assertNotNull(staffId);
final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec);
CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID);
- final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec,
- this.responseSpec, groupID.toString(),
- staffId.longValue());
+ final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec, this.responseSpec,
+ groupID.toString(), staffId.longValue());
assertEquals(assignStaffToCenterResponseMap.get("staffId"), staffId, "Verify assigned staff id is the same as id sent");
final CenterDomain center = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
@@ -235,24 +235,22 @@ public class CenterIntegrationTest {
@Test
public void testUnassignStaffToCenter() {
final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec);
- LOG.info("--------------creating first staff with id------------- {}" , staffId);
+ LOG.info("--------------creating first staff with id------------- {}", staffId);
Assertions.assertNotNull(staffId);
final Integer groupID = CenterHelper.createCenter(this.requestSpec, this.responseSpec);
CenterHelper.verifyCenterCreatedOnServer(this.requestSpec, this.responseSpec, groupID);
- final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec,
- this.responseSpec, groupID.toString(),
- staffId.longValue());
+ final HashMap assignStaffToCenterResponseMap = (HashMap) CenterHelper.assignStaff(this.requestSpec, this.responseSpec,
+ groupID.toString(), staffId.longValue());
assertEquals(assignStaffToCenterResponseMap.get("staffId"), staffId, "Verify assigned staff id is the same as id sent");
final CenterDomain centerWithStaffAssigned = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assertions.assertNotNull(centerWithStaffAssigned);
Assertions.assertTrue(centerWithStaffAssigned.getId().intValue() == groupID);
Assertions.assertTrue(centerWithStaffAssigned.getStaffId().intValue() == staffId);
- final HashMap unassignStaffToCenterResponseMap = (HashMap) CenterHelper.unassignStaff(this.requestSpec,
- this.responseSpec, groupID.toString(),
- staffId.longValue());
+ final HashMap unassignStaffToCenterResponseMap = (HashMap) CenterHelper.unassignStaff(this.requestSpec, this.responseSpec,
+ groupID.toString(), staffId.longValue());
assertEquals(unassignStaffToCenterResponseMap.get("staffId"), null, "Verify staffId is null after unassigning ");
final CenterDomain centerWithStaffUnssigned = CenterHelper.retrieveByID(groupID, requestSpec, responseSpec);
Assertions.assertNotNull(centerWithStaffUnssigned);
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
index 8933dd4..669ed0d 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
@@ -92,8 +92,7 @@ public class ClientLoanIntegrationTest {
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
- this.requestSpec.header("Authorization",
- "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
+ this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
@@ -108,8 +107,8 @@ public class ClientLoanIntegrationTest {
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProduct(false, NONE);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, null, "12,000.00");
- final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
+ loanID);
verifyLoanRepaymentSchedule(loanSchedule);
}
@@ -122,14 +121,13 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProduct(false, NONE);
List<HashMap> charges = new ArrayList<>();
- Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON());
+ Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanDisbursementJSON());
Integer amountPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1"));
addCharges(charges, amountPercentage, "1", null);
- Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
+ Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
addCharges(charges, amountPlusInterestPercentage, "1", null);
Integer interestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "1"));
@@ -141,8 +139,7 @@ public class ClientLoanIntegrationTest {
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap disbursementDetail = loanSchedule.get(0);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -162,17 +159,14 @@ public class ClientLoanIntegrationTest {
validateCharge(flatDisbursement, loanCharges, "100.0", "100.0", "0.0", "0.0");
validateNumberForEqual("352.12", String.valueOf(disbursementDetail.get("feeChargesDue")));
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(amountPercentage, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(amountPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(interestPercentage, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(interestPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
this.loanTransactionHelper.updateChargesForLoan(loanID,
(Integer) getloanCharge(amountPlusInterestPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(flatDisbursement, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(flatDisbursement, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("150"));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -196,8 +190,8 @@ public class ClientLoanIntegrationTest {
validateCharge(flatDisbursement, loanCharges, "150.0", "150.0", "0.0", "0.0");
validateNumberForEqual("570.2", String.valueOf(disbursementDetail.get("feeChargesDue")));
- this.loanTransactionHelper.updateLoan(loanID, updateLoanJson(clientID, loanProductID,
- copyChargesForUpdate(loanCharges, flatDisbursement, "1"), null));
+ this.loanTransactionHelper.updateLoan(loanID,
+ updateLoanJson(clientID, loanProductID, copyChargesForUpdate(loanCharges, flatDisbursement, "1"), null));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -217,8 +211,7 @@ public class ClientLoanIntegrationTest {
validateCharge(flatDisbursement, loanCharges, "100.0", "100.0", "0.0", "0.0");
validateNumberForEqual("100.0", String.valueOf(disbursementDetail.get("feeChargesDue")));
- this.loanTransactionHelper.deleteChargesForLoan(loanID,
- (Integer) getloanCharge(flatDisbursement, loanCharges).get("id"));
+ this.loanTransactionHelper.deleteChargesForLoan(loanID, (Integer) getloanCharge(flatDisbursement, loanCharges).get("id"));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
disbursementDetail = loanSchedule.get(0);
@@ -239,8 +232,8 @@ public class ClientLoanIntegrationTest {
Integer amountPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1"));
addCharges(charges, amountPercentage, "1", null);
- Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
+ Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
addCharges(charges, amountPlusInterestPercentage, "1", null);
Integer interestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "1"));
@@ -252,8 +245,7 @@ public class ClientLoanIntegrationTest {
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap disbursementDetail = loanSchedule.get(0);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -296,18 +288,16 @@ public class ClientLoanIntegrationTest {
Integer flat = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
Integer flatAccTransfer = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT,
- "100", false));
+ ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
- Integer amountPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer amountPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, amountPercentage, "1", "29 September 2011");
- Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentage, "1", "29 September 2011");
- Integer interestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "1", false));
+ Integer interestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "1", false));
addCharges(charges, interestPercentage, "1", "29 September 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
@@ -316,8 +306,7 @@ public class ClientLoanIntegrationTest {
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap firstInstallment = loanSchedule.get(1);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -328,8 +317,8 @@ public class ClientLoanIntegrationTest {
validateNumberForEqual("252.12", String.valueOf(firstInstallment.get("feeChargesDue")));
- this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
- .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flat), "29 September 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID,
+ LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flat), "29 September 2011", "100"));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
firstInstallment = loanSchedule.get(1);
@@ -337,11 +326,9 @@ public class ClientLoanIntegrationTest {
validateCharge(flat, loanCharges, "100.0", "100.0", "0.0", "0.0");
validateNumberForEqual("352.12", String.valueOf(firstInstallment.get("feeChargesDue")));
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(amountPercentage, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(amountPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(interestPercentage, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(interestPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
this.loanTransactionHelper.updateChargesForLoan(loanID,
(Integer) getloanCharge(amountPlusInterestPercentage, loanCharges).get("id"),
@@ -360,8 +347,8 @@ public class ClientLoanIntegrationTest {
final Integer savingsId = SavingsAccountHelper.openSavingsAccount(this.requestSpec, this.responseSpec, clientID,
MINIMUM_OPENING_BALANCE);
- this.loanTransactionHelper.updateLoan(loanID, updateLoanJson(clientID, loanProductID,
- copyChargesForUpdate(loanCharges, null, null), String.valueOf(savingsId)));
+ this.loanTransactionHelper.updateLoan(loanID,
+ updateLoanJson(clientID, loanProductID, copyChargesForUpdate(loanCharges, null, null), String.valueOf(savingsId)));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -405,8 +392,8 @@ public class ClientLoanIntegrationTest {
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);
- this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
- .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatAccTransfer), "29 September 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID,
+ LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatAccTransfer), "29 September 2011", "100"));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
firstInstallment = loanSchedule.get(1);
@@ -418,8 +405,8 @@ public class ClientLoanIntegrationTest {
LOG.info("DISBURSE {}", loanStatusHashMap.toString());
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
- .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(amountPercentage), "29 September 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID,
+ LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(amountPercentage), "29 September 2011", "1"));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
firstInstallment = loanSchedule.get(1);
@@ -427,8 +414,7 @@ public class ClientLoanIntegrationTest {
validateCharge(flatAccTransfer, loanCharges, "100.0", "100.0", "0.0", "0.0");
validateNumberForEqual("200.0", String.valueOf(firstInstallment.get("feeChargesDue")));
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(amountPercentage, loanCharges).get("id"), "");
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(amountPercentage, loanCharges).get("id"), "");
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
firstInstallment = loanSchedule.get(1);
@@ -438,8 +424,7 @@ public class ClientLoanIntegrationTest {
validateNumberForEqual("100.0", String.valueOf(firstInstallment.get("feeChargesOutstanding")));
validateNumberForEqual("100.0", String.valueOf(firstInstallment.get("feeChargesWaived")));
- this.loanTransactionHelper.payChargesForLoan(loanID,
- (Integer) getloanCharge(flatAccTransfer, loanCharges).get("id"),
+ this.loanTransactionHelper.payChargesForLoan(loanID, (Integer) getloanCharge(flatAccTransfer, loanCharges).get("id"),
LoanTransactionHelper.getPayChargeJSON(SavingsAccountHelper.TRANSACTION_DATE, null));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -462,18 +447,17 @@ public class ClientLoanIntegrationTest {
List<HashMap> charges = new ArrayList<>();
Integer flat = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "50", false));
- Integer flatAccTransfer = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentWithAccountTransferJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "50", false));
+ Integer flatAccTransfer = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentWithAccountTransferJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "50", false));
- Integer amountPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer amountPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, amountPercentage, "1", "29 September 2011");
Integer amountPlusInterestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanInstallmentJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentage, "1", "29 September 2011");
- Integer interestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "1", false));
+ Integer interestPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "1", false));
addCharges(charges, interestPercentage, "1", "29 September 2011");
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
@@ -482,8 +466,7 @@ public class ClientLoanIntegrationTest {
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
loanSchedule.remove(0);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -496,19 +479,16 @@ public class ClientLoanIntegrationTest {
Float principalFee = principalDue / 100;
Float interestFee = interestDue / 100;
Float totalInstallmentFee = (principalFee * 2) + (interestFee * 2);
- validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee),
- String.valueOf(installment.get("feeChargesDue")));
+ validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee), String.valueOf(installment.get("feeChargesDue")));
totalPerOfAmout = totalPerOfAmout + principalFee;
totalPerOfAmoutPlusInt = totalPerOfAmoutPlusInt + principalFee + interestFee;
totalPerOfint = totalPerOfint + interestFee;
}
- validateChargeExcludePrecission(amountPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmout), "0.0",
- "0.0");
- validateChargeExcludePrecission(interestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfint), "0.0",
+ validateChargeExcludePrecission(amountPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmout), "0.0", "0.0");
+ validateChargeExcludePrecission(interestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfint), "0.0", "0.0");
+ validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmoutPlusInt), "0.0",
"0.0");
- validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "1.0",
- String.valueOf(totalPerOfAmoutPlusInt), "0.0", "0.0");
this.loanTransactionHelper.addChargesForLoan(loanID,
LoanTransactionHelper.getInstallmentChargesForLoanAsJSON(String.valueOf(flat), "50"));
@@ -524,26 +504,21 @@ public class ClientLoanIntegrationTest {
Float principalFee = principalDue / 100;
Float interestFee = interestDue / 100;
Float totalInstallmentFee = (principalFee * 2) + (interestFee * 2) + 50;
- validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee),
- String.valueOf(installment.get("feeChargesDue")));
+ validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee), String.valueOf(installment.get("feeChargesDue")));
totalPerOfAmout = totalPerOfAmout + principalFee;
totalPerOfAmoutPlusInt = totalPerOfAmoutPlusInt + principalFee + interestFee;
totalPerOfint = totalPerOfint + interestFee;
}
- validateChargeExcludePrecission(amountPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmout), "0.0",
+ validateChargeExcludePrecission(amountPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmout), "0.0", "0.0");
+ validateChargeExcludePrecission(interestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfint), "0.0", "0.0");
+ validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmoutPlusInt), "0.0",
"0.0");
- validateChargeExcludePrecission(interestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfint), "0.0",
- "0.0");
- validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "1.0",
- String.valueOf(totalPerOfAmoutPlusInt), "0.0", "0.0");
validateChargeExcludePrecission(flat, loanCharges, "50.0", "200", "0.0", "0.0");
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(amountPercentage, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(amountPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
- this.loanTransactionHelper.updateChargesForLoan(loanID,
- (Integer) getloanCharge(interestPercentage, loanCharges).get("id"),
+ this.loanTransactionHelper.updateChargesForLoan(loanID, (Integer) getloanCharge(interestPercentage, loanCharges).get("id"),
LoanTransactionHelper.getUpdateChargesForLoanAsJSON("2"));
this.loanTransactionHelper.updateChargesForLoan(loanID,
(Integer) getloanCharge(amountPlusInterestPercentage, loanCharges).get("id"),
@@ -563,25 +538,22 @@ public class ClientLoanIntegrationTest {
Float principalFee = principalDue * 2 / 100;
Float interestFee = interestDue * 2 / 100;
Float totalInstallmentFee = (principalFee * 2) + (interestFee * 2) + 100;
- validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee),
- String.valueOf(installment.get("feeChargesDue")));
+ validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee), String.valueOf(installment.get("feeChargesDue")));
totalPerOfAmout = totalPerOfAmout + principalFee;
totalPerOfAmoutPlusInt = totalPerOfAmoutPlusInt + principalFee + interestFee;
totalPerOfint = totalPerOfint + interestFee;
}
- validateChargeExcludePrecission(amountPercentage, loanCharges, "2.0", String.valueOf(totalPerOfAmout), "0.0",
+ validateChargeExcludePrecission(amountPercentage, loanCharges, "2.0", String.valueOf(totalPerOfAmout), "0.0", "0.0");
+ validateChargeExcludePrecission(interestPercentage, loanCharges, "2.0", String.valueOf(totalPerOfint), "0.0", "0.0");
+ validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "2.0", String.valueOf(totalPerOfAmoutPlusInt), "0.0",
"0.0");
- validateChargeExcludePrecission(interestPercentage, loanCharges, "2.0", String.valueOf(totalPerOfint), "0.0",
- "0.0");
- validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "2.0",
- String.valueOf(totalPerOfAmoutPlusInt), "0.0", "0.0");
validateChargeExcludePrecission(flat, loanCharges, "100.0", "400", "0.0", "0.0");
final Integer savingsId = SavingsAccountHelper.openSavingsAccount(this.requestSpec, this.responseSpec, clientID,
MINIMUM_OPENING_BALANCE);
- this.loanTransactionHelper.updateLoan(loanID, updateLoanJson(clientID, loanProductID,
- copyChargesForUpdate(loanCharges, null, null), String.valueOf(savingsId)));
+ this.loanTransactionHelper.updateLoan(loanID,
+ updateLoanJson(clientID, loanProductID, copyChargesForUpdate(loanCharges, null, null), String.valueOf(savingsId)));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -595,19 +567,16 @@ public class ClientLoanIntegrationTest {
Float principalFee = principalDue * 2 / 100;
Float interestFee = interestDue * 2 / 100;
Float totalInstallmentFee = (principalFee * 2) + (interestFee * 2) + 100;
- validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee),
- String.valueOf(installment.get("feeChargesDue")));
+ validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee), String.valueOf(installment.get("feeChargesDue")));
totalPerOfAmout = totalPerOfAmout + principalFee;
totalPerOfAmoutPlusInt = totalPerOfAmoutPlusInt + principalFee + interestFee;
totalPerOfint = totalPerOfint + interestFee;
}
- validateChargeExcludePrecission(amountPercentage, loanCharges, "2.0", String.valueOf(totalPerOfAmout), "0.0",
+ validateChargeExcludePrecission(amountPercentage, loanCharges, "2.0", String.valueOf(totalPerOfAmout), "0.0", "0.0");
+ validateChargeExcludePrecission(interestPercentage, loanCharges, "2.0", String.valueOf(totalPerOfint), "0.0", "0.0");
+ validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "2.0", String.valueOf(totalPerOfAmoutPlusInt), "0.0",
"0.0");
- validateChargeExcludePrecission(interestPercentage, loanCharges, "2.0", String.valueOf(totalPerOfint), "0.0",
- "0.0");
- validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "2.0",
- String.valueOf(totalPerOfAmoutPlusInt), "0.0", "0.0");
validateChargeExcludePrecission(flat, loanCharges, "100.0", "400", "0.0", "0.0");
this.loanTransactionHelper.updateLoan(loanID,
@@ -625,19 +594,16 @@ public class ClientLoanIntegrationTest {
Float principalFee = principalDue / 100;
Float interestFee = interestDue / 100;
Float totalInstallmentFee = (principalFee * 2) + (interestFee * 2);
- validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee),
- String.valueOf(installment.get("feeChargesDue")));
+ validateNumberForEqualExcludePrecission(String.valueOf(totalInstallmentFee), String.valueOf(installment.get("feeChargesDue")));
totalPerOfAmout = totalPerOfAmout + principalFee;
totalPerOfAmoutPlusInt = totalPerOfAmoutPlusInt + principalFee + interestFee;
totalPerOfint = totalPerOfint + interestFee;
}
- validateChargeExcludePrecission(amountPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmout), "0.0",
- "0.0");
- validateChargeExcludePrecission(interestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfint), "0.0",
+ validateChargeExcludePrecission(amountPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmout), "0.0", "0.0");
+ validateChargeExcludePrecission(interestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfint), "0.0", "0.0");
+ validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "1.0", String.valueOf(totalPerOfAmoutPlusInt), "0.0",
"0.0");
- validateChargeExcludePrecission(amountPlusInterestPercentage, loanCharges, "1.0",
- String.valueOf(totalPerOfAmoutPlusInt), "0.0", "0.0");
charges.clear();
addCharges(charges, flat, "50", "29 September 2011");
@@ -700,12 +666,10 @@ public class ClientLoanIntegrationTest {
for (HashMap installment : loanSchedule) {
validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue")));
if (waivePeriodnum.equals(installment.get("period"))) {
- validateNumberForEqualExcludePrecission("100.0",
- String.valueOf(installment.get("feeChargesOutstanding")));
+ validateNumberForEqualExcludePrecission("100.0", String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived")));
} else {
- validateNumberForEqualExcludePrecission("150.0",
- String.valueOf(installment.get("feeChargesOutstanding")));
+ validateNumberForEqualExcludePrecission("150.0", String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("0.0", String.valueOf(installment.get("feeChargesWaived")));
}
@@ -714,25 +678,21 @@ public class ClientLoanIntegrationTest {
validateChargeExcludePrecission(flat, loanCharges, "50.0", "150", "0.0", "50.0");
Integer payPeriodnum = 2;
- this.loanTransactionHelper.payChargesForLoan(loanID,
- (Integer) getloanCharge(flatAccTransfer, loanCharges).get("id"), LoanTransactionHelper
- .getPayChargeJSON(SavingsAccountHelper.TRANSACTION_DATE, String.valueOf(payPeriodnum)));
+ this.loanTransactionHelper.payChargesForLoan(loanID, (Integer) getloanCharge(flatAccTransfer, loanCharges).get("id"),
+ LoanTransactionHelper.getPayChargeJSON(SavingsAccountHelper.TRANSACTION_DATE, String.valueOf(payPeriodnum)));
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
loanSchedule.remove(0);
for (HashMap installment : loanSchedule) {
validateNumberForEqualExcludePrecission("150", String.valueOf(installment.get("feeChargesDue")));
if (payPeriodnum.equals(installment.get("period"))) {
- validateNumberForEqualExcludePrecission("50.0",
- String.valueOf(installment.get("feeChargesOutstanding")));
+ validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("100.0", String.valueOf(installment.get("feeChargesPaid")));
} else if (waivePeriodnum.equals(installment.get("period"))) {
- validateNumberForEqualExcludePrecission("100.0",
- String.valueOf(installment.get("feeChargesOutstanding")));
+ validateNumberForEqualExcludePrecission("100.0", String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("50.0", String.valueOf(installment.get("feeChargesWaived")));
} else {
- validateNumberForEqualExcludePrecission("150.0",
- String.valueOf(installment.get("feeChargesOutstanding")));
+ validateNumberForEqualExcludePrecission("150.0", String.valueOf(installment.get("feeChargesOutstanding")));
validateNumberForEqualExcludePrecission("0.0", String.valueOf(installment.get("feeChargesPaid")));
}
@@ -754,8 +714,7 @@ public class ClientLoanIntegrationTest {
final Integer savingsId = SavingsAccountHelper.openSavingsAccount(this.requestSpec, this.responseSpec, clientID,
MINIMUM_OPENING_BALANCE);
- final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, savingsId.toString(),
- "12,000.00");
+ final Integer loanID = applyForLoanApplication(clientID, loanProductID, null, savingsId.toString(), "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
@@ -771,8 +730,7 @@ public class ClientLoanIntegrationTest {
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
// DISBURSE
- loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings(SavingsAccountHelper.TRANSACTION_DATE,
- loanID);
+ loanStatusHashMap = this.loanTransactionHelper.disburseLoanToSavings(SavingsAccountHelper.TRANSACTION_DATE, loanID);
LOG.info("DISBURSE {}", loanStatusHashMap.toString());
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
@@ -801,8 +759,7 @@ public class ClientLoanIntegrationTest {
tranches.add(createTrancheDetail("1 March 2014", "25000"));
tranches.add(createTrancheDetail("23 April 2014", "20000"));
- final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, null, "45,000.00",
- tranches);
+ final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, null, "45,000.00", tranches);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
@@ -845,8 +802,8 @@ public class ClientLoanIntegrationTest {
tranches.add(createTrancheDetail("1 March 2014", "25000"));
tranches.add(createTrancheDetail("23 April 2014", "20000"));
- final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, savingsId.toString(),
- "45,000.00", tranches);
+ final Integer loanID = applyForLoanApplicationWithTranches(clientID, loanProductID, null, savingsId.toString(), "45,000.00",
+ tranches);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
@@ -889,31 +846,28 @@ public class ClientLoanIntegrationTest {
}
- private void validateCharge(Integer amountPercentage, final List<HashMap> loanCharges, final String amount,
- final String outstanding, String amountPaid, String amountWaived) {
+ private void validateCharge(Integer amountPercentage, final List<HashMap> loanCharges, final String amount, final String outstanding,
+ String amountPaid, String amountWaived) {
HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges);
- Assertions.assertTrue(Float.valueOf(amount)
- .compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))) == 0);
- Assertions.assertTrue(Float.valueOf(outstanding)
- .compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))) == 0);
- Assertions.assertTrue(Float.valueOf(amountPaid)
- .compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))) == 0);
- Assertions.assertTrue(Float.valueOf(amountWaived)
- .compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))) == 0);
+ Assertions.assertTrue(Float.valueOf(amount).compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))) == 0);
+ Assertions.assertTrue(
+ Float.valueOf(outstanding).compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))) == 0);
+ Assertions.assertTrue(Float.valueOf(amountPaid).compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))) == 0);
+ Assertions.assertTrue(Float.valueOf(amountWaived).compareTo(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))) == 0);
}
- private void validateChargeExcludePrecission(Integer amountPercentage, final List<HashMap> loanCharges,
- final String amount, final String outstanding, String amountPaid, String amountWaived) {
+ private void validateChargeExcludePrecission(Integer amountPercentage, final List<HashMap> loanCharges, final String amount,
+ final String outstanding, String amountPaid, String amountWaived) {
DecimalFormat twoDForm = new DecimalFormat("#");
HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges);
- Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amount))).compareTo(Float
- .valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))))) == 0);
- Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(outstanding))).compareTo(Float
- .valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))))) == 0);
- Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountPaid))).compareTo(
- Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))))) == 0);
- Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountWaived))).compareTo(
- Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))))) == 0);
+ Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amount)))
+ .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))))) == 0);
+ Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(outstanding)))
+ .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))))) == 0);
+ Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountPaid)))
+ .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))))) == 0);
+ Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountWaived)))
+ .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))))) == 0);
}
private void validateNumberForEqual(String val, String val2) {
@@ -921,18 +875,16 @@ public class ClientLoanIntegrationTest {
}
private void validateNumberForEqualWithMsg(String msg, String val, String val2) {
- Assertions.assertTrue(Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0,
- msg + "expected " + val + " but was " + val2);
+ Assertions.assertTrue(Float.valueOf(val).compareTo(Float.valueOf(val2)) == 0, msg + "expected " + val + " but was " + val2);
}
private void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#");
- Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(val)))
- .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
+ Assertions.assertTrue(
+ Float.valueOf(twoDForm.format(Float.valueOf(val))).compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
}
- private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule,
- final Account... accounts) {
+ private Integer createLoanProduct(final boolean multiDisburseLoan, final String accountingRule, final Account... accounts) {
LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
LoanProductTestBuilder builder = new LoanProductTestBuilder() //
.withPrincipal("12,000.00") //
@@ -952,8 +904,7 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
- private Integer createLoanProduct(final String inMultiplesOf, final String digitsAfterDecimal,
- final String repaymentStrategy) {
+ private Integer createLoanProduct(final String inMultiplesOf, final String digitsAfterDecimal, final String repaymentStrategy) {
LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder() //
.withPrincipal("10000000.00") //
@@ -969,8 +920,8 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
- private Integer createLoanProduct(final String inMultiplesOf, final String digitsAfterDecimal,
- final String repaymentStrategy, final String accountingRule, final Account... accounts) {
+ private Integer createLoanProduct(final String inMultiplesOf, final String digitsAfterDecimal, final String repaymentStrategy,
+ final String accountingRule, final Account... accounts) {
LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
final String loanProductJSON = new LoanProductTestBuilder() //
.withPrincipal("10000000.00") //
@@ -982,13 +933,11 @@ public class ClientLoanIntegrationTest {
.withRepaymentStrategy(repaymentStrategy) //
.withAmortizationTypeAsEqualPrincipalPayment() //
.withInterestTypeAsDecliningBalance() //
- .currencyDetails(digitsAfterDecimal, inMultiplesOf).withAccounting(accountingRule, accounts)
- .build(null);
+ .currencyDetails(digitsAfterDecimal, inMultiplesOf).withAccounting(accountingRule, accounts).build(null);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}
- private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID,
- String graceOnPrincipalPayment) {
+ private Integer applyForLoanApplication(final Integer clientID, final Integer loanProductID, String graceOnPrincipalPayment) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("10000000.00") //
@@ -1027,8 +976,8 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
- private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID,
- List<HashMap> charges, final String savingsId, String principal, List<HashMap> tranches) {
+ private Integer applyForLoanApplicationWithTranches(final Integer clientID, final Integer loanProductID, List<HashMap> charges,
+ final String savingsId, String principal, List<HashMap> tranches) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal(principal) //
@@ -1049,8 +998,7 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
- private String updateLoanJson(final Integer clientID, final Integer loanProductID, List<HashMap> charges,
- String savingsId) {
+ private String updateLoanJson(final Integer clientID, final Integer loanProductID, List<HashMap> charges, String savingsId) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("10,000.00") //
@@ -1069,8 +1017,8 @@ public class ClientLoanIntegrationTest {
return loanApplicationJSON;
}
- private Integer applyForLoanApplicationWithPaymentStrategy(final Integer clientID, final Integer loanProductID,
- List<HashMap> charges, final String savingsId, String principal, final String repaymentStrategy) {
+ private Integer applyForLoanApplicationWithPaymentStrategy(final Integer clientID, final Integer loanProductID, List<HashMap> charges,
+ final String savingsId, String principal, final String repaymentStrategy) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal(principal) //
@@ -1090,9 +1038,8 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
- private Integer applyForLoanApplicationWithPaymentStrategyAndPastMonth(final Integer clientID,
- final Integer loanProductID, List<HashMap> charges, final String savingsId, String principal,
- final String repaymentStrategy, final int month) {
+ private Integer applyForLoanApplicationWithPaymentStrategyAndPastMonth(final Integer clientID, final Integer loanProductID,
+ List<HashMap> charges, final String savingsId, String principal, final String repaymentStrategy, final int month) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());
@@ -1119,239 +1066,129 @@ public class ClientLoanIntegrationTest {
}
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
- LOG.info(
- "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
+ LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
- assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)),
- loanSchedule.get(1).get("dueDate"),
+ assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)), loanSchedule.get(1).get("dueDate"),
"Checking for Due Date for 1st Month");
- assertEquals(Float.valueOf("2911.49"),
- loanSchedule.get(1).get("principalOriginalDue"),
- "Checking for Principal Due for 1st Month");
- assertEquals(Float.valueOf("240.00"),
- loanSchedule.get(1).get("interestOriginalDue"),
- "Checking for Interest Due for 1st Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)),
- loanSchedule.get(2).get("dueDate"),
+ assertEquals(Float.valueOf("2911.49"), loanSchedule.get(1).get("principalOriginalDue"), "Checking for Principal Due for 1st Month");
+ assertEquals(Float.valueOf("240.00"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)), loanSchedule.get(2).get("dueDate"),
"Checking for Due Date for 2nd Month");
- assertEquals(Float.valueOf("2969.72"),
- loanSchedule.get(2).get("principalDue"),
- "Checking for Principal Due for 2nd Month");
- assertEquals(Float.valueOf("181.77"),
- loanSchedule.get(2).get("interestOriginalDue"),
- "Checking for Interest Due for 2nd Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)),
- loanSchedule.get(3).get("dueDate"),
+ assertEquals(Float.valueOf("2969.72"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month");
+ assertEquals(Float.valueOf("181.77"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)), loanSchedule.get(3).get("dueDate"),
"Checking for Due Date for 3rd Month");
- assertEquals(Float.valueOf("3029.11"),
- loanSchedule.get(3).get("principalDue"),
- "Checking for Principal Due for 3rd Month");
- assertEquals(Float.valueOf("122.38"),
- loanSchedule.get(3).get("interestOriginalDue"),
- "Checking for Interest Due for 3rd Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)),
- loanSchedule.get(4).get("dueDate"),
+ assertEquals(Float.valueOf("3029.11"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month");
+ assertEquals(Float.valueOf("122.38"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)), loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
- assertEquals(Float.valueOf("3089.68"),
- loanSchedule.get(4).get("principalDue"),
- "Checking for Principal Due for 4th Month");
- assertEquals(Float.valueOf("61.79"),
- loanSchedule.get(4).get("interestOriginalDue"),
- "Checking for Interest Due for 4th Month");
+ assertEquals(Float.valueOf("3089.68"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month");
+ assertEquals(Float.valueOf("61.79"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month");
}
private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList<HashMap> loanSchedule) {
- LOG.info(
- "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
+ LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)),
- loanSchedule.get(1).get("dueDate"),
- "Checking for Due Date for 1st Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(1).get("principalOriginalDue"),
- "Checking for Principal Due for 1st Month");
- assertEquals(Float.valueOf("200000"),
- loanSchedule.get(1).get("interestOriginalDue"),
- "Checking for Interest Due for 1st Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)),
- loanSchedule.get(2).get("dueDate"),
- "Checking for Due Date for 2nd Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(2).get("principalDue"),
- "Checking for Principal Due for 2nd Month");
- assertEquals(Float.valueOf("191700"),
- loanSchedule.get(2).get("interestOriginalDue"),
- "Checking for Interest Due for 2nd Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)),
- loanSchedule.get(3).get("dueDate"),
- "Checking for Due Date for 3rd Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(3).get("principalDue"),
- "Checking for Principal Due for 3rd Month");
- assertEquals(Float.valueOf("183300"),
- loanSchedule.get(3).get("interestOriginalDue"),
- "Checking for Interest Due for 3rd Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)),
- loanSchedule.get(4).get("dueDate"),
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)), loanSchedule.get(1).get("dueDate"), "Checking for Due Date for 1st Month");
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(1).get("principalOriginalDue"), "Checking for Principal Due for 1st Month");
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)), loanSchedule.get(2).get("dueDate"), "Checking for Due Date for 2nd Month");
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month");
+ assertEquals(Float.valueOf("191700"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)), loanSchedule.get(3).get("dueDate"), "Checking for Due Date for 3rd Month");
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month");
+ assertEquals(Float.valueOf("183300"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)), loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(4).get("principalDue"),
- "Checking for Principal Due for 4th Month");
- assertEquals(Float.valueOf("175000"),
- loanSchedule.get(4).get("interestOriginalDue"),
- "Checking for Interest Due for 4th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)),
- loanSchedule.get(5).get("dueDate"),
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month");
+ assertEquals(Float.valueOf("175000"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)), loanSchedule.get(5).get("dueDate"),
"Checking for Due Date for 5th Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(5).get("principalDue"),
- "Checking for Principal Due for 5th Month");
- assertEquals(Float.valueOf("166700"),
- loanSchedule.get(5).get("interestOriginalDue"),
- "Checking for Interest Due for 5th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)),
- loanSchedule.get(6).get("dueDate"),
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(5).get("principalDue"), "Checking for Principal Due for 5th Month");
+ assertEquals(Float.valueOf("166700"), loanSchedule.get(5).get("interestOriginalDue"), "Checking for Interest Due for 5th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)), loanSchedule.get(6).get("dueDate"),
"Checking for Due Date for 6th Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(6).get("principalDue"),
- "Checking for Principal Due for 6th Month");
- assertEquals(Float.valueOf("158300"),
- loanSchedule.get(6).get("interestOriginalDue"),
- "Checking for Interest Due for 6th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)),
- loanSchedule.get(10).get("dueDate"),
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(6).get("principalDue"), "Checking for Principal Due for 6th Month");
+ assertEquals(Float.valueOf("158300"), loanSchedule.get(6).get("interestOriginalDue"), "Checking for Interest Due for 6th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)), loanSchedule.get(10).get("dueDate"),
"Checking for Due Date for 10th Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(10).get("principalDue"),
- "Checking for Principal Due for 10th Month");
- assertEquals(Float.valueOf("125000"),
- loanSchedule.get(10).get("interestOriginalDue"),
- "Checking for Interest Due for 10th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)),
- loanSchedule.get(20).get("dueDate"),
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(10).get("principalDue"), "Checking for Principal Due for 10th Month");
+ assertEquals(Float.valueOf("125000"), loanSchedule.get(10).get("interestOriginalDue"), "Checking for Interest Due for 10th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)), loanSchedule.get(20).get("dueDate"),
"Checking for Due Date for 20th Month");
- assertEquals(Float.valueOf("416700"),
- loanSchedule.get(20).get("principalDue"),
- "Checking for Principal Due for 20th Month");
- assertEquals(Float.valueOf("41700"),
- loanSchedule.get(20).get("interestOriginalDue"),
- "Checking for Interest Due for 20th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)),
- loanSchedule.get(24).get("dueDate"),
+ assertEquals(Float.valueOf("416700"), loanSchedule.get(20).get("principalDue"), "Checking for Principal Due for 20th Month");
+ assertEquals(Float.valueOf("41700"), loanSchedule.get(20).get("interestOriginalDue"), "Checking for Interest Due for 20th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)), loanSchedule.get(24).get("dueDate"),
"Checking for Due Date for 24th Month");
- assertEquals(Float.valueOf("415900"),
- loanSchedule.get(24).get("principalDue"),
- "Checking for Principal Due for 24th Month");
- assertEquals(Float.valueOf("8300"),
- loanSchedule.get(24).get("interestOriginalDue"),
- "Checking for Interest Due for 24th Month");
+ assertEquals(Float.valueOf("415900"), loanSchedule.get(24).get("principalDue"), "Checking for Principal Due for 24th Month");
+ assertEquals(Float.valueOf("8300"), loanSchedule.get(24).get("interestOriginalDue"), "Checking for Interest Due for 24th Month");
}
private void verifyLoanRepaymentScheduleForEqualPrincipalWithGrace(final ArrayList<HashMap> loanSchedule) {
- LOG.info(
- "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
+ LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)),
- loanSchedule.get(1).get("dueDate"),
- "Checking for Due Date for 1st Month");
- validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", String.valueOf(loanSchedule.get(1).get("principalOriginalDue")), "0.0");
- assertEquals(Float.valueOf("200000"),
- loanSchedule.get(1).get("interestOriginalDue"),
- "Checking for Interest Due for 1st Month");
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)), loanSchedule.get(1).get("dueDate"), "Checking for Due Date for 1st Month");
+ validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month",
+ String.valueOf(loanSchedule.get(1).get("principalOriginalDue")), "0.0");
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)),
- loanSchedule.get(2).get("dueDate"),
- "Checking for Due Date for 2nd Month");
- validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0", String.valueOf(loanSchedule.get(2).get("principalOriginalDue")));
- assertEquals(Float.valueOf("200000"),
- loanSchedule.get(2).get("interestOriginalDue"),
- "Checking for Interest Due for 2nd Month");
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)), loanSchedule.get(2).get("dueDate"), "Checking for Due Date for 2nd Month");
+ validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0",
+ String.valueOf(loanSchedule.get(2).get("principalOriginalDue")));
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)),
- loanSchedule.get(3).get("dueDate"),
- "Checking for Due Date for 3rd Month");
- validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0", String.valueOf(loanSchedule.get(3).get("principalDue")));
- assertEquals(Float.valueOf("200000"), loanSchedule.get(3).get("interestOriginalDue"),
- "Checking for Interest Due for 3rd Month");
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)), loanSchedule.get(3).get("dueDate"), "Checking for Due Date for 3rd Month");
+ validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0",
+ String.valueOf(loanSchedule.get(3).get("principalDue")));
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)),
- loanSchedule.get(4).get("dueDate"),
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)), loanSchedule.get(4).get("dueDate"),
"Checking for Due Date for 4th Month");
- validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0", String.valueOf(loanSchedule.get(4).get("principalDue")));
- assertEquals(Float.valueOf("200000"),
- loanSchedule.get(4).get("interestOriginalDue"),
- "Checking for Interest Due for 4th Month");
+ validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0",
+ String.valueOf(loanSchedule.get(4).get("principalDue")));
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)),
- loanSchedule.get(5).get("dueDate"),
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)), loanSchedule.get(5).get("dueDate"),
"Checking for Due Date for 5th Month");
validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0",
String.valueOf(loanSchedule.get(5).get("principalDue")));
- assertEquals(Float.valueOf("200000"),
- loanSchedule.get(5).get("interestOriginalDue"),
- "Checking for Interest Due for 5th Month");
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(5).get("interestOriginalDue"), "Checking for Interest Due for 5th Month");
- assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)),
- loanSchedule.get(6).get("dueDate"),
+ assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)), loanSchedule.get(6).get("dueDate"),
"Checking for Due Date for 6th Month");
- assertEquals(Float.valueOf("526300"),
- loanSchedule.get(6).get("principalDue"),
- "Checking for Principal Due for 6th Month");
- assertEquals(Float.valueOf("200000"),
- loanSchedule.get(6).get("interestOriginalDue"),
- "Checking for Interest Due for 6th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2015, 1, 2)),
- loanSchedule.get(7).get("dueDate"),
- "Checking for Due Date for 7th Month");
- assertEquals(Float.valueOf("526300"),
- loanSchedule.get(7).get("principalDue"),
- "Checking for Principal Due for 7th Month");
- assertEquals(Float.valueOf("189500"),
- loanSchedule.get(7).get("interestOriginalDue"),
- "Checking for Interest Due for 7th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)),
- loanSchedule.get(10).get("dueDate"),
+ assertEquals(Float.valueOf("526300"), loanSchedule.get(6).get("principalDue"), "Checking for Principal Due for 6th Month");
+ assertEquals(Float.valueOf("200000"), loanSchedule.get(6).get("interestOriginalDue"), "Checking for Interest Due for 6th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2015, 1, 2)), loanSchedule.get(7).get("dueDate"), "Checking for Due Date for 7th Month");
+ assertEquals(Float.valueOf("526300"), loanSchedule.get(7).get("principalDue"), "Checking for Principal Due for 7th Month");
+ assertEquals(Float.valueOf("189500"), loanSchedule.get(7).get("interestOriginalDue"), "Checking for Interest Due for 7th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)), loanSchedule.get(10).get("dueDate"),
"Checking for Due Date for 10th Month");
- assertEquals(Float.valueOf("526300"),
- loanSchedule.get(10).get("principalDue"),
- "Checking for Principal Due for 10th Month");
- assertEquals(Float.valueOf("157900"),
- loanSchedule.get(10).get("interestOriginalDue"),
- "Checking for Interest Due for 10th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)),
- loanSchedule.get(20).get("dueDate"),
+ assertEquals(Float.valueOf("526300"), loanSchedule.get(10).get("principalDue"), "Checking for Principal Due for 10th Month");
+ assertEquals(Float.valueOf("157900"), loanSchedule.get(10).get("interestOriginalDue"), "Checking for Interest Due for 10th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)), loanSchedule.get(20).get("dueDate"),
"Checking for Due Date for 20th Month");
- assertEquals(Float.valueOf("526300"),
- loanSchedule.get(20).get("principalDue"),
- "Checking for Principal Due for 20th Month");
- assertEquals(Float.valueOf("52600"),
- loanSchedule.get(20).get("interestOriginalDue"),
- "Checking for Interest Due for 20th Month");
-
- assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)),
- loanSchedule.get(24).get("dueDate"),
+ assertEquals(Float.valueOf("526300"), loanSchedule.get(20).get("principalDue"), "Checking for Principal Due for 20th Month");
+ assertEquals(Float.valueOf("52600"), loanSchedule.get(20).get("interestOriginalDue"), "Checking for Interest Due for 20th Month");
+
+ assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)), loanSchedule.get(24).get("dueDate"),
"Checking for Due Date for 24th Month");
- assertEquals(Float.valueOf("526600"),
- loanSchedule.get(24).get("principalDue"),
- "Checking for Principal Due for 24th Month");
- assertEquals(Float.valueOf("10500"),
- loanSchedule.get(24).get("interestOriginalDue"),
- "Checking for Interest Due for 24th Month");
+ assertEquals(Float.valueOf("526600"), loanSchedule.get(24).get("principalDue"), "Checking for Principal Due for 24th Month");
+ assertEquals(Float.valueOf("10500"), loanSchedule.get(24).get("interestOriginalDue"), "Checking for Interest Due for 24th Month");
}
private void addCharges(List<HashMap> charges, Integer chargeId, String amount, String duedate) {
@@ -1412,8 +1249,8 @@ public class ClientLoanIntegrationTest {
}
/***
- * Test case for checking CashBasedAccounting functionality adding charges with
- * calculation type flat
+ * Test case for checking CashBasedAccounting functionality adding charges
+ * with calculation type flat
*/
@Test
public void loanWithFlatCahargesAndCashBasedAccountingEnabled() {
@@ -1424,8 +1261,7 @@ public class ClientLoanIntegrationTest {
// Add charges with payment mode regular
List<HashMap> charges = new ArrayList<>();
- Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON());
+ Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanDisbursementJSON());
addCharges(charges, flatDisbursement, "100", null);
Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
@@ -1439,15 +1275,13 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
- overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -1476,12 +1310,10 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT));
loanCharges.clear();
@@ -1502,16 +1334,14 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011",
new JournalEntry(Float.valueOf("150.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("240.00"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate),
- "29 October 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 October 2011", "100"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("150.00", String.valueOf(secondInstallment.get("feeChargesDue")));
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(flatInstallmentFee, loanCharges).get("id"),
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get("id"),
LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -1539,9 +1369,8 @@ public class ClientLoanIntegrationTest {
Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(flatPenaltySpecifiedDueDate), "29 September 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "29 September 2011", "100"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(flatPenaltySpecifiedDueDate, loanCharges, "100", "0.00", "100.0", "0.0");
@@ -1567,9 +1396,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011",
new JournalEntry(Float.valueOf("50.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("122.38"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -1598,8 +1426,8 @@ public class ClientLoanIntegrationTest {
}
/***
- * Test case for checking CashBasedAccounting functionality adding charges with
- * calculation type percentage of amount
+ * Test case for checking CashBasedAccounting functionality adding charges
+ * with calculation type percentage of amount
*/
@Test
public void loanWithCahargesOfTypeAmountPercentageAndCashBasedAccountingEnabled() {
@@ -1614,12 +1442,12 @@ public class ClientLoanIntegrationTest {
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1"));
addCharges(charges, percentageDisbursementCharge, "1", null);
- Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, percentageSpecifiedDueDateCharge, "1", "29 September 2011");
- Integer percentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer percentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, percentageInstallmentFee, "1", "29 September 2011");
final Account assetAccount = this.accountHelper.createAssetAccount();
@@ -1627,15 +1455,13 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
- overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -1664,12 +1490,10 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT));
loanCharges.clear();
@@ -1690,16 +1514,14 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011",
new JournalEntry(Float.valueOf("149.11"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("240.00"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("149.70", String.valueOf(secondInstallment.get("feeChargesDue")));
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get("id"),
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get("id"),
LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -1725,11 +1547,10 @@ public class ClientLoanIntegrationTest {
HashMap thirdInstallment = loanSchedule.get(3);
validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding")));
- Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
+ Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, "1", "0.00", "120.0", "0.0");
@@ -1755,9 +1576,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011",
new JournalEntry(Float.valueOf("30.29"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("122.38"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -1786,8 +1606,8 @@ public class ClientLoanIntegrationTest {
}
/***
- * Test case for checking CashBasedAccounting functionality adding charges with
- * calculation type percentage of amount plus interest
+ * Test case for checking CashBasedAccounting functionality adding charges
+ * with calculation type percentage of amount plus interest
*/
@Test
public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndCashBasedAccountingEnabled() {
@@ -1799,18 +1619,15 @@ public class ClientLoanIntegrationTest {
// Add charges with payment mode regular
List<HashMap> charges = new ArrayList<>();
Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
+ ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
addCharges(charges, amountPlusInterestPercentageDisbursementCharge, "1", null);
- Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec,
- responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, "1", "29 September 2011");
Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanInstallmentJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentageInstallmentFee, "1", "29 September 2011");
final Account assetAccount = this.accountHelper.createAssetAccount();
@@ -1818,15 +1635,13 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount,
- overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -1855,12 +1670,10 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT));
loanCharges.clear();
@@ -1881,9 +1694,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011",
new JournalEntry(Float.valueOf("157.57"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("240.00"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -1916,12 +1728,10 @@ public class ClientLoanIntegrationTest {
HashMap thirdInstallment = loanSchedule.get(3);
validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding")));
- Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec,
- responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
+ Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, "1", "0.0", "120.0", "0.0");
@@ -1947,9 +1757,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011",
new JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("122.38"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -1978,8 +1787,8 @@ public class ClientLoanIntegrationTest {
}
/***
- * Test case for checking AccuralUpfrontAccounting functionality adding charges
- * with calculation type flat
+ * Test case for checking AccuralUpfrontAccounting functionality adding
+ * charges with calculation type flat
*/
@Test
public void loanWithFlatCahargesAndUpfrontAccrualAccountingEnabled() {
@@ -1990,8 +1799,7 @@ public class ClientLoanIntegrationTest {
// Add charges with payment mode regular
List<HashMap> charges = new ArrayList<>();
- Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON());
+ Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanDisbursementJSON());
addCharges(charges, flatDisbursement, "100", null);
Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
@@ -2005,15 +1813,14 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
- expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,
+ overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2041,22 +1848,19 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("200.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("200.00"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate),
- "29 September 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 September 2011", "100"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2080,17 +1884,15 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate),
- "29 October 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 October 2011", "100"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("150.00", String.valueOf(secondInstallment.get("feeChargesDue")));
LOG.info("----------- Waive installment charge for 2nd installment ---------");
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(flatInstallmentFee, loanCharges).get("id"),
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get("id"),
LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2127,9 +1929,8 @@ public class ClientLoanIntegrationTest {
Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(flatPenaltySpecifiedDueDate), "29 September 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "29 September 2011", "100"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(flatPenaltySpecifiedDueDate, loanCharges, "100", "0.00", "100.0", "0.0");
@@ -2149,9 +1950,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011",
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -2176,14 +1976,13 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.CREDIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, "20 January 2012",
new JournalEntry(Float.valueOf("80.92"), JournalEntry.TransactionType.CREDIT));
- loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
- loanID, "status");
+ loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status");
LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);
}
/***
- * Test case for checking AccuralUpfrontAccounting functionality adding charges
- * with calculation type percentage of amount
+ * Test case for checking AccuralUpfrontAccounting functionality adding
+ * charges with calculation type percentage of amount
*/
@Test
public void loanWithCahargesAndUpfrontAccrualAccountingEnabled() {
@@ -2198,12 +1997,12 @@ public class ClientLoanIntegrationTest {
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1"));
addCharges(charges, percentageDisbursementCharge, "1", null);
- Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, percentageSpecifiedDueDateCharge, "1", "29 September 2011");
- Integer percentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer percentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, percentageInstallmentFee, "1", "29 September 2011");
final Account assetAccount = this.accountHelper.createAssetAccount();
@@ -2211,15 +2010,14 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
- expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,
+ overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2248,15 +2046,13 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT),
@@ -2278,17 +2074,15 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("149.70", String.valueOf(secondInstallment.get("feeChargesDue")));
LOG.info("----------- Waive installment charge for 2nd installment ---------");
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get("id"),
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get("id"),
LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2323,11 +2117,10 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011",
new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT));
- Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
+ Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, "1", "0.00", "120.0", "0.0");
@@ -2347,9 +2140,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011",
new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -2374,14 +2166,13 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.CREDIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, "20 January 2012",
new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT));
- loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
- loanID, "status");
+ loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status");
LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);
}
/***
- * Test case for checking AccuralUpfrontAccounting functionality adding charges
- * with calculation type percentage of amount plus interest
+ * Test case for checking AccuralUpfrontAccounting functionality adding
+ * charges with calculation type percentage of amount plus interest
*/
@Test
public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndUpfrontAccrualAccountingEnabled() {
@@ -2393,17 +2184,14 @@ public class ClientLoanIntegrationTest {
// Add charges with payment mode regular
List<HashMap> charges = new ArrayList<>();
Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
+ ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
addCharges(charges, amountPlusInterestPercentageDisbursementCharge, "1", null);
- Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec,
- responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanInstallmentJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentageInstallmentFee, "1", "29 September 2011");
final Account assetAccount = this.accountHelper.createAssetAccount();
@@ -2411,15 +2199,14 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount,
- expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,
+ overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2447,22 +2234,19 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("126.04"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("126.04"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 September 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2486,9 +2270,8 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -2531,12 +2314,10 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011",
new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT));
- Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec,
- responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
+ Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, "1", "0.0", "120.0", "0.0");
@@ -2556,9 +2337,8 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011",
new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -2583,14 +2363,13 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.CREDIT));
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, "20 January 2012",
new JournalEntry(Float.valueOf("100.42"), JournalEntry.TransactionType.CREDIT));
- loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
- loanID, "status");
+ loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status");
LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);
}
/***
- * Test case for checking AccuralPeriodicAccounting functionality adding charges
- * with calculation type flat
+ * Test case for checking AccuralPeriodicAccounting functionality adding
+ * charges with calculation type flat
*/
@Test
public void loanWithFlatChargesAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
@@ -2601,8 +2380,7 @@ public class ClientLoanIntegrationTest {
// Add charges with payment mode regular
List<HashMap> charges = new ArrayList<>();
- Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON());
+ Integer flatDisbursement = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanDisbursementJSON());
addCharges(charges, flatDisbursement, "100", null);
Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
@@ -2616,15 +2394,14 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
- expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,
+ overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2653,12 +2430,10 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT));
loanCharges.clear();
@@ -2677,28 +2452,28 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate),
- "29 October 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 October 2011", "100"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("150.00", String.valueOf(secondInstallment.get("feeChargesDue")));
LOG.info("----------- Waive installment charge for 2nd installment ---------");
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(flatInstallmentFee, loanCharges).get("id"),
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get("id"),
LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(flatInstallmentFee, loanCharges, "50", "100.00", "50.0", "50.0");
/*
- * this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount,
- * "20 September 2011", new JournalEntry(Float.valueOf("50.0"),
+ * this.journalEntryHelper.checkJournalEntryForAssetAccount(
+ * assetAccount, "20 September 2011", new
+ * JournalEntry(Float.valueOf("50.0"),
* JournalEntry.TransactionType.CREDIT));
- * this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount,
- * "20 September 2011", new JournalEntry(Float.valueOf("50.0"),
+ * this.journalEntryHelper.checkJournalEntryForExpenseAccount
+ * (expenseAccount, "20 September 2011", new
+ * JournalEntry(Float.valueOf("50.0"),
* JournalEntry.TransactionType.DEBIT));
*/
final String jobName = "Add Accrual Transactions";
@@ -2735,9 +2510,8 @@ public class ClientLoanIntegrationTest {
Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(flatPenaltySpecifiedDueDate), "29 September 2011", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "29 September 2011", "100"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(flatPenaltySpecifiedDueDate, loanCharges, "100", "0.00", "100.0", "0.0");
@@ -2758,9 +2532,8 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -2783,14 +2556,13 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012",
new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.CREDIT));
- loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
- loanID, "status");
+ loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status");
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
}
/**
- * Test case for checking AccuralPeriodicAccounting functionality adding charges
- * with calculation type percentage of amount
+ * Test case for checking AccuralPeriodicAccounting functionality adding
+ * charges with calculation type percentage of amount
*/
@Test
public void loanWithChargesOfTypeAmountPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
@@ -2805,12 +2577,12 @@ public class ClientLoanIntegrationTest {
ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1"));
addCharges(charges, percentageDisbursementCharge, "1", null);
- Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, percentageSpecifiedDueDateCharge, "1", "29 September 2011");
- Integer percentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
+ Integer percentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", false));
addCharges(charges, percentageInstallmentFee, "1", "29 September 2011");
final Account assetAccount = this.accountHelper.createAssetAccount();
@@ -2818,15 +2590,14 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
- expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,
+ overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -2855,12 +2626,10 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT));
loanCharges.clear();
@@ -2879,28 +2648,28 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("149.70", String.valueOf(secondInstallment.get("feeChargesDue")));
LOG.info("----------- Waive installment charge for 2nd installment ---------");
- this.loanTransactionHelper.waiveChargesForLoan(loanID,
- (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get("id"),
+ this.loanTransactionHelper.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get("id"),
LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(percentageInstallmentFee, loanCharges, "1", "61.19", "29.11", "29.70");
/*
- * this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount,
- * "20 September 2011", new JournalEntry(Float.valueOf("29.7"),
+ * this.journalEntryHelper.checkJournalEntryForAssetAccount(
+ * assetAccount, "20 September 2011", new
+ * JournalEntry(Float.valueOf("29.7"),
* JournalEntry.TransactionType.CREDIT));
- * this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount,
- * "20 September 2011", new JournalEntry(Float.valueOf("29.7"),
+ * this.journalEntryHelper.checkJournalEntryForExpenseAccount
+ * (expenseAccount, "20 September 2011", new
+ * JournalEntry(Float.valueOf("29.7"),
* JournalEntry.TransactionType.DEBIT));
*/
@@ -2936,11 +2705,10 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011",
new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT));
- Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
+ Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, "1", "0.00", "120.0", "0.0");
@@ -2961,9 +2729,8 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper
+ .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -2986,18 +2753,16 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012",
new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.CREDIT));
- loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
- loanID, "status");
+ loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status");
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
}
/***
- * Test case for checking AccuralPeriodicAccounting functionality adding charges
- * with calculation type percentage of amount and interest
+ * Test case for checking AccuralPeriodicAccounting functionality adding
+ * charges with calculation type percentage of amount and interest
*/
@Test
- public void loanWithChargesOfTypeAmountPlusInterestPercentageAndPeriodicAccrualAccountingEnabled()
- throws InterruptedException {
+ public void loanWithChargesOfTypeAmountPlusInterestPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
@@ -3006,18 +2771,15 @@ public class ClientLoanIntegrationTest {
// Add charges with payment mode regular
List<HashMap> charges = new ArrayList<>();
Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanDisbursementJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
+ ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1"));
addCharges(charges, amountPlusInterestPercentageDisbursementCharge, "1", null);
- Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec,
- responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
+ .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, "1", "29 September 2011");
Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(requestSpec, responseSpec,
- ChargesHelper.getLoanInstallmentJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, "1", false));
addCharges(charges, amountPlusInterestPercentageInstallmentFee, "1", "29 September 2011");
final Account assetAccount = this.accountHelper.createAssetAccount();
@@ -3025,15 +2787,14 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount,
- expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,
+ overpaymentAccount);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, "12,000.00");
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
verifyLoanRepaymentSchedule(loanSchedule);
List<HashMap> loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
@@ -3062,12 +2823,10 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011",
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry);
this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011",
new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT));
loanCharges.clear();
@@ -3086,9 +2845,8 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
@@ -3103,11 +2861,12 @@ public class ClientLoanIntegrationTest {
validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "63.02", "31.51", "31.51");
/*
- * this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount,
- * "20 September 2011", new JournalEntry( Float.valueOf("31.51"),
- * JournalEntry.TransactionType.CREDIT));
- * this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount,
- * "20 September 2011", new JournalEntry(Float.valueOf("31.51"),
+ * this.journalEntryHelper.checkJournalEntryForAssetAccount(
+ * assetAccount, "20 September 2011", new JournalEntry(
+ * Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT));
+ * this.journalEntryHelper.checkJournalEntryForExpenseAccount
+ * (expenseAccount, "20 September 2011", new
+ * JournalEntry(Float.valueOf("31.51"),
* JournalEntry.TransactionType.DEBIT));
*/
@@ -3143,12 +2902,10 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011",
new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT));
- Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec,
- responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(
- ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
+ Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "29 September 2011", "1"));
loanCharges.clear();
loanCharges = this.loanTransactionHelper.getLoanCharges(loanID);
validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, "1", "0.0", "120.0", "0.0");
@@ -3169,9 +2926,8 @@ public class ClientLoanIntegrationTest {
new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.CREDIT));
- this.loanTransactionHelper.addChargesForLoan(loanID,
- LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
- String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
+ this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(
+ String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1"));
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -3194,8 +2950,7 @@ public class ClientLoanIntegrationTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012",
new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.CREDIT));
- loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec,
- loanID, "status");
+ loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status");
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
}
@@ -3207,8 +2962,8 @@ public class ClientLoanIntegrationTest {
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, null);
- final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
+ loanID);
verifyLoanRepaymentScheduleForEqualPrincipal(loanSchedule);
}
@@ -3221,8 +2976,8 @@ public class ClientLoanIntegrationTest {
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProduct("100", "0", LoanProductTestBuilder.DEFAULT_STRATEGY);
final Integer loanID = applyForLoanApplication(clientID, loanProductID, "5");
- final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
+ loanID);
verifyLoanRepaymentScheduleForEqualPrincipalWithGrace(loanSchedule);
}
@@ -3248,8 +3003,8 @@ public class ClientLoanIntegrationTest {
*/
final String savingsId = null;
final String principal = "12,000.00";
- final Integer loanID = applyForLoanApplicationWithPaymentStrategy(clientID, loanProductID, null, savingsId,
- principal, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY);
+ final Integer loanID = applyForLoanApplicationWithPaymentStrategy(clientID, loanProductID, null, savingsId, principal,
+ LoanApplicationTestBuilder.RBI_INDIA_STRATEGY);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -3263,8 +3018,7 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap firstInstallment = loanSchedule.get(1);
validateNumberForEqual("3200", String.valueOf(firstInstallment.get("totalOutstandingForPeriod")));
@@ -3297,17 +3051,18 @@ public class ClientLoanIntegrationTest {
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
/***
- * Verify 2nd and 3rd repayments after making excess payment for installment no
- * 2
+ * Verify 2nd and 3rd repayments after making excess payment for
+ * installment no 2
*/
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("0.00", String.valueOf(secondInstallment.get("totalOutstandingForPeriod")));
/***
- * According to RBI Excess payment should go to principal portion of next
- * installment, but as interest recalculation is not implemented, it wont make
- * any difference to schedule even though if we made excess payment, so excess
- * payments will behave the same as regular payment with the excess amount
+ * According to RBI Excess payment should go to principal portion of
+ * next installment, but as interest recalculation is not implemented,
+ * it wont make any difference to schedule even though if we made excess
+ * payment, so excess payments will behave the same as regular payment
+ * with the excess amount
*/
thirdInstallment = loanSchedule.get(3);
validateNumberForEqual("3200", String.valueOf(thirdInstallment.get("totalOutstandingForPeriod")));
@@ -3317,15 +3072,16 @@ public class ClientLoanIntegrationTest {
validateNumberForEqual("100.00", String.valueOf(thirdInstallment.get("interestOutstanding")));
/***
- * Make payment with due amount of 3rd installment on 4th installment date
+ * Make payment with due amount of 3rd installment on 4th installment
+ * date
*/
this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3200"), loanID);
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
/***
- * Verify overdue interests are deducted first and then remaining amount for
- * interest portion of due installment
+ * Verify overdue interests are deducted first and then remaining amount
+ * for interest portion of due installment
*/
thirdInstallment = loanSchedule.get(3);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -3354,27 +3110,22 @@ public class ClientLoanIntegrationTest {
final HashMap repayment = loanSchedule.get(i);
final ArrayList<Integer> dueDateAsArray = (ArrayList<Integer>) repayment.get("dueDate");
- final LocalDate transactionDate = new LocalDate(dueDateAsArray.get(0), dueDateAsArray.get(1),
- dueDateAsArray.get(2));
+ final LocalDate transactionDate = new LocalDate(dueDateAsArray.get(0), dueDateAsArray.get(1), dueDateAsArray.get(2));
final Float interestPortion = BigDecimal.valueOf(Double.valueOf(repayment.get("interestDue").toString()))
.subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("interestWaived").toString())))
- .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("interestWrittenOff").toString())))
- .floatValue();
+ .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("interestWrittenOff").toString()))).floatValue();
final Float feePortion = BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesDue").toString()))
.subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesWaived").toString())))
- .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesWrittenOff").toString())))
- .floatValue();
+ .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesWrittenOff").toString()))).floatValue();
- final Float penaltyPortion = BigDecimal
- .valueOf(Double.valueOf(repayment.get("penaltyChargesDue").toString()))
+ final Float penaltyPortion = BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesDue").toString()))
.subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesWaived").toString())))
- .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesWrittenOff").toString())))
- .floatValue();
+ .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesWrittenOff").toString()))).floatValue();
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(transactionDate, interestPortion, feePortion,
- penaltyPortion, loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(transactionDate, interestPortion, feePortion, penaltyPortion,
+ loanID);
}
}
@@ -3391,21 +3142,20 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.DEFAULT_STRATEGY,
+ LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_EMI_AMOUN,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null,
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, null, null);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE, null,
+ LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "0.0", "0.0");
@@ -3500,21 +3250,20 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.DEFAULT_STRATEGY,
+ LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_EMI_AMOUN,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null,
- preCloseInterestStrategy, null, null, null);
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null, preCloseInterestStrategy, null,
+ null, null);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE, null,
+ LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -9, true, "2482.76", "46.15", "0.0", "0.0");
@@ -3580,25 +3329,24 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.DEFAULT_STRATEGY,
+ LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_EMI_AMOUN,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null,
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, null, null);
List<HashMap> charges = new ArrayList<>();
- Integer installmentCharge = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "10", false));
+ Integer installmentCharge = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST, "10", false));
addCharges(charges, installmentCharge, "10", null);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE, null,
+ LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "4.62", "0.0");
@@ -3679,23 +3427,20 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProductWithInterestRecalculationAndCompoundingDetails(
- LoanProductTestBuilder.RBI_INDIA_STRATEGY,
- LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST,
+ LoanProductTestBuilder.RBI_INDIA_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_NUMBER_OF_INSTALLMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", LOAN_DISBURSEMENT_DATE,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_WEEKLY, "1", LOAN_DISBURSEMENT_DATE,
- LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, null, dayOfWeek, null,
- dayOfWeek);
+ LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, null, dayOfWeek, null, dayOfWeek);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0));
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0));
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "0.0", "0.0");
@@ -3724,8 +3469,7 @@ public class ClientLoanIntegrationTest {
verifyLoanRepaymentSchedule(loanSchedule, expectedvalues);
- loanSchedule = this.loanTransactionHelper.getLoanFutureRepaymentSchedule(this.requestSpec, this.responseSpec,
- loanID);
+ loanSchedule = this.loanTransactionHelper.getLoanFutureRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, 0, false, "4965.3", "92.52", "0.0", "0.0");
@@ -3806,8 +3550,8 @@ public class ClientLoanIntegrationTest {
List<HashMap> charges = new ArrayList<>(2);
Integer flat = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
- Integer principalPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "2", false));
+ Integer principalPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "2", false));
addCharges(charges, flat, "100", LOAN_FLAT_CHARGE_DATE);
addCharges(charges, principalPercentage, "2", LOAN_INTEREST_CHARGE_DATE);
@@ -3815,23 +3559,21 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProductWithInterestRecalculationAndCompoundingDetails(
- LoanProductTestBuilder.DEFAULT_STRATEGY,
- LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST_AND_FEE,
+ LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST_AND_FEE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_WEEKLY, "1", REST_START_DATE,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_WEEKLY, "1", LOAN_DISBURSEMENT_DATE,
- LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, compoundingDayOfMonth,
- compoundingDayOfWeek, restDayOfMonth, restDayOfWeek);
+ LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, compoundingDayOfMonth, compoundingDayOfWeek,
+ restDayOfMonth, restDayOfWeek);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "100.0", "0.0");
@@ -3941,8 +3683,8 @@ public class ClientLoanIntegrationTest {
List<HashMap> charges = new ArrayList<>(2);
Integer flat = ChargesHelper.createCharges(requestSpec, responseSpec,
ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", false));
- Integer principalPercentage = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
- .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "2", false));
+ Integer principalPercentage = ChargesHelper.createCharges(requestSpec, responseSpec,
+ ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "2", false));
addCharges(charges, flat, "100", LOAN_FLAT_CHARGE_DATE);
addCharges(charges, principalPercentage, "2", LOAN_INTEREST_CHARGE_DATE);
@@ -3950,22 +3692,20 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProductWithInterestRecalculationAndCompoundingDetails(
- LoanProductTestBuilder.DEFAULT_STRATEGY,
- LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST_AND_FEE,
+ LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST_AND_FEE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_WEEKLY, "1", REST_START_DATE,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, null, null,
- preCloseInterestStrategy, null, null, null, restDateOfMonth, restDateOfWeek);
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, null, null, preCloseInterestStrategy, null,
+ null, null, restDateOfMonth, restDateOfWeek);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, charges);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -9, true, "2482.76", "46.15", "100.0", "0.0");
@@ -4042,25 +3782,22 @@ public class ClientLoanIntegrationTest {
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final String recalculationCompoundingFrequencyInterval = null;
final String recalculationCompoundingFrequencyDate = null;
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.DEFAULT_STRATEGY,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.DEFAULT_STRATEGY,
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST_AND_FEE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", REST_START_DATE,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD,
- recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyDate,
- LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null,
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, recalculationCompoundingFrequencyInterval,
+ recalculationCompoundingFrequencyDate, LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null,
overdueFeeChargeId.toString(), false, null, null, null, null);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, null);
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ REST_START_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, null);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -2, false, "2482.76", "46.15", "0.0", "0.0");
@@ -4149,31 +3886,30 @@ public class ClientLoanIntegrationTest {
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
Calendar todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
- LOG.info("Disbursal Date Calendar {}" , todaysDate.getTime());
+ LOG.info("Disbursal Date Calendar {}", todaysDate.getTime());
todaysDate.add(Calendar.DAY_OF_MONTH, -14);
final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
Account[] accounts = { assetAccount, incomeAccount, expenseAccount, overpaymentAccount };
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.DEFAULT_STRATEGY,
+ LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_EMI_AMOUN,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null,
LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, accounts, null, null);
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, null, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE, null,
+ LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0));
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
- LOG.info("Date during repayment schedule {}" , todaysDate.getTime());
+ LOG.info("Date during repayment schedule {}", todaysDate.getTime());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "0.0", "0.0");
addRepaymentValues(expectedvalues, todaysDate, 1, false, "2494.22", "34.69", "0.0", "0.0");
addRepaymentValues(expectedvalues, todaysDate, 1, false, "2505.73", "23.18", "0.0", "0.0");
@@ -4199,19 +3935,15 @@ public class ClientLoanIntegrationTest {
verifyLoanRepaymentSchedule(loanSchedule, expectedvalues);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(10000.0f, JournalEntry.TransactionType.CREDIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(10000.0f, JournalEntry.TransactionType.CREDIT),
new JournalEntry(10000.0f, JournalEntry.TransactionType.DEBIT), };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, LOAN_DISBURSEMENT_DATE,
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, LOAN_DISBURSEMENT_DATE, assetAccountInitialEntry);
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
String runOndate = dateFormat.format(todaysDate.getTime());
- LOG.info("runOndate : {}" , runOndate);
+ LOG.info("runOndate : {}", runOndate);
this.periodicAccrualAccountingHelper.runPeriodicAccrualAccounting(runOndate);
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant().minusDays(7),
- 46.15f, 0f, 0f, loanID);
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant(), 46.15f, 0f, 0f,
- loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant().minusDays(7), 46.15f, 0f, 0f, loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant(), 46.15f, 0f, 0f, loanID);
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
todaysDate.add(Calendar.DAY_OF_MONTH, -7);
@@ -4229,10 +3961,8 @@ public class ClientLoanIntegrationTest {
verifyLoanRepaymentSchedule(loanSchedule, expectedvalues);
this.periodicAccrualAccountingHelper.runPeriodicAccrualAccounting(runOndate);
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant().minusDays(7),
- 46.15f, 0f, 0f, loanID);
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant(), 34.69f, 0f, 0f,
- loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant().minusDays(7), 46.15f, 0f, 0f, loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant(), 34.69f, 0f, 0f, loanID);
HashMap prepayDetail = this.loanTransactionHelper.getPrepayAmount(this.requestSpec, this.responseSpec, loanID);
String prepayAmount = String.valueOf(prepayDetail.get("amount"));
@@ -4242,10 +3972,8 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant().minusDays(7),
- 46.15f, 0f, 0f, loanID);
- this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant(), 34.69f, 0f, 0f,
- loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant().minusDays(7), 46.15f, 0f, 0f, loanID);
+ this.loanTransactionHelper.checkAccrualTransactionForRepayment(Utils.getLocalDateOfTenant(), 34.69f, 0f, 0f, loanID);
}
@@ -4263,25 +3991,21 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final Integer loanProductID = createLoanProductWithInterestRecalculationAndCompoundingDetails(
- LoanProductTestBuilder.RBI_INDIA_STRATEGY,
- LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST,
+ LoanProductTestBuilder.RBI_INDIA_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST,
LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", LOAN_DISBURSEMENT_DATE,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "1",
- LOAN_DISBURSEMENT_DATE, LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null,
- getDayOfMonth(todaysDate), getDayOfWeek(todaysDate), getDayOfMonth(todaysDate),
- getDayOfWeek(todaysDate));
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "1", LOAN_DISBURSEMENT_DATE,
+ LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, getDayOfMonth(todaysDate),
+ getDayOfWeek(todaysDate), getDayOfMonth(todaysDate), getDayOfWeek(todaysDate));
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY,
- new ArrayList<HashMap>(0));
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0));
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "0.0", "0.0");
@@ -4341,7 +4065,7 @@ public class ClientLoanIntegrationTest {
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
Calendar todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
- LOG.info("----timeeeeeeeeeeeeee------> {}" , dateFormat.format(todaysDate.getTime()));
+ LOG.info("----timeeeeeeeeeeeeee------> {}", dateFormat.format(todaysDate.getTime()));
todaysDate.add(Calendar.DAY_OF_MONTH, -14);
final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
@@ -4349,26 +4073,22 @@ public class ClientLoanIntegrationTest {
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
final String recalculationCompoundingFrequencyInterval = null;
final String recalculationCompoundingFrequencyDate = null;
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.RBI_INDIA_STRATEGY,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST,
LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", LOAN_DISBURSEMENT_DATE,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD,
- recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyDate,
- LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, null, true, null, null,
- getDayOfMonth(todaysDate), getDayOfWeek(todaysDate));
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, recalculationCompoundingFrequencyInterval,
+ recalculationCompoundingFrequencyDate, LoanProductTestBuilder.INTEREST_APPLICABLE_STRATEGY_ON_PRE_CLOSE_DATE, null, null,
+ true, null, null, getDayOfMonth(todaysDate), getDayOfWeek(todaysDate));
- final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY,
- new ArrayList<HashMap>(0));
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList<HashMap>(0));
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
addRepaymentValues(expectedvalues, todaysDate, -1, false, "2482.76", "46.15", "0.0", "0.0");
@@ -4443,22 +4163,20 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
- final Integer loanProductID = createLoanProductWithInterestRecalculation(
- LoanProductTestBuilder.DEFAULT_STRATEGY, LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.DEFAULT_STRATEGY,
+ LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_NONE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_REDUCE_EMI_AMOUN,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null,
- preCloseStrategy, null, null, null);
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD, "0", null, preCloseStrategy, null, null,
+ null);
final Integer loanID = applyForLoanApplicationForInterestRecalculationWithMoratorium(clientID, loanProductID,
- LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0), "1",
- null);
+ LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.DEFAULT_STRATEGY, new ArrayList<HashMap>(0), "1", null);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
List<Map<String, Object>> expectedvalues = new ArrayList<>();
todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
@@ -4498,16 +4216,15 @@ public class ClientLoanIntegrationTest {
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
}
- private void addRepaymentValues(List<Map<String, Object>> expectedvalues, Calendar todaysDate, int addPeriod,
- boolean isAddDays, String principalDue, String interestDue, String feeChargesDue,
- String penaltyChargesDue) {
+ private void addRepaymentValues(List<Map<String, Object>> expectedvalues, Calendar todaysDate, int addPeriod, boolean isAddDays,
+ String principalDue, String interestDue, String feeChargesDue, String penaltyChargesDue) {
Map<String, Object> values = new HashMap<>(3);
if (isAddDays) {
values.put("dueDate", getDateAsArray(todaysDate, addPeriod));
} else {
values.put("dueDate", getDateAsArray(todaysDate, addPeriod * 7));
}
- LOG.info("Updated date {}" , values.get("dueDate"));
+ LOG.info("Updated date {}", values.get("dueDate"));
values.put("principalDue", principalDue);
values.put("interestDue", interestDue);
values.put("feeChargesDue", feeChargesDue);
@@ -4521,16 +4238,15 @@ public class ClientLoanIntegrationTest {
private List getDateAsArray(Calendar todaysDate, int addvalue, int type) {
todaysDate.add(type, addvalue);
- return new ArrayList<>(Arrays.asList(todaysDate.get(Calendar.YEAR), todaysDate.get(Calendar.MONTH) + 1,
- todaysDate.get(Calendar.DAY_OF_MONTH)));
+ return new ArrayList<>(
+ Arrays.asList(todaysDate.get(Calendar.YEAR), todaysDate.get(Calendar.MONTH) + 1, todaysDate.get(Calendar.DAY_OF_MONTH)));
}
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
- final String recalculationRestFrequencyDate, final String preCloseInterestCalculationStrategy,
- final Account[] accounts, final Integer recalculationRestFrequencyOnDayType,
- final Integer recalculationRestFrequencyDayOfWeekType) {
+ final String recalculationRestFrequencyDate, final String preCloseInterestCalculationStrategy, final Account[] accounts,
+ final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) {
final String recalculationCompoundingFrequencyType = null;
final String recalculationCompoundingFrequencyInterval = null;
final String recalculationCompoundingFrequencyDate = null;
@@ -4538,11 +4254,10 @@ public class ClientLoanIntegrationTest {
final Integer recalculationCompoundingFrequencyDayOfWeekType = null;
return createLoanProductWithInterestRecalculation(repaymentStrategy, interestRecalculationCompoundingMethod,
rescheduleStrategyMethod, recalculationRestFrequencyType, recalculationRestFrequencyInterval,
- recalculationRestFrequencyDate, recalculationCompoundingFrequencyType,
- recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyDate,
- preCloseInterestCalculationStrategy, accounts, null, false, recalculationCompoundingFrequencyOnDayType,
- recalculationCompoundingFrequencyDayOfWeekType, recalculationRestFrequencyOnDayType,
- recalculationRestFrequencyDayOfWeekType);
+ recalculationRestFrequencyDate, recalculationCompoundingFrequencyType, recalculationCompoundingFrequencyInterval,
+ recalculationCompoundingFrequencyDate, preCloseInterestCalculationStrategy, accounts, null, false,
+ recalculationCompoundingFrequencyOnDayType, recalculationCompoundingFrequencyDayOfWeekType,
+ recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType);
}
private Integer createLoanProductWithInterestRecalculationAndCompoundingDetails(final String repaymentStrategy,
@@ -4551,16 +4266,14 @@ public class ClientLoanIntegrationTest {
final String recalculationRestFrequencyDate, final String recalculationCompoundingFrequencyType,
final String recalculationCompoundingFrequencyInterval, final String recalculationCompoundingFrequencyDate,
final String preCloseInterestCalculationStrategy, final Account[] accounts,
- final Integer recalculationCompoundingFrequencyOnDayType,
- final Integer recalculationCompoundingFrequencyDayOfWeekType,
+ final Integer recalculationCompoundingFrequencyOnDayType, final Integer recalculationCompoundingFrequencyDayOfWeekType,
final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) {
return createLoanProductWithInterestRecalculation(repaymentStrategy, interestRecalculationCompoundingMethod,
rescheduleStrategyMethod, recalculationRestFrequencyType, recalculationRestFrequencyInterval,
- recalculationRestFrequencyDate, recalculationCompoundingFrequencyType,
- recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyDate,
- preCloseInterestCalculationStrategy, accounts, null, false, recalculationCompoundingFrequencyOnDayType,
- recalculationCompoundingFrequencyDayOfWeekType, recalculationRestFrequencyOnDayType,
- recalculationRestFrequencyDayOfWeekType);
+ recalculationRestFrequencyDate, recalculationCompoundingFrequencyType, recalculationCompoundingFrequencyInterval,
+ recalculationCompoundingFrequencyDate, preCloseInterestCalculationStrategy, accounts, null, false,
+ recalculationCompoundingFrequencyOnDayType, recalculationCompoundingFrequencyDayOfWeekType,
+ recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType);
}
private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
@@ -4570,19 +4283,18 @@ public class ClientLoanIntegrationTest {
final String recalculationCompoundingFrequencyInterval, final String recalculationCompoundingFrequencyDate,
final String preCloseInterestCalculationStrategy, final Account[] accounts, final String chargeId,
boolean isArrearsBasedOnOriginalSchedule, final Integer recalculationCompoundingFrequencyOnDayType,
- final Integer recalculationCompoundingFrequencyDayOfWeekType,
- final Integer recalculationRestFrequencyOnDayType, final Integer recalculationRestFrequencyDayOfWeekType) {
+ final Integer recalculationCompoundingFrequencyDayOfWeekType, final Integer recalculationRestFrequencyOnDayType,
+ final Integer recalculationRestFrequencyDayOfWeekType) {
LOG.info("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
- LoanProductTestBuilder builder = new LoanProductTestBuilder().withPrincipal("10000000.00")
- .withNumberOfRepayments("24").withRepaymentAfterEvery("1").withRepaymentTypeAsWeek()
- .withinterestRatePerPeriod("2").withInterestRateFrequencyTypeAsMonths()
- .withRepaymentStrategy(repaymentStrategy).withAmortizationTypeAsEqualPrincipalPayment()
- .withInterestCalculationPeriodTypeAsRepaymentPeriod(true).withInterestTypeAsDecliningBalance()
+ LoanProductTestBuilder builder = new LoanProductTestBuilder().withPrincipal("10000000.00").withNumberOfRepayments("24")
+ .withRepaymentAfterEvery("1").withRepaymentTypeAsWeek().withinterestRatePerPeriod("2")
+ .withInterestRateFrequencyTypeAsMonths().withRepaymentStrategy(repaymentStrategy)
+ .withAmortizationTypeAsEqualPrincipalPayment().withInterestCalculationPeriodTypeAsRepaymentPeriod(true)
+ .withInterestTypeAsDecliningBalance()
.withInterestRecalculationDetails(interestRecalculationCompoundingMethod, rescheduleStrategyMethod,
preCloseInterestCalculationStrategy)
- .withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType,
- recalculationRestFrequencyInterval, recalculationRestFrequencyOnDayType,
- recalculationRestFrequencyDayOfWeekType)
+ .withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType, recalculationRestFrequencyInterval,
+ recalculationRestFrequencyOnDayType, recalculationRestFrequencyDayOfWeekType)
.withInterestRecalculationCompoundingFrequencyDetails(recalculationCompoundingFrequencyType,
recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyOnDayType,
recalculationCompoundingFrequencyDayOfWeekType);
@@ -4600,27 +4312,26 @@ public class ClientLoanIntegrationTest {
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges) {
- return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate,
- repaymentStrategy, charges, null, null);
+ return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate, repaymentStrategy, charges, null,
+ null);
}
- private Integer applyForLoanApplicationForInterestRecalculationWithMoratorium(final Integer clientID,
- final Integer loanProductID, final String disbursementDate, final String repaymentStrategy,
- final List<HashMap> charges, final String graceOnInterestPayment, final String graceOnPrincipalPayment) {
- return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate,
- repaymentStrategy, charges, graceOnInterestPayment, graceOnPrincipalPayment);
+ private Integer applyForLoanApplicationForInterestRecalculationWithMoratorium(final Integer clientID, final Integer loanProductID,
+ final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges, final String graceOnInterestPayment,
+ final String graceOnPrincipalPayment) {
+ return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate, repaymentStrategy, charges,
+ graceOnInterestPayment, graceOnPrincipalPayment);
}
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
- final String disbursementDate, final String compoundingStartDate, final String repaymentStrategy,
- final List<HashMap> charges) {
- return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate,
- repaymentStrategy, charges, null, null);
+ final String disbursementDate, final String compoundingStartDate, final String repaymentStrategy, final List<HashMap> charges) {
+ return applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, disbursementDate, repaymentStrategy, charges, null,
+ null);
}
private Integer applyForLoanApplicationForInterestRecalculation(final Integer clientID, final Integer loanProductID,
- final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges,
- final String graceOnInterestPayment, final String graceOnPrincipalPayment) {
+ final String disbursementDate, final String repaymentStrategy, final List<HashMap> charges, final String graceOnInterestPayment,
+ final String graceOnPrincipalPayment) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal("10000.00") //
@@ -4643,32 +4354,24 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
- private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule,
- List<Map<String, Object>> expectedvalues) {
+ private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule, List<Map<String, Object>> expectedvalues) {
int index = 1;
verifyLoanRepaymentSchedule(loanSchedule, expectedvalues, index);
}
- private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule,
- List<Map<String, Object>> expectedvalues, int index) {
- LOG.info(
- "--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
+ private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule, List<Map<String, Object>> expectedvalues, int index) {
+ LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
for (Map<String, Object> values : expectedvalues) {
- assertEquals(values.get("dueDate"), loanSchedule.get(index).get("dueDate"),
- "Checking for Due Date for installment " + index);
- validateNumberForEqualWithMsg("Checking for Principal Due for installment " + index,
- String.valueOf(values.get("principalDue")),
+ assertEquals(values.get("dueDate"), loanSchedule.get(index).get("dueDate"), "Checking for Due Date for installment " + index);
+ validateNumberForEqualWithMsg("Checking for Principal Due for installment " + index, String.valueOf(values.get("principalDue")),
String.valueOf(loanSchedule.get(index).get("principalDue")));
- validateNumberForEqualWithMsg("Checking for Interest Due for installment " + index,
- String.valueOf(values.get("interestDue")),
+ validateNumberForEqualWithMsg("Checking for Interest Due for installment " + index, String.valueOf(values.get("interestDue")),
String.valueOf(loanSchedule.get(index).get("interestDue")));
validateNumberForEqualWithMsg("Checking for Fee charge Due for installment " + index,
- String.valueOf(values.get("feeChargesDue")),
- String.valueOf(loanSchedule.get(index).get("feeChargesDue")));
+ String.valueOf(values.get("feeChargesDue")), String.valueOf(loanSchedule.get(index).get("feeChargesDue")));
validateNumberForEqualWithMsg("Checking for Penalty charge Due for installment " + index,
- String.valueOf(values.get("penaltyChargesDue")),
- String.valueOf(loanSchedule.get(index).get("penaltyChargesDue")));
+ String.valueOf(values.get("penaltyChargesDue")), String.valueOf(loanSchedule.get(index).get("penaltyChargesDue")));
index++;
}
}
@@ -4699,8 +4402,8 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED,
- assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,
+ incomeAccount, expenseAccount, overpaymentAccount);
Assertions.assertNotNull(loanProductID);
/***
@@ -4716,8 +4419,8 @@ public class ClientLoanIntegrationTest {
ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "50", false));
addCharges(charges, flatInstallmentFee, "50", null);
- final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
- savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
+ final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,
+ principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4731,14 +4434,11 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow,
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap firstInstallment = loanSchedule.get(1);
validateNumberForEqual("2290", String.valueOf(firstInstallment.get("totalOutstandingForPeriod")));
@@ -4863,8 +4563,8 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY,
- ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);// ,
+ final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,
+ incomeAccount, expenseAccount, overpaymentAccount);// ,
// LoanProductTestBuilder.EQUAL_INSTALLMENTS,
// LoanProductTestBuilder.FLAT_BALANCE);
Assertions.assertNotNull(loanProductID);
@@ -4882,8 +4582,8 @@ public class ClientLoanIntegrationTest {
ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "50", false));
addCharges(charges, flatInstallmentFee, "50", null);
- final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
- savingsId, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
+ final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,
+ principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -4897,16 +4597,13 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("1440"), JournalEntry.TransactionType.DEBIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("1440"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("300.00"), JournalEntry.TransactionType.DEBIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow,
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap firstInstallment = loanSchedule.get(1);
validateNumberForEqual("2290", String.valueOf(firstInstallment.get("totalOutstandingForPeriod")));
@@ -5015,20 +4712,17 @@ public class ClientLoanIntegrationTest {
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
- final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
- MINIMUM_OPENING_BALANCE);
+ final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE);
Assertions.assertNotNull(savingsProductID);
- final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
- ACCOUNT_TYPE_INDIVIDUAL);
+ final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertNotNull(savingsProductID);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertTrue(modifications.containsKey("submittedOnDate"));
- HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec,
- savingsId);
+ HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
@@ -5046,8 +4740,8 @@ public class ClientLoanIntegrationTest {
final Account expenseAccount = this.accountHelper.createExpenseAccount();
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
- final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED,
- assetAccount, incomeAccount, expenseAccount, overpaymentAccount);
+ final Integer loanProductID = createLoanProduct("0", "0", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,
+ incomeAccount, expenseAccount, overpaymentAccount);
Assertions.assertNotNull(loanProductID);
/***
@@ -5063,8 +4757,8 @@ public class ClientLoanIntegrationTest {
ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "50", false));
addCharges(charges, flatInstallmentFee, "50", null);
- final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges,
- null, principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
+ final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, null, principal,
+ LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4);
Assertions.assertNotNull(loanID);
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
@@ -5078,14 +4772,11 @@ public class ClientLoanIntegrationTest {
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID);
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
- final JournalEntry[] assetAccountInitialEntry = {
- new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
+ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT),
new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) };
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow,
- assetAccountInitialEntry);
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);
- ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
- this.responseSpec, loanID);
+ ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
HashMap firstInstallment = loanSchedule.get(1);
validateNumberForEqual("2290", String.valueOf(firstInstallment.get("totalOutstandingForPeriod")));
@@ -5153,8 +4844,8 @@ public class ClientLoanIntegrationTest {
final String FROM_LOAN_ACCOUNT_TYPE = "1";
final String TO_SAVINGS_ACCOUNT_TYPE = "2";
- this.accountTransferHelper.refundLoanByTransfer(now, clientID, loanID, clientID, savingsId,
- FROM_LOAN_ACCOUNT_TYPE, TO_SAVINGS_ACCOUNT_TYPE, TRANSFER_AMOUNT.toString());
+ this.accountTransferHelper.refundLoanByTransfer(now, clientID, loanID, clientID, savingsId, FROM_LOAN_ACCOUNT_TYPE,
+ TO_SAVINGS_ACCOUNT_TYPE, TRANSFER_AMOUNT.toString());
Float toSavingsBalance = Float.valueOf(MINIMUM_OPENING_BALANCE);
@@ -5186,8 +4877,8 @@ public class ClientLoanIntegrationTest {
TRANSFER_AMOUNT = 2000f;
- this.accountTransferHelper.refundLoanByTransfer(now, clientID, loanID, clientID, savingsId,
- FROM_LOAN_ACCOUNT_TYPE, TO_SAVINGS_ACCOUNT_TYPE, TRANSFER_AMOUNT.toString());
+ this.accountTransferHelper.refundLoanByTransfer(now, clientID, loanID, clientID, savingsId, FROM_LOAN_ACCOUNT_TYPE,
+ TO_SAVINGS_ACCOUNT_TYPE, TRANSFER_AMOUNT.toString());
toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
@@ -5214,8 +4905,8 @@ public class ClientLoanIntegrationTest {
}
- private Integer createSavingsProduct(final RequestSpecification requestSpec,
- final ResponseSpecification responseSpec, final String minOpenningBalance) {
+ private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
+ final String minOpenningBalance) {
LOG.info("------------------------------CREATING NEW SAVINGS PRODUCT ---------------------------------------");
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
@@ -5235,38 +4926,33 @@ public class ClientLoanIntegrationTest {
public void testLoanProductConfiguration() {
final String proposedAmount = "5000";
JsonObject loanProductConfigurationAsTrue = new JsonObject();
- loanProductConfigurationAsTrue = this.createLoanProductConfigurationDetail(loanProductConfigurationAsTrue,
- true);
+ loanProductConfigurationAsTrue = this.createLoanProductConfigurationDetail(loanProductConfigurationAsTrue, true);
JsonObject loanProductConfigurationAsFalse = new JsonObject();
- loanProductConfigurationAsFalse = this.createLoanProductConfigurationDetail(loanProductConfigurationAsFalse,
- false);
+ loanProductConfigurationAsFalse = this.createLoanProductConfigurationDetail(loanProductConfigurationAsFalse, false);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2012");
- Integer loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
- .withAmortizationTypeAsEqualInstallments().withRepaymentTypeAsMonth().withRepaymentAfterEvery("1")
- .withRepaymentStrategy(LoanProductTestBuilder.DEFAULT_STRATEGY).withInterestTypeAsDecliningBalance()
- .withInterestCalculationPeriodTypeAsDays().withInArrearsTolerance("10").withMoratorium("2", "3")
- .withLoanProductConfiguration(loanProductConfigurationAsTrue).build(null));
- LOG.info(
- "-----------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS TRUE-------------------------- {}"
- , loanProductID);
+ Integer loanProductID = this.loanTransactionHelper
+ .getLoanProductId(new LoanProductTestBuilder().withAmortizationTypeAsEqualInstallments().withRepaymentTypeAsMonth()
+ .withRepaymentAfterEvery("1").withRepaymentStrategy(LoanProductTestBuilder.DEFAULT_STRATEGY)
+ .withInterestTypeAsDecliningBalance().withInterestCalculationPeriodTypeAsDays().withInArrearsTolerance("10")
+ .withMoratorium("2", "3").withLoanProductConfiguration(loanProductConfigurationAsTrue).build(null));
+ LOG.info("-----------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS TRUE-------------------------- {}",
+ loanProductID);
Integer loanID = applyForLoanApplicationWithProductConfigurationAsTrue(clientID, loanProductID, proposedAmount);
- LOG.info("------------------------LOAN CREATED WITH ID------------------------------{}" , loanID);
-
- loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder()
- .withAmortizationTypeAsEqualInstallments().withRepaymentTypeAsMonth().withRepaymentAfterEvery("1")
- .withRepaymentStrategy(LoanProductTestBuilder.DEFAULT_STRATEGY).withInterestTypeAsDecliningBalance()
- .withInterestCalculationPeriodTypeAsDays().withInArrearsTolerance("10").withMoratorium("2", "3")
- .withLoanProductConfiguration(loanProductConfigurationAsFalse).build(null));
- LOG.info("-------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS FALSE---------------------- {}"
- , loanProductID);
+ LOG.info("------------------------LOAN CREATED WITH ID------------------------------{}", loanID);
+
+ loanProductID = this.loanTransactionHelper.getLoanProductId(new LoanProductTestBuilder().withAmortizationTypeAsEqualInstallments()
+ .withRepaymentTypeAsMonth().withRepaymentAfterEvery("1").withRepaymentStrategy(LoanProductTestBuilder.DEFAULT_STRATEGY)
+ .withInterestTypeAsDecliningBalance().withInterestCalculationPeriodTypeAsDays().withInArrearsTolerance("10")
+ .withMoratorium("2", "3").withLoanProductConfiguration(loanProductConfigurationAsFalse).build(null));
+ LOG.info("-------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS FALSE---------------------- {}", loanProductID);
/*
* Try to override attribute values in loan account when attribute
* configurations are set to false at product level
*/
loanID = applyForLoanApplicationWithProductConfigurationAsFalse(clientID, loanProductID, proposedAmount);
- LOG.info("--------------------------LOAN CREATED WITH ID------------------------- {}" , loanID);
+ LOG.info("--------------------------LOAN CREATED WITH ID------------------------- {}", loanID);
this.validateIfValuesAreNotOverridden(loanID, loanProductID);
}
@@ -5324,12 +5010,11 @@ public class ClientLoanIntegrationTest {
}
private void validateIfValuesAreNotOverridden(Integer loanID, Integer loanProductID) {
- String loanProductDetails = this.loanTransactionHelper.getLoanProductDetails(this.requestSpec,
- this.responseSpec, loanProductID);
+ String loanProductDetails = this.loanTransactionHelper.getLoanProductDetails(this.requestSpec, this.responseSpec, loanProductID);
String loanDetails = this.loanTransactionHelper.getLoanDetails(this.requestSpec, this.responseSpec, loanID);
- List<String> comparisonAttributes = Arrays.asList("amortizationType", "interestType",
- "transactionProcessingStrategyId", "interestCalculationPeriodType", "repaymentFrequencyType",
- "graceOnPrincipalPayment", "graceOnInterestPayment", "inArrearsTolerance", "graceOnArrearsAgeing");
+ List<String> comparisonAttributes = Arrays.asList("amortizationType", "interestType", "transactionProcessingStrategyId",
+ "interestCalculationPeriodType", "repaymentFrequencyType", "graceOnPrincipalPayment", "graceOnInterestPayment",
+ "inArrearsTolerance", "graceOnArrearsAgeing");
for (String comparisonAttribute : comparisonAttributes) {
Object val1 = JsonPath.from(loanProductDetails).get(comparisonAttribute);
@@ -5350,8 +5035,8 @@ public class ClientLoanIntegrationTest {
return loanProductConfiguration;
}
- private Integer applyForLoanApplicationWithProductConfigurationAsTrue(final Integer clientID,
- final Integer loanProductID, String principal) {
+ private Integer applyForLoanApplicationWithProductConfigurationAsTrue(final Integer clientID, final Integer loanProductID,
+ String principal) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder() //
.withPrincipal(principal) //
@@ -5368,8 +5053,8 @@ public class ClientLoanIntegrationTest {
return this.loanTransactionHelper.getLoanId(loanApplicationJSON);
}
- private Integer applyForLoanApplicationWithProductConfigurationAsFalse(final Integer clientID,
- final Integer loanProductID, String principal) {
+ private Integer applyForLoanApplicationWithProductConfigurationAsFalse(final Integer clientID, final Integer loanProductID,
+ String principal) {
LOG.info("--------------------------------APPLYING FOR LOAN APPLICATION--------------------------------");
final String loanApplicationJSON = new LoanApplicationTestBuilder()
//
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
old mode 100755
new mode 100644
index 1ba3f74..8f0aff5
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java
@@ -61,8 +61,9 @@ import org.slf4j.LoggerFactory;
/**
* Client Savings Integration Test for checking Savings Application.
*/
-@SuppressWarnings({ "rawtypes"})
+@SuppressWarnings({ "rawtypes" })
public class ClientSavingsIntegrationTest {
+
private final static Logger LOG = LoggerFactory.getLogger(ClientSavingsIntegrationTest.class);
public static final String DEPOSIT_AMOUNT = "2000";
public static final String WITHDRAW_AMOUNT = "1000";
@@ -203,8 +204,8 @@ public class ClientSavingsIntegrationTest {
Calendar todaysDate = Calendar.getInstance();
final String CLOSEDON_DATE = dateFormat.format(todaysDate.getTime());
String withdrawBalance = "false";
- ArrayList<HashMap> savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper.closeSavingsAccountAndGetBackRequiredField(
- savingsId, withdrawBalance, CommonConstants.RESPONSE_ERROR, CLOSEDON_DATE);
+ ArrayList<HashMap> savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper
+ .closeSavingsAccountAndGetBackRequiredField(savingsId, withdrawBalance, CommonConstants.RESPONSE_ERROR, CLOSEDON_DATE);
assertEquals("validation.msg.savingsaccount.close.results.in.balance.not.zero",
savingsAccountErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
@@ -559,8 +560,8 @@ public class ClientSavingsIntegrationTest {
ArrayList<HashMap> savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper.inactivateCharge(annualSavingsChargeId,
savingsId, CommonConstants.RESPONSE_ERROR);
- assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due", savingsAccountErrorData
- .get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
+ assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due",
+ savingsAccountErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
SimpleDateFormat sdf = new SimpleDateFormat(CommonConstants.DATE_FORMAT, Locale.US);
Calendar cal = Calendar.getInstance();
@@ -604,8 +605,8 @@ public class ClientSavingsIntegrationTest {
savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper.inactivateCharge(monthlySavingsCharge, savingsId,
CommonConstants.RESPONSE_ERROR);
- assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due", savingsAccountErrorData
- .get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
+ assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due",
+ savingsAccountErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
this.savingsAccountHelper.waiveCharge((Integer) savingsChargeForWaive.get("id"), savingsId);
HashMap waiveCharge = this.savingsAccountHelper.getSavingsCharge(savingsId, (Integer) savingsChargeForWaive.get("id"));
@@ -630,8 +631,8 @@ public class ClientSavingsIntegrationTest {
savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper.inactivateCharge(weeklySavingsFeeId, savingsId,
CommonConstants.RESPONSE_ERROR);
- assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due", savingsAccountErrorData
- .get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
+ assertEquals("validation.msg.savingsaccountcharge.inactivation.of.charge.not.allowed.when.charge.is.due",
+ savingsAccountErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
cal = Calendar.getInstance();
dates = (List) savingsChargeForPay.get("dueDate");
@@ -793,8 +794,8 @@ public class ClientSavingsIntegrationTest {
todaysDate = Calendar.getInstance();
final String CLOSEDON_DATE = dateFormat.format(todaysDate.getTime());
String withdrawBalance = "false";
- ArrayList<HashMap> savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper.closeSavingsAccountAndGetBackRequiredField(
- savingsId, withdrawBalance, CommonConstants.RESPONSE_ERROR, CLOSEDON_DATE);
+ ArrayList<HashMap> savingsAccountErrorData = (ArrayList<HashMap>) validationErrorHelper
+ .closeSavingsAccountAndGetBackRequiredField(savingsId, withdrawBalance, CommonConstants.RESPONSE_ERROR, CLOSEDON_DATE);
assertEquals("validation.msg.savingsaccount.close.results.in.balance.not.zero",
savingsAccountErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
}
@@ -802,14 +803,12 @@ public class ClientSavingsIntegrationTest {
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccountPostInterestOnLastDayWithOverdraft() {
- this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec,
- this.responseSpec);
+ this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
/***
* Create a client to apply for savings account (overdraft account).
*/
- final Integer clientID = ClientHelper.createClient(this.requestSpec,
- this.responseSpec);
+ final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assertions.assertNotNull(clientID);
final String minBalanceForInterestCalculation = null;
@@ -821,33 +820,27 @@ public class ClientSavingsIntegrationTest {
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final boolean allowOverdraft = true;
- final Integer savingsProductID = createSavingsProduct(this.requestSpec,
- this.responseSpec, zeroOpeningBalance,
- minBalanceForInterestCalculation, minRequiredBalance,
- enforceMinRequiredBalance, allowOverdraft);
+ final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, zeroOpeningBalance,
+ minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assertions.assertNotNull(savingsProductID);
/***
* Apply for Savings account
*/
- final Integer savingsId = this.savingsAccountHelper
- .applyForSavingsApplication(clientID, savingsProductID,
- ACCOUNT_TYPE_INDIVIDUAL);
+ final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertNotNull(savingsProductID);
- HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(
- clientID, savingsProductID, savingsId, ACCOUNT_TYPE_INDIVIDUAL);
+ HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
+ ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertTrue(modifications.containsKey("submittedOnDate"));
- HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(
- this.requestSpec, this.responseSpec, savingsId);
+ HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
/***
* Approve the savings account
*/
- savingsStatusHashMap = this.savingsAccountHelper
- .approveSavings(savingsId);
+ savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
@@ -862,26 +855,23 @@ public class ClientSavingsIntegrationTest {
* @param activationDate
* this value is every time first day of previous month
*/
- savingsStatusHashMap = activateSavingsAccount(savingsId,
- ACTIVATION_DATE);
+ savingsStatusHashMap = activateSavingsAccount(savingsId, ACTIVATION_DATE);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
/***
* Verify the account summary
*/
- final HashMap summaryBefore = this.savingsAccountHelper
- .getSavingsSummary(savingsId);
+ final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
this.savingsAccountHelper.calculateInterestForSavings(savingsId);
- HashMap summary = this.savingsAccountHelper
- .getSavingsSummary(savingsId);
+ HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
- final Integer lastDayOfMonth = todaysDate
- .getActualMaximum(Calendar.DAY_OF_MONTH);
+ final Integer lastDayOfMonth = todaysDate.getActualMaximum(Calendar.DAY_OF_MONTH);
todaysDate.set(Calendar.DAY_OF_MONTH, lastDayOfMonth);
final String WITHDRAWAL_DATE = dateFormat.format(todaysDate.getTime());
Float balance = Float.valueOf(zeroOpeningBalance);
- //DateFormat transactionDateFormat = new SimpleDateFormat("dd MMMM yyyy",Locale.US);
+ // DateFormat transactionDateFormat = new SimpleDateFormat("dd MMMM
+ // yyyy",Locale.US);
Calendar transactionDate = Calendar.getInstance();
transactionDate.set(Calendar.DAY_OF_MONTH, 2);
String TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
@@ -893,16 +883,12 @@ public class ClientSavingsIntegrationTest {
* @param transactionDate
* this value is every time last day of previous month
*/
- Integer depositTransactionId = (Integer) this.savingsAccountHelper
- .depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
- WITHDRAWAL_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
- HashMap depositTransaction = this.savingsAccountHelper
- .getSavingsTransaction(savingsId, depositTransactionId);
+ Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
+ WITHDRAWAL_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
+ HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
- assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"),
- "Verifying Deposit Amount");
- assertEquals(balance, depositTransaction.get("runningBalance"),
- "Verifying Balance after Deposit");
+ assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
+ assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
* Calculate expected interest to be posted, interest should be posted
@@ -910,18 +896,13 @@ public class ClientSavingsIntegrationTest {
* month before this account balance is negative.
*/
this.savingsAccountHelper.postInterestForSavings(savingsId);
- HashMap accountDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
- Float accountDetailsPostInterestPosted = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- Float nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- HashMap interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ Float accountDetailsPostInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
@@ -931,29 +912,20 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- DecimalFormat decimalFormat = new DecimalFormat("",
- new DecimalFormatSymbols(Locale.US));
+ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
-
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- HashMap accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
+
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ HashMap accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
- Float accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ Float accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -963,33 +935,24 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
transactionDate.set(Calendar.DAY_OF_MONTH, 3);
TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -999,36 +962,28 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked-------");
- //DateFormat transactionFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
+ // DateFormat transactionFormat = new SimpleDateFormat("dd MMMM yyyy",
+ // Locale.US);
Calendar transactionCalendarDateFormat = Calendar.getInstance();
transactionCalendarDateFormat.add(Calendar.DAY_OF_MONTH, 0);
transactionDate.set(Calendar.DAY_OF_MONTH, 22);
TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
if (Calendar.DAY_OF_MONTH >= 22) {
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
- "id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1038,40 +993,28 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
- DateFormat lastTransactionDateFormat = new SimpleDateFormat(
- "dd MMMM yyyy", Locale.US);
+ DateFormat lastTransactionDateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar postedLastDate = Calendar.getInstance();
- int numberOfDateOfMonth = postedLastDate
- .getActualMaximum(Calendar.DAY_OF_MONTH);
- TRANSACTION_DATE = lastTransactionDateFormat.format(transactionDate
- .getTime());
+ int numberOfDateOfMonth = postedLastDate.getActualMaximum(Calendar.DAY_OF_MONTH);
+ TRANSACTION_DATE = lastTransactionDateFormat.format(transactionDate.getTime());
if (Calendar.DAY_OF_MONTH == numberOfDateOfMonth) {
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
- "id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1081,33 +1024,24 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
transactionDate.set(Calendar.DAY_OF_MONTH, 1);
TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1117,14 +1051,11 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
@@ -1132,14 +1063,12 @@ public class ClientSavingsIntegrationTest {
@SuppressWarnings("unchecked")
@Test
public void testSavingsAccountPostInterestOnLastDayWithdrawalWithOverdraft() {
- this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec,
- this.responseSpec);
+ this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
/***
* Create a client to apply for savings account (overdraft account).
*/
- final Integer clientID = ClientHelper.createClient(this.requestSpec,
- this.responseSpec);
+ final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assertions.assertNotNull(clientID);
final String minBalanceForInterestCalculation = null;
@@ -1151,33 +1080,27 @@ public class ClientSavingsIntegrationTest {
final String minRequiredBalance = null;
final String enforceMinRequiredBalance = "false";
final boolean allowOverdraft = true;
- final Integer savingsProductID = createSavingsProduct(this.requestSpec,
- this.responseSpec, zeroOpeningBalance,
- minBalanceForInterestCalculation, minRequiredBalance,
- enforceMinRequiredBalance, allowOverdraft);
+ final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, zeroOpeningBalance,
+ minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assertions.assertNotNull(savingsProductID);
/***
* Apply for Savings account
*/
- final Integer savingsId = this.savingsAccountHelper
- .applyForSavingsApplication(clientID, savingsProductID,
- ACCOUNT_TYPE_INDIVIDUAL);
+ final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertNotNull(savingsProductID);
- HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(
- clientID, savingsProductID, savingsId, ACCOUNT_TYPE_INDIVIDUAL);
+ HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
+ ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertTrue(modifications.containsKey("submittedOnDate"));
- HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(
- this.requestSpec, this.responseSpec, savingsId);
+ HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
/***
* Approve the savings account
*/
- savingsStatusHashMap = this.savingsAccountHelper
- .approveSavings(savingsId);
+ savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
@@ -1192,31 +1115,28 @@ public class ClientSavingsIntegrationTest {
* @param activationDate
* this value is every time first day of previous month
*/
- savingsStatusHashMap = activateSavingsAccount(savingsId,
- ACTIVATION_DATE);
+ savingsStatusHashMap = activateSavingsAccount(savingsId, ACTIVATION_DATE);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
/***
* Verify the account summary
*/
- final HashMap summaryBefore = this.savingsAccountHelper
- .getSavingsSummary(savingsId);
+ final HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
this.savingsAccountHelper.calculateInterestForSavings(savingsId);
- HashMap summary = this.savingsAccountHelper
- .getSavingsSummary(savingsId);
+ HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
- final Integer lastDayOfMonth = todaysDate
- .getActualMaximum(Calendar.DAY_OF_MONTH);
+ final Integer lastDayOfMonth = todaysDate.getActualMaximum(Calendar.DAY_OF_MONTH);
todaysDate.set(Calendar.DAY_OF_MONTH, lastDayOfMonth);
final String WITHDRAWAL_DATE = dateFormat.format(todaysDate.getTime());
Float balance = Float.valueOf(zeroOpeningBalance);
- //DateFormat transactionDateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
+ // DateFormat transactionDateFormat = new SimpleDateFormat("dd MMMM
+ // yyyy", Locale.US);
Calendar transactionDate = Calendar.getInstance();
transactionDate.set(Calendar.DAY_OF_MONTH, 2);
String TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
- /***
+ /***
* Perform withdraw transaction, verify account balance(account balance
* will go to negative as no deposits are there prior to this
* transaction)
@@ -1248,18 +1168,13 @@ public class ClientSavingsIntegrationTest {
* month before this account balance is negative.
*/
this.savingsAccountHelper.postInterestForSavings(savingsId);
- HashMap accountDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
- Float accountDetailsPostInterestPosted = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- Float nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- HashMap interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ Float accountDetailsPostInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
@@ -1269,29 +1184,20 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- DecimalFormat decimalFormat = new DecimalFormat("",
- new DecimalFormatSymbols(Locale.US));
+ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
-
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- HashMap accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
+
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ HashMap accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
- Float accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ Float accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1301,33 +1207,24 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
transactionDate.set(Calendar.DAY_OF_MONTH, 3);
TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1337,36 +1234,28 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked-------");
- //DateFormat transactionFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
+ // DateFormat transactionFormat = new SimpleDateFormat("dd MMMM yyyy",
+ // Locale.US);
Calendar transactionCalendarDateFormat = Calendar.getInstance();
transactionCalendarDateFormat.add(Calendar.DAY_OF_MONTH, 0);
transactionDate.set(Calendar.DAY_OF_MONTH, 22);
TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
if (Calendar.DAY_OF_MONTH >= 22) {
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
- "id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1376,40 +1265,28 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
- DateFormat lastTransactionDateFormat = new SimpleDateFormat(
- "dd MMMM yyyy", Locale.US);
+ DateFormat lastTransactionDateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar postedLastDate = Calendar.getInstance();
- int numberOfDateOfMonth = postedLastDate
- .getActualMaximum(Calendar.DAY_OF_MONTH);
- TRANSACTION_DATE = lastTransactionDateFormat.format(transactionDate
- .getTime());
+ int numberOfDateOfMonth = postedLastDate.getActualMaximum(Calendar.DAY_OF_MONTH);
+ TRANSACTION_DATE = lastTransactionDateFormat.format(transactionDate.getTime());
if (Calendar.DAY_OF_MONTH == numberOfDateOfMonth) {
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
- "id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1419,33 +1296,24 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted, accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
transactionDate.set(Calendar.DAY_OF_MONTH, 1);
TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId,
- TRANSACTION_DATE);
- accountTransactionDetails = this.savingsAccountHelper
- .getSavingsDetails(savingsId);
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, TRANSACTION_DATE);
+ accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
- accountDetailsPostInterest = Float.valueOf(summary.get(
- "totalInterestPosted").toString());
-
- nominalAnnualInterest = Float.valueOf(accountDetails.get(
- "nominalAnnualInterestRate").toString());
- interestCalculationDaysInYearType = (HashMap) accountDetails
- .get("interestCalculationDaysInYearType");
- daysInYear = Integer.valueOf(interestCalculationDaysInYearType
- .get("id").toString());
+ accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
@@ -1455,14 +1323,11 @@ public class ClientSavingsIntegrationTest {
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
*/
- decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(
- Locale.US));
+ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- accountDetailsPostInterestPosted = Float.valueOf(
- decimalFormat.format(accountDetailsPostInterestPosted));
- assertEquals(interestPosted,accountDetailsPostInterestPosted,
- "Verifying interest posted");
+ accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
@@ -1553,7 +1418,7 @@ public class ClientSavingsIntegrationTest {
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
- assertEquals( balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
+ assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
* Perform Deposit transaction on last day of month and verify account
@@ -1608,7 +1473,8 @@ public class ClientSavingsIntegrationTest {
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
- //actualInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
+ // actualInterestPosted =
+ // Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("------Post Interest As On After doing a post interest Successfully worked--------");
@@ -1623,7 +1489,6 @@ public class ClientSavingsIntegrationTest {
final String TODYS_POSTING_DATE = dateFormat.format(todysDate.getTime());
String withdrawBalance = "true";
-
if (TODYS_POSTING_DATE.equalsIgnoreCase(INTEREST_POSTING_DATE)) {
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, responseSpec);
validationErrorHelper.closeSavingsAccountPostInterestAndGetBackRequiredField(savingsId, withdrawBalance,
@@ -1641,8 +1506,10 @@ public class ClientSavingsIntegrationTest {
@Test
public void testPostInterestAsOnSavingsAccountWithOverdraft() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
- //final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
- //final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
+ // final ResponseSpecification errorResponse = new
+ // ResponseSpecBuilder().expectStatusCode(400).build();
+ // final SavingsAccountHelper validationErrorHelper = new
+ // SavingsAccountHelper(this.requestSpec, errorResponse);
/***
* Create a client to apply for savings account (overdraft account).
@@ -1696,9 +1563,9 @@ public class ClientSavingsIntegrationTest {
final String POSTED_TRANSACTION_DATE = dateFormat.format(postedDate.getTime());
Calendar postedLastDate = Calendar.getInstance();
- int countOfDate=postedDate.getActualMaximum(Calendar.DAY_OF_MONTH);
- LOG.info("count Of Date---> {}",countOfDate);
- postedLastDate.set(Calendar.DAY_OF_MONTH,countOfDate);
+ int countOfDate = postedDate.getActualMaximum(Calendar.DAY_OF_MONTH);
+ LOG.info("count Of Date---> {}", countOfDate);
+ postedLastDate.set(Calendar.DAY_OF_MONTH, countOfDate);
final String POSTED_LAST_TRANSACTION_DATE = dateFormat.format(postedLastDate.getTime());
/***
@@ -1754,7 +1621,6 @@ public class ClientSavingsIntegrationTest {
summary = (HashMap) accountDetails.get("summary");
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
-
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
@@ -1776,33 +1642,31 @@ public class ClientSavingsIntegrationTest {
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
actualInterestPosted = Float.valueOf(decimalFormat.format(actualInterestPosted));
- assertEquals(interestPosted, actualInterestPosted, "Verifying interest posted");
- LOG.info("------Post Interest As On Successful Worked--------");
-
- this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_LAST_TRANSACTION_DATE);
- HashMap accountLastDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
- summary = (HashMap) accountLastDetails.get("summary");
- Float actualLastInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
-
- final Float nominalLastAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
- final HashMap interestLastCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
- final Integer daysLastInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
- double interestLastRateInFraction = nominalAnnualInterest / 100;
- double perLastDay = (double) 1 / daysInYear;
- double interestLastPerDay = interestLastRateInFraction * perLastDay;
- Float interestLastPosted = (float) (interestLastPerDay * balance * 1);
-
- DecimalFormat decimalLastFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
- decimalLastFormat.applyPattern("#.###");
- interestLastPosted = Float.valueOf(decimalLastFormat.format(interestLastPosted));
- actualInterestPosted = Float.valueOf(decimalFormat.format(actualInterestPosted));
- assertEquals(interestLastPosted, actualInterestPosted, "Verifying interest posted");
- LOG.info("------Post Interest As On Successful Worked--------");
+ assertEquals(interestPosted, actualInterestPosted, "Verifying interest posted");
+ LOG.info("------Post Interest As On Successful Worked--------");
+
+ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_LAST_TRANSACTION_DATE);
+ HashMap accountLastDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
+ summary = (HashMap) accountLastDetails.get("summary");
+ Float actualLastInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
+
+ final Float nominalLastAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
+ final HashMap interestLastCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
+ final Integer daysLastInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
+ double interestLastRateInFraction = nominalAnnualInterest / 100;
+ double perLastDay = (double) 1 / daysInYear;
+ double interestLastPerDay = interestLastRateInFraction * perLastDay;
+ Float interestLastPosted = (float) (interestLastPerDay * balance * 1);
+
+ DecimalFormat decimalLastFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
+ decimalLastFormat.applyPattern("#.###");
+ interestLastPosted = Float.valueOf(decimalLastFormat.format(interestLastPosted));
+ actualInterestPosted = Float.valueOf(decimalFormat.format(actualInterestPosted));
+ assertEquals(interestLastPosted, actualInterestPosted, "Verifying interest posted");
+ LOG.info("------Post Interest As On Successful Worked--------");
}
-
-
@Test
public void testSavingsAccount_WITH_WITHHOLD_TAX() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
@@ -1816,7 +1680,8 @@ public class ClientSavingsIntegrationTest {
final String percentage = "10";
final Integer taxGroupId = createTaxGroup(percentage);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
- minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft, String.valueOf(taxGroupId), false);
+ minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft, String.valueOf(taxGroupId),
+ false);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
@@ -1864,7 +1729,8 @@ public class ClientSavingsIntegrationTest {
final String percentage = "10";
final Integer taxGroupId = createTaxGroup(percentage);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
- minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft, String.valueOf(taxGroupId), false);
+ minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft, String.valueOf(taxGroupId),
+ false);
Assertions.assertNotNull(savingsProductID);
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
@@ -1914,7 +1780,8 @@ public class ClientSavingsIntegrationTest {
final String percentage = "10";
final Integer taxGroupId = createTaxGroup(percentage);
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, MINIMUM_OPENING_BALANCE,
- minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft, String.valueOf(taxGroupId), true);
+ minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft, String.valueOf(taxGroupId),
+ true);
Assertions.assertNotNull(savingsProductID);
final Integer savingsChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
@@ -1923,8 +1790,9 @@ public class ClientSavingsIntegrationTest {
ArrayList<Integer> savingsList = new ArrayList<>();
- for(int i=0; i< 5; i++){
- final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
+ for (int i = 0; i < 5; i++) {
+ final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID,
+ ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertNotNull(savingsProductID);
HashMap modifications = this.savingsAccountHelper.updateSavingsAccount(clientID, savingsProductID, savingsId,
@@ -1958,7 +1826,7 @@ public class ClientSavingsIntegrationTest {
final DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMMM yyyy");
LocalDate transactionDate = new LocalDate();
- for(int i=0; i< 4; i++){
+ for (int i = 0; i < 4; i++) {
String TRANSACTION_DATE = formatter.print(transactionDate);
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsList.get(i), DEPOSIT_AMOUNT,
TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1968,7 +1836,7 @@ public class ClientSavingsIntegrationTest {
SchedulerJobHelper jobHelper = new SchedulerJobHelper(this.requestSpec);
jobHelper.executeAndAwaitJob("Update Savings Dormant Accounts");
- //VERIFY WITHIN PROVIDED RANGE DOESN'T INACTIVATE
+ // VERIFY WITHIN PROVIDED RANGE DOESN'T INACTIVATE
savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(0));
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(0));
@@ -1979,8 +1847,7 @@ public class ClientSavingsIntegrationTest {
balance -= chargeAmt;
assertEquals(balance, summary.get("accountBalance"), "Verifying account Balance");
-
- //VERIFY INACTIVE
+ // VERIFY INACTIVE
savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(1));
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(1));
@@ -1999,7 +1866,7 @@ public class ClientSavingsIntegrationTest {
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(1));
SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
- //VERIFY DORMANT
+ // VERIFY DORMANT
savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(2));
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(2));
@@ -2018,7 +1885,7 @@ public class ClientSavingsIntegrationTest {
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(2));
SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
- //VERIFY ESCHEAT DUE TO OLD TRANSACTION
+ // VERIFY ESCHEAT DUE TO OLD TRANSACTION
savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(3));
SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(3));
@@ -2026,7 +1893,7 @@ public class ClientSavingsIntegrationTest {
summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(3));
assertEquals(2900f, summary.get("accountBalance"), "Verifying account Balance");
- //VERIFY ESCHEAT DUE NO TRANSACTION FROM ACTIVATION
+ // VERIFY ESCHEAT DUE NO TRANSACTION FROM ACTIVATION
savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(4));
SavingsStatusChecker.verifySavingsAccountIsClosed(savingsStatusHashMap);
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(4));
@@ -2034,16 +1901,14 @@ public class ClientSavingsIntegrationTest {
summary = this.savingsAccountHelper.getSavingsSummary(savingsList.get(4));
assertEquals(900f, summary.get("accountBalance"), "Verifying account Balance");
- //VERIFY NON ACTIVE ACCOUNTS ARE NOT AFFECTED
+ // VERIFY NON ACTIVE ACCOUNTS ARE NOT AFFECTED
savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(5));
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
savingsStatusHashMap = SavingsStatusChecker.getSubStatusOfSavings(this.requestSpec, this.responseSpec, savingsList.get(5));
SavingsStatusChecker.verifySavingsSubStatusNone(savingsStatusHashMap);
-
}
-
private HashMap activateSavingsAccount(final Integer savingsId, final String activationDate) {
final HashMap status = this.savingsAccountHelper.activateSavingsAccount(savingsId, activationDate);
return status;
@@ -2066,7 +1931,7 @@ public class ClientSavingsIntegrationTest {
final String overDraftLimit = "2000.0";
savingsProductHelper = savingsProductHelper.withOverDraft(overDraftLimit);
}
- if(withDormancy){
+ if (withDormancy) {
savingsProductHelper = savingsProductHelper.withDormancy();
}
@@ -2085,13 +1950,13 @@ public class ClientSavingsIntegrationTest {
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
- private Integer createTaxGroup(final String percentage){
+ private Integer createTaxGroup(final String percentage) {
final Integer liabilityAccountId = null;
- final Integer taxComponentId = TaxComponentHelper.createTaxComponent(this.requestSpec, this.responseSpec, percentage, liabilityAccountId);
+ final Integer taxComponentId = TaxComponentHelper.createTaxComponent(this.requestSpec, this.responseSpec, percentage,
+ liabilityAccountId);
return TaxGroupHelper.createTaxGroup(this.requestSpec, this.responseSpec, Arrays.asList(taxComponentId));
}
-
/*
* private void verifySavingsInterest(final Object savingsInterest) {
* LOG.info(
@@ -2218,14 +2083,16 @@ public class ClientSavingsIntegrationTest {
}
/**
- * incorrect savings account balance when charge transaction is
- * reversed during an overdraft recalculate Daily Balances
+ * incorrect savings account balance when charge transaction is reversed
+ * during an overdraft recalculate Daily Balances
*/
@Test
public void testAccountBalanceAfterTransactionReversal() {
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
- //SavingsAccountHelper savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec,new ResponseSpecBuilder().build());
+ // SavingsAccountHelper savingsAccountHelperValidationError = new
+ // SavingsAccountHelper(this.requestSpec,new
+ // ResponseSpecBuilder().build());
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
Assertions.assertNotNull(clientID);
@@ -2239,22 +2106,18 @@ public class ClientSavingsIntegrationTest {
minBalanceForInterestCalculation, minRequiredBalance, enforceMinRequiredBalance, allowOverdraft);
Assertions.assertNotNull(savingsProductID);
-
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
Assertions.assertNotNull(savingsId);
-
HashMap savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
-
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, "500",
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
-
String chargeAmount = "300";
String chargeCurrency = "USD";
@@ -2265,14 +2128,13 @@ public class ClientSavingsIntegrationTest {
Integer amount = 300;
-
- final Integer chargeId = this.savingsAccountHelper.addChargesForSavingsWithDueDate(savingsId, savingsChargeId, SavingsAccountHelper.TRANSACTION_DATE,
- amount);
+ final Integer chargeId = this.savingsAccountHelper.addChargesForSavingsWithDueDate(savingsId, savingsChargeId,
+ SavingsAccountHelper.TRANSACTION_DATE, amount);
Assertions.assertNotNull(chargeId);
- final Integer payChargeId = this.savingsAccountHelper.payCharge(chargeId, savingsId, chargeAmount, SavingsAccountHelper.TRANSACTION_DATE);
-
+ final Integer payChargeId = this.savingsAccountHelper.payCharge(chargeId, savingsId, chargeAmount,
+ SavingsAccountHelper.TRANSACTION_DATE);
final Integer undoSavingsTransaction = this.savingsAccountHelper.undoSavingsAccountTransaction(savingsId, depositTransactionId);
HashMap reversedDepositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java
index 1ba5d4f..495a268 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientStatusChecker.java
@@ -25,6 +25,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ClientStatusChecker {
+
private final static Logger LOG = LoggerFactory.getLogger(ClientStatusChecker.class);
public static void verifyClientIsActive(final HashMap<String, Object> clientStatusHashMap) {
@@ -32,36 +33,31 @@ public class ClientStatusChecker {
}
public static void verifyClientClosed(final HashMap<String, Object> clientStatusHashMap) {
- LOG.info(
- "\n-------------------------------------- VERIFYING CLIENT IS CLOSED ------------------------------------");
+ LOG.info("\n-------------------------------------- VERIFYING CLIENT IS CLOSED ------------------------------------");
assertEquals(600, (int) clientStatusHashMap.get("id"));
LOG.info("Client Status: {} \n", clientStatusHashMap);
}
public static void verifyClientPending(final HashMap<String, Object> clientStatusHashMap) {
- LOG.info(
- "\n-------------------------------------- VERIFYING CLIENT IS PENDING ------------------------------------");
+ LOG.info("\n-------------------------------------- VERIFYING CLIENT IS PENDING ------------------------------------");
assertEquals(100, (int) clientStatusHashMap.get("id"));
LOG.info("Client Status: {} \n", clientStatusHashMap);
}
public static void verifyClientRejected(final HashMap<String, Object> clientStatusHashMap) {
- LOG.info(
- "\n-------------------------------------- VERIFYING CLIENT IS REJECTED ------------------------------------");
+ LOG.info("\n-------------------------------------- VERIFYING CLIENT IS REJECTED ------------------------------------");
assertEquals(700, (int) clientStatusHashMap.get("id"));
LOG.info("Client Status: {} \n", clientStatusHashMap);
}
public static void verifyClientActiavted(final HashMap<String, Object> clientStatusHashMap) {
- LOG.info(
- "\n-------------------------------------- VERIFYING CLIENT IS ACTIVATED ------------------------------------");
+ LOG.info("\n-------------------------------------- VERIFYING CLIENT IS ACTIVATED ------------------------------------");
assertEquals(300, (int) clientStatusHashMap.get("id"));
LOG.info("Client Status: {} \n", clientStatusHashMap);
}
public static void verifyClientWithdrawn(final HashMap<String, Object> clientStatusHashMap) {
- LOG.info(
- "\n-------------------------------------- VERIFYING CLIENT IS WITHDRAWN ------------------------------------");
+ LOG.info("\n-------------------------------------- VERIFYING CLIENT IS WITHDRAWN ------------------------------------");
assertEquals(800, (int) clientStatusHashMap.get("id"));
LOG.info("Client Status: {} \n", clientStatusHashMap);
}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientUndoRejectAndWithdrawalIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientUndoRejectAndWithdrawalIntegrationTest.java
index 1cbcc05..cd61a82 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientUndoRejectAndWithdrawalIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientUndoRejectAndWithdrawalIntegrationTest.java
@@ -53,8 +53,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
public void setup() {
Utils.initializeRESTAssured();
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
- this.requestSpec.header("Authorization",
- "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
+ this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
@@ -69,8 +68,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
@@ -93,8 +91,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
@@ -122,8 +119,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
@@ -152,8 +148,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
@@ -182,8 +177,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
@@ -207,8 +201,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
@@ -236,8 +229,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
Calendar todaysDate = Calendar.getInstance();
@@ -265,8 +257,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
@@ -297,16 +288,14 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
ClientStatusChecker.verifyClientWithdrawn(status);
status = this.clientHelper.undoWithdrawn(clientId);
ClientStatusChecker.verifyClientPending(status);
- ArrayList<HashMap<String, Object>> clientErrorData = validationErrorHelper.activateClient(clientId,
- CommonConstants.RESPONSE_ERROR);
+ ArrayList<HashMap<String, Object>> clientErrorData = validationErrorHelper.activateClient(clientId, CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.clients.submittedOnDate.after.reopened.date",
clientErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
@@ -315,15 +304,15 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
@Test
public void testReopenedDate() {
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(400).build();
- //final ClientHelper validationErrorHelper = new ClientHelper(this.requestSpec, errorResponse);
+ // final ClientHelper validationErrorHelper = new
+ // ClientHelper(this.requestSpec, errorResponse);
// CREATE CLIENT
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
final Integer clientId = ClientHelper.createClientPending(this.requestSpec, this.responseSpec);
Assertions.assertNotNull(clientId);
// GET CLIENT STATUS
- HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec,
- String.valueOf(clientId));
+ HashMap<String, Object> status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
ClientStatusChecker.verifyClientPending(status);
status = this.clientHelper.withdrawClient(clientId);
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java
old mode 100755
new mode 100644
index 3fef893..e8a0083
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ConcurrencyIntegrationTest.java
@@ -41,6 +41,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConcurrencyIntegrationTest {
+
private final static Logger LOG = LoggerFactory.getLogger(ConcurrencyIntegrationTest.class);
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@@ -75,7 +76,7 @@ public class ConcurrencyIntegrationTest {
date.set(2011, 9, 20);
Float repaymentAmount = 100.0f;
for (int i = 0; i < 10; i++) {
- LOG.info("Starting concurrent transaction number {}" , i);
+ LOG.info("Starting concurrent transaction number {}", i);
date.add(Calendar.DAY_OF_MONTH, 1);
repaymentAmount = repaymentAmount + 100;
Runnable worker = new LoanRepaymentExecutor(loanTransactionHelper, loanID, repaymentAmount, date);
@@ -152,12 +153,13 @@ public class ConcurrencyIntegrationTest {
try {
this.loanTransactionHelper.makeRepayment(repaymentDate, repaymentAmount, loanId);
} catch (Exception e) {
- LOG.info("Found an exception {}" , e.getMessage());
- LOG.info("Details of failed concurrent transaction (date, amount, loanId) are {},{},{}" , repaymentDate, repaymentAmount , loanId);
+ LOG.info("Found an exception {}", e.getMessage());
+ LOG.info("Details of failed concurrent transaction (date, amount, loanId) are {},{},{}", repaymentDate, repaymentAmount,
+ loanId);
throw (e);
}
- LOG.info("Details of passed concurrent transaction, details (date, amount, loanId) are {},{},{}" , repaymentDate
- , repaymentAmount , loanId);
+ LOG.info("Details of passed concurrent transaction, details (date, amount, loanId) are {},{},{}", repaymentDate,
+ repaymentAmount, loanId);
}
}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrenciesTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrenciesTest.java
index dd99365..583de97 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrenciesTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrenciesTest.java
@@ -73,7 +73,6 @@ public class CurrenciesTest {
currenciestoUpdate.add("USD");
currenciestoUpdate.add("INR");
-
ArrayList<String> currenciesOutput = CurrenciesHelper.updateSelectedCurrencies(this.requestSpec, this.responseSpec,
currenciestoUpdate);
Assertions.assertNotNull(currenciesOutput);
@@ -92,4 +91,4 @@ public class CurrenciesTest {
Assertions.assertEquals(currenciesBeforeUpdate, currenciesAfterUpdate, "Verifying Do Selected Currencies Match after Updation");
}
-}
\ No newline at end of file
+}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrencyIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrencyIntegrationTest.java
index 5c5ffef..b07c50b 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrencyIntegrationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/CurrencyIntegrationTest.java
@@ -33,7 +33,6 @@ public class CurrencyIntegrationTest {
private RequestSpecification requestSpec;
private SavingsAccountHelper savingsAccountHelper;
-
@BeforeEach
public void setup() {
Utils.initializeRESTAssured();
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java
index ee46677..a9bac38 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/DisbursalAndRepaymentScheduleTest.java
@@ -53,362 +53,352 @@ import org.junit.jupiter.api.Test;
@Disabled
public class DisbursalAndRepaymentScheduleTest {
- private ResponseSpecification responseSpec;
- private ResponseSpecification responseSpecForStatusCode403;
- private ResponseSpecification generalResponseSpec;
- private RequestSpecification requestSpec;
- private LoanTransactionHelper loanTransactionHelper;
- private LoanRescheduleRequestHelper loanRescheduleRequestHelper;
- private Integer loanRescheduleRequestId;
- private Integer clientId;
- private Integer groupId;
- private Integer groupCalendarId;
- private Integer loanProductId;
- private Integer loanId;
- private final String loanPrincipalAmount = "100000.00";
- private final String numberOfRepayments = "12";
- private final String interestRatePerPeriod = "18";
-
- private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy");
-
- @BeforeEach
- public void setup() {
- Utils.initializeRESTAssured();
+ private ResponseSpecification responseSpec;
+ private ResponseSpecification responseSpecForStatusCode403;
+ private ResponseSpecification generalResponseSpec;
+ private RequestSpecification requestSpec;
+ private LoanTransactionHelper loanTransactionHelper;
+ private LoanRescheduleRequestHelper loanRescheduleRequestHelper;
+ private Integer loanRescheduleRequestId;
+ private Integer clientId;
+ private Integer groupId;
+ private Integer groupCalendarId;
+ private Integer loanProductId;
+ private Integer loanId;
+ private final String loanPrincipalAmount = "100000.00";
+ private final String numberOfRepayments = "12";
+ private final String interestRatePerPeriod = "18";
+
+ private final SimpleDateFormat dateFormatterStandard = new SimpleDateFormat("dd MMMM yyyy");
+
+ @BeforeEach
+ public void setup() {
+ Utils.initializeRESTAssured();
+ }
+
+ @Test
+ public void testRescheduleJLGLoanSynk() {
+ // system.out.println("---------------------------------STARTING
+ // RESCHEDULE JLG
+ // LOAN TEST ------------------------------------------");
+
+ Calendar meetingCalendar = Calendar.getInstance();
+ meetingCalendar.setFirstDayOfWeek(Calendar.MONDAY);
+ meetingCalendar.setTime(new java.util.Date());
+
+ int today = meetingCalendar.get(Calendar.DAY_OF_WEEK);
+ // making sure that the meeting calendar is set for the coming monday.
+ if (today >= Calendar.MONDAY) {
+ meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today + 7));
+ } else {
+ meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today));
}
- @Test
- public void testRescheduleJLGLoanSynk() {
- // system.out.println("---------------------------------STARTING RESCHEDULE JLG
- // LOAN TEST ------------------------------------------");
-
- Calendar meetingCalendar = Calendar.getInstance();
- meetingCalendar.setFirstDayOfWeek(Calendar.MONDAY);
- meetingCalendar.setTime(new java.util.Date());
-
- int today = meetingCalendar.get(Calendar.DAY_OF_WEEK);
- // making sure that the meeting calendar is set for the coming monday.
- if (today >= Calendar.MONDAY) {
- meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today + 7));
- } else {
- meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today));
- }
-
- Calendar groupMeetingChangeCalendar = (Calendar) meetingCalendar.clone();
-
- meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
-
- final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
-
- final String disbursalDate = groupMeetingDate; // first meeting date
- // after group creation
-
- final String rescheduleSubmittedDate = this.dateFormatterStandard.format(new java.util.Date());
-
- final String loanType = "jlg";
- final String rescheduleInterestRate = "28.0";
- groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
- final String groupMeetingNewStartDate = this.dateFormatterStandard
- .format(groupMeetingChangeCalendar.getTime());
- // The date
- // from
- // which we
- // start the
- // new group
- // meeting
- // occasion,
- // this is a
- // tuesday.
- groupMeetingChangeCalendar.add(Calendar.WEEK_OF_YEAR, 2);
- final String rescheduleDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
-
- this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
- this.requestSpec.header("Authorization",
- "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
- this.requestSpec.header("Fineract-Platform-TenantId", "default");
- this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
- this.generalResponseSpec = new ResponseSpecBuilder().build();
- this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
-
- this.loanRescheduleRequestHelper = new LoanRescheduleRequestHelper(this.requestSpec, this.responseSpec);
- // system.out.println("---------------------------------CREATING ENTITIES AND
- // JLG LOAN ------------------------------------------");
- // create all required entities
- this.createRequiredEntitiesForJLGLoanSync(groupMeetingDate);
-
- final String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal(loanPrincipalAmount)
- .withLoanTermFrequency("24").withLoanTermFrequencyAsWeeks().withNumberOfRepayments("12")
- .withRepaymentEveryAfter("2").withRepaymentFrequencyTypeAsMonths()
- .withAmortizationTypeAsEqualInstallments().withInterestCalculationPeriodTypeAsDays()
- .withInterestRatePerPeriod(interestRatePerPeriod).withRepaymentFrequencyTypeAsWeeks()
- .withSubmittedOnDate(disbursalDate).withExpectedDisbursementDate(disbursalDate)
- .withLoanType(loanType).withSyncDisbursementWithMeetin()
- .withCalendarID(this.groupCalendarId.toString()).build(this.clientId.toString(),
- this.groupId.toString(), this.loanProductId.toString(), null);
-
- this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
-
- // Test for loan account is created
- Assertions.assertNotNull(this.loanId);
- HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
- this.loanId);
-
- LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
-
- // Test for loan account is created, can be approved
- this.loanTransactionHelper.approveLoan(disbursalDate, this.loanId);
- loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
- LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
-
- // Test for loan account approved can be disbursed
- this.loanTransactionHelper.disburseLoan(disbursalDate, this.loanId);
- loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
- LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
-
- // system.out.println("---------------------------------CHANGING GROUP MEETING
- // DATE ------------------------------------------");
- CalendarHelper.updateMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId,
- this.groupCalendarId.toString(), groupMeetingNewStartDate, "2", "2", "2"); // New
- // meeting
- // dates
- // will be
- // the
- // tuesday
- // after the
- // coming
- // monday
-
- ArrayList loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec,
- generalResponseSpec, this.loanId);
-
- ArrayList dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
- Calendar dueDateCalendar = Calendar.getInstance();
- dueDateCalendar.setFirstDayOfWeek(Calendar.MONDAY);
- dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
- (Integer) dueDateLoanSchedule.get(2));
- assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
- "AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY");
-
- // system.out.println("---------------------------------CREATING LOAN RESCHEDULE
- // REQUEST------------------------------------------");
-
- String requestJSON = new LoanRescheduleRequestTestBuilder().updateGraceOnInterest("2")
- .updateGraceOnPrincipal("2").updateNewInterestRate(rescheduleInterestRate)
- .updateRescheduleFromDate(rescheduleDate).updateSubmittedOnDate(rescheduleSubmittedDate)
- .build(this.loanId.toString());
-
- this.loanRescheduleRequestId = this.loanRescheduleRequestHelper
- .createLoanRescheduleRequest(requestJSON);
- this.loanRescheduleRequestHelper.verifyCreationOfLoanRescheduleRequest(this.loanRescheduleRequestId);
-
- loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec,
- generalResponseSpec, this.loanId);
- dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
- dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
- (Integer) dueDateLoanSchedule.get(2));
- assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
+ Calendar groupMeetingChangeCalendar = (Calendar) meetingCalendar.clone();
+
+ meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
+
+ final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
+
+ final String disbursalDate = groupMeetingDate; // first meeting date
+ // after group creation
+
+ final String rescheduleSubmittedDate = this.dateFormatterStandard.format(new java.util.Date());
+
+ final String loanType = "jlg";
+ final String rescheduleInterestRate = "28.0";
+ groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
+ final String groupMeetingNewStartDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
+ // The date
+ // from
+ // which we
+ // start the
+ // new group
+ // meeting
+ // occasion,
+ // this is a
+ // tuesday.
+ groupMeetingChangeCalendar.add(Calendar.WEEK_OF_YEAR, 2);
+ final String rescheduleDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
+
+ this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
+ this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
+ this.requestSpec.header("Fineract-Platform-TenantId", "default");
+ this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
+ this.generalResponseSpec = new ResponseSpecBuilder().build();
+ this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
+
+ this.loanRescheduleRequestHelper = new LoanRescheduleRequestHelper(this.requestSpec, this.responseSpec);
+ // system.out.println("---------------------------------CREATING
+ // ENTITIES AND
+ // JLG LOAN ------------------------------------------");
+ // create all required entities
+ this.createRequiredEntitiesForJLGLoanSync(groupMeetingDate);
+
+ final String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal(loanPrincipalAmount).withLoanTermFrequency("24")
+ .withLoanTermFrequencyAsWeeks().withNumberOfRepayments("12").withRepaymentEveryAfter("2")
+ .withRepaymentFrequencyTypeAsMonths().withAmortizationTypeAsEqualInstallments().withInterestCalculationPeriodTypeAsDays()
+ .withInterestRatePerPeriod(interestRatePerPeriod).withRepaymentFrequencyTypeAsWeeks().withSubmittedOnDate(disbursalDate)
+ .withExpectedDisbursementDate(disbursalDate).withLoanType(loanType).withSyncDisbursementWithMeetin()
+ .withCalendarID(this.groupCalendarId.toString())
+ .build(this.clientId.toString(), this.groupId.toString(), this.loanProductId.toString(), null);
+
+ this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
+
+ // Test for loan account is created
+ Assertions.assertNotNull(this.loanId);
+ HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
+
+ LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
+
+ // Test for loan account is created, can be approved
+ this.loanTransactionHelper.approveLoan(disbursalDate, this.loanId);
+ loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
+ LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
+
+ // Test for loan account approved can be disbursed
+ this.loanTransactionHelper.disburseLoan(disbursalDate, this.loanId);
+ loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
+ LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
+
+ // system.out.println("---------------------------------CHANGING GROUP
+ // MEETING
+ // DATE ------------------------------------------");
+ CalendarHelper.updateMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId, this.groupCalendarId.toString(),
+ groupMeetingNewStartDate, "2", "2", "2"); // New
+ // meeting
+ // dates
+ // will be
+ // the
+ // tuesday
+ // after the
+ // coming
+ // monday
+
+ ArrayList loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec,
+ this.loanId);
+
+ ArrayList dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
+ Calendar dueDateCalendar = Calendar.getInstance();
+ dueDateCalendar.setFirstDayOfWeek(Calendar.MONDAY);
+ dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
+ (Integer) dueDateLoanSchedule.get(2));
+ assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK), "AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY");
+
+ // system.out.println("---------------------------------CREATING LOAN
+ // RESCHEDULE
+ // REQUEST------------------------------------------");
+
+ String requestJSON = new LoanRescheduleRequestTestBuilder().updateGraceOnInterest("2").updateGraceOnPrincipal("2")
+ .updateNewInterestRate(rescheduleInterestRate).updateRescheduleFromDate(rescheduleDate)
+ .updateSubmittedOnDate(rescheduleSubmittedDate).build(this.loanId.toString());
+
+ this.loanRescheduleRequestId = this.loanRescheduleRequestHelper.createLoanRescheduleRequest(requestJSON);
+ this.loanRescheduleRequestHelper.verifyCreationOfLoanRescheduleRequest(this.loanRescheduleRequestId);
+
+ loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, this.loanId);
+ dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
+ dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
+ (Integer) dueDateLoanSchedule.get(2));
+ assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
"AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER LOAN RESCHEDULE REQUEST WAS SENT");
- // system.out.println("Successfully created loan reschedule request (ID: " +
- // this.loanRescheduleRequestId + ")");
-
- // system.out.println("-----------------------------APPROVING LOAN RESCHEDULE
- // REQUEST--------------------------");
-
- requestJSON = new LoanRescheduleRequestTestBuilder().updateSubmittedOnDate(rescheduleSubmittedDate)
- .getApproveLoanRescheduleRequestJSON();
- this.loanRescheduleRequestHelper.approveLoanRescheduleRequest(this.loanRescheduleRequestId,
- requestJSON);
-
- final HashMap response = (HashMap) this.loanRescheduleRequestHelper
- .getLoanRescheduleRequest(loanRescheduleRequestId, "statusEnum");
- assertTrue((Boolean) response.get("approved"));
-
- loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec,
- generalResponseSpec, this.loanId);
-
- dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
- dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
- (Integer) dueDateLoanSchedule.get(2));
- assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
- "AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER RESCHEDULE");
- // system.out.println("Successfully changed group meeting date (CAELNDAR ID: " +
- // this.groupCalendarId
- // + ") and rescheduled loan (RESCHEDULE ID: " + this.loanRescheduleRequestId +
- // ")");
-
- this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec,
- this.responseSpecForStatusCode403);
+ // system.out.println("Successfully created loan reschedule request (ID:
+ // " +
+ // this.loanRescheduleRequestId + ")");
+
+ // system.out.println("-----------------------------APPROVING LOAN
+ // RESCHEDULE
+ // REQUEST--------------------------");
+
+ requestJSON = new LoanRescheduleRequestTestBuilder().updateSubmittedOnDate(rescheduleSubmittedDate)
+ .getApproveLoanRescheduleRequestJSON();
+ this.loanRescheduleRequestHelper.approveLoanRescheduleRequest(this.loanRescheduleRequestId, requestJSON);
+
+ final HashMap response = (HashMap) this.loanRescheduleRequestHelper.getLoanRescheduleRequest(loanRescheduleRequestId, "statusEnum");
+ assertTrue((Boolean) response.get("approved"));
+
+ loanRepaymnetSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, generalResponseSpec, this.loanId);
+
+ dueDateLoanSchedule = (ArrayList) ((HashMap) loanRepaymnetSchedule.get(2)).get("dueDate");
+ dueDateCalendar.set((Integer) dueDateLoanSchedule.get(0), (Integer) dueDateLoanSchedule.get(1) - 1,
+ (Integer) dueDateLoanSchedule.get(2));
+ assertEquals(3, dueDateCalendar.get(Calendar.DAY_OF_WEEK),
+ "AFTER MEETING CHANGE DATE THE NEXT REPAYMENT SHOULD BE ON TUESDAY, EVEN AFTER RESCHEDULE");
+ // system.out.println("Successfully changed group meeting date (CAELNDAR
+ // ID: " +
+ // this.groupCalendarId
+ // + ") and rescheduled loan (RESCHEDULE ID: " +
+ // this.loanRescheduleRequestId +
+ // ")");
+
+ this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpecForStatusCode403);
+ }
+
+ @Test
+ public void testChangeGroupMeetingMaturedOnDate() {
+ // system.out
+ // .println("---------------------------------STARTING GROUP LOAN
+ // MEETING CHANGE
+ // DATE EXPECTED MATURED
+ // CHANGE------------------------------------------");
+
+ Calendar meetingCalendar = Calendar.getInstance();
+ meetingCalendar.setFirstDayOfWeek(Calendar.MONDAY);
+ meetingCalendar.setTime(new java.util.Date());
+
+ int today = meetingCalendar.get(Calendar.DAY_OF_WEEK);
+ // making sure that the meeting calendar is set for the coming monday.
+ if (today >= Calendar.MONDAY) {
+ meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today + 7));
+ } else {
+ meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today));
}
- @Test
- public void testChangeGroupMeetingMaturedOnDate() {
- // system.out
- // .println("---------------------------------STARTING GROUP LOAN MEETING CHANGE
- // DATE EXPECTED MATURED CHANGE------------------------------------------");
-
- Calendar meetingCalendar = Calendar.getInstance();
- meetingCalendar.setFirstDayOfWeek(Calendar.MONDAY);
- meetingCalendar.setTime(new java.util.Date());
-
- int today = meetingCalendar.get(Calendar.DAY_OF_WEEK);
- // making sure that the meeting calendar is set for the coming monday.
- if (today >= Calendar.MONDAY) {
- meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today + 7));
- } else {
- meetingCalendar.add(Calendar.DAY_OF_YEAR, +(Calendar.MONDAY - today));
- }
-
- Calendar groupMeetingChangeCalendar = (Calendar) meetingCalendar.clone();
-
- meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
-
- final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
-
- final String disbursalDate = groupMeetingDate; // first meeting date
- // after group creation
-
- final String loanType = "jlg";
- groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
- final String groupMeetingNewStartDate = this.dateFormatterStandard
- .format(groupMeetingChangeCalendar.getTime());
- // The date
- // from
- // which we
- // start the
- // new group
- // meeting
- // occasion,
- // this is a
- // tuesday.
-
- this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
- this.requestSpec.header("Authorization",
- "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
- this.requestSpec.header("Fineract-Platform-TenantId", "default");
- this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
- this.generalResponseSpec = new ResponseSpecBuilder().build();
- this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
-
- this.loanRescheduleRequestHelper = new LoanRescheduleRequestHelper(this.requestSpec, this.responseSpec);
- // system.out.println("---------------------------------CREATING ENTITIES AND
- // JLG LOAN ------------------------------------------");
- // create all required entities
- this.createRequiredEntitiesForJLGLoanSync(groupMeetingDate);
-
- final String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal(loanPrincipalAmount)
- .withLoanTermFrequency("24").withLoanTermFrequencyAsWeeks().withNumberOfRepayments("12")
- .withRepaymentEveryAfter("2").withRepaymentFrequencyTypeAsMonths()
- .withAmortizationTypeAsEqualInstallments().withInterestCalculationPeriodTypeAsDays()
- .withInterestRatePerPeriod(interestRatePerPeriod).withRepaymentFrequencyTypeAsWeeks()
- .withSubmittedOnDate(disbursalDate).withExpectedDisbursementDate(disbursalDate)
- .withLoanType(loanType).withSyncDisbursementWithMeetin()
- .withCalendarID(this.groupCalendarId.toString()).build(this.clientId.toString(),
- this.groupId.toString(), this.loanProductId.toString(), null);
-
- this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
-
- // Test for loan account is created
- Assertions.assertNotNull(this.loanId);
- HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec,
- this.loanId);
-
- LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
-
- // Test for loan account is created, can be approved
- this.loanTransactionHelper.approveLoan(disbursalDate, this.loanId);
- loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
- LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
-
- // Test for loan account approved can be disbursed
- this.loanTransactionHelper.disburseLoan(disbursalDate, this.loanId);
- loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
- LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
-
- // system.out.println("---------------------------------CHANGING GROUP MEETING
- // DATE ------------------------------------------");
- CalendarHelper.updateMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId,
- this.groupCalendarId.toString(), groupMeetingNewStartDate, "2", "2", "2"); // New
- // meeting
- // dates
- // will be
- // the
- // tuesday
- // after the
- // coming
- // monday
-
- Calendar expectedMaturityCalendar = Calendar.getInstance();
- expectedMaturityCalendar.setFirstDayOfWeek(Calendar.MONDAY);
- ArrayList expectedMaturityDate = ((ArrayList) ((HashMap) this.loanTransactionHelper
- .getLoanDetail(requestSpec, generalResponseSpec, this.loanId, "timeline"))
- .get("expectedMaturityDate"));
-
- expectedMaturityCalendar.set((Integer) expectedMaturityDate.get(0),
- (Integer) expectedMaturityDate.get(1) - 1, (Integer) expectedMaturityDate.get(2));
-
- assertEquals(3, expectedMaturityCalendar.get(Calendar.DAY_OF_WEEK),
- "AFTER MEETING CHANGE DATE THE EXPECTED MATURITY SHOULD BE ON TUESDAY");
-
- this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec,
- this.responseSpecForStatusCode403);
- }
-
- /**
- * entities for jlg loan
- **/
- private void createRequiredEntitiesForJLGLoanSync(final String groupActivationDate) {
- this.createGroupEntityWithCalendar("2", "2", "1", groupActivationDate);// frequency=2:Weekly
- // , interval=2:
- // Every two weeks ,
- // repeatsOnDay=1:Monday
- // groupActivationDate is decided by the current date
- this.createClientEntity();
- this.associateClientToGroup(this.groupId, this.clientId);
- this.createLoanProductEntity();
-
- }
-
- /*
- * Associate client to the group
- */
-
- private void associateClientToGroup(final Integer groupId, final Integer clientId) {
- GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupId.toString(),
- clientId.toString());
- GroupHelper.verifyGroupMembers(this.requestSpec, this.responseSpec, groupId, clientId);
- }
-
- private void createGroupEntityWithCalendar(final String frequency, final String interval,
- final String repeatsOnDay, final String groupActivationDate) {
- this.groupId = GroupHelper.createGroup(this.requestSpec, this.responseSpec, groupActivationDate);
- GroupHelper.verifyGroupCreatedOnServer(this.requestSpec, this.responseSpec, this.groupId);
-
- final String startDate = groupActivationDate;
-
- this.setGroupCalendarId(CalendarHelper.createMeetingCalendarForGroup(this.requestSpec,
- this.responseSpec, this.groupId, startDate, frequency, interval, repeatsOnDay));
- }
-
- /**
- * create a new client
- **/
- private void createClientEntity() {
- this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
- ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, this.clientId);
- }
-
- /**
- * create a new loan product
- **/
- private void createLoanProductEntity() {
- final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(loanPrincipalAmount)
- .withNumberOfRepayments(numberOfRepayments)
- .withinterestRatePerPeriod(interestRatePerPeriod).withInterestRateFrequencyTypeAsYear()
- .build(null);
- this.loanProductId = this.loanTransactionHelper.getLoanProductId(loanProductJSON);
- }
-
- public void setGroupCalendarId(Integer groupCalendarId) {
- this.groupCalendarId = groupCalendarId;
- }
-}
\ No newline at end of file
+ Calendar groupMeetingChangeCalendar = (Calendar) meetingCalendar.clone();
+
+ meetingCalendar.add(Calendar.WEEK_OF_YEAR, -3);
+
+ final String groupMeetingDate = this.dateFormatterStandard.format(meetingCalendar.getTime());
+
+ final String disbursalDate = groupMeetingDate; // first meeting date
+ // after group creation
+
+ final String loanType = "jlg";
+ groupMeetingChangeCalendar.add(Calendar.DAY_OF_YEAR, 1);
+ final String groupMeetingNewStartDate = this.dateFormatterStandard.format(groupMeetingChangeCalendar.getTime());
+ // The date
+ // from
+ // which we
+ // start the
+ // new group
+ // meeting
+ // occasion,
+ // this is a
+ // tuesday.
+
+ this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
+ this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
+ this.requestSpec.header("Fineract-Platform-TenantId", "default");
+ this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
+ this.generalResponseSpec = new ResponseSpecBuilder().build();
+ this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
+
+ this.loanRescheduleRequestHelper = new LoanRescheduleRequestHelper(this.requestSpec, this.responseSpec);
+ // system.out.println("---------------------------------CREATING
+ // ENTITIES AND
+ // JLG LOAN ------------------------------------------");
+ // create all required entities
+ this.createRequiredEntitiesForJLGLoanSync(groupMeetingDate);
+
+ final String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal(loanPrincipalAmount).withLoanTermFrequency("24")
+ .withLoanTermFrequencyAsWeeks().withNumberOfRepayments("12").withRepaymentEveryAfter("2")
+ .withRepaymentFrequencyTypeAsMonths().withAmortizationTypeAsEqualInstallments().withInterestCalculationPeriodTypeAsDays()
+ .withInterestRatePerPeriod(interestRatePerPeriod).withRepaymentFrequencyTypeAsWeeks().withSubmittedOnDate(disbursalDate)
+ .withExpectedDisbursementDate(disbursalDate).withLoanType(loanType).withSyncDisbursementWithMeetin()
+ .withCalendarID(this.groupCalendarId.toString())
+ .build(this.clientId.toString(), this.groupId.toString(), this.loanProductId.toString(), null);
+
+ this.loanId = this.loanTransactionHelper.getLoanId(loanApplicationJSON);
+
+ // Test for loan account is created
+ Assertions.assertNotNull(this.loanId);
+ HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
+
+ LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
+
+ // Test for loan account is created, can be approved
+ this.loanTransactionHelper.approveLoan(disbursalDate, this.loanId);
+ loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
+ LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
+
+ // Test for loan account approved can be disbursed
+ this.loanTransactionHelper.disburseLoan(disbursalDate, this.loanId);
+ loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, this.loanId);
+ LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
+
+ // system.out.println("---------------------------------CHANGING GROUP
+ // MEETING
+ // DATE ------------------------------------------");
+ CalendarHelper.updateMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId, this.groupCalendarId.toString(),
+ groupMeetingNewStartDate, "2", "2", "2"); // New
+ // meeting
+ // dates
+ // will be
+ // the
+ // tuesday
+ // after the
+ // coming
+ // monday
+
+ Calendar expectedMaturityCalendar = Calendar.getInstance();
+ expectedMaturityCalendar.setFirstDayOfWeek(Calendar.MONDAY);
+ ArrayList expectedMaturityDate = ((ArrayList) ((HashMap) this.loanTransactionHelper.getLoanDetail(requestSpec, generalResponseSpec,
+ this.loanId, "timeline")).get("expectedMaturityDate"));
+
+ expectedMaturityCalendar.set((Integer) expectedMaturityDate.get(0), (Integer) expectedMaturityDate.get(1) - 1,
+ (Integer) expectedMaturityDate.get(2));
+
+ assertEquals(3, expectedMaturityCalendar.get(Calendar.DAY_OF_WEEK),
+ "AFTER MEETING CHANGE DATE THE EXPECTED MATURITY SHOULD BE ON TUESDAY");
+
+ this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpecForStatusCode403);
+ }
+
+ /**
+ * entities for jlg loan
+ **/
+ private void createRequiredEntitiesForJLGLoanSync(final String groupActivationDate) {
+ this.createGroupEntityWithCalendar("2", "2", "1", groupActivationDate);// frequency=2:Weekly
+ // , interval=2:
+ // Every two weeks ,
+ // repeatsOnDay=1:Monday
+ // groupActivationDate is decided by the current date
+ this.createClientEntity();
+ this.associateClientToGroup(this.groupId, this.clientId);
+ this.createLoanProductEntity();
+
+ }
+
+ /*
+ * Associate client to the group
+ */
+
+ private void associateClientToGroup(final Integer groupId, final Integer clientId) {
+ GroupHelper.associateClient(this.requestSpec, this.responseSpec, groupId.toString(), clientId.toString());
+ GroupHelper.verifyGroupMembers(this.requestSpec, this.responseSpec, groupId, clientId);
+ }
+
+ private void createGroupEntityWithCalendar(final String frequency, final String interval, final String repeatsOnDay,
+ final String groupActivationDate) {
+ this.groupId = GroupHelper.createGroup(this.requestSpec, this.responseSpec, groupActivationDate);
+ GroupHelper.verifyGroupCreatedOnServer(this.requestSpec, this.responseSpec, this.groupId);
+
+ final String startDate = groupActivationDate;
+
+ this.setGroupCalendarId(CalendarHelper.createMeetingCalendarForGroup(this.requestSpec, this.responseSpec, this.groupId, startDate,
+ frequency, interval, repeatsOnDay));
+ }
+
+ /**
+ * create a new client
+ **/
+ private void createClientEntity() {
+ this.clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
+ ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, this.clientId);
+ }
+
+ /**
+ * create a new loan product
+ **/
+ private void createLoanProductEntity() {
+ final String loanProductJSON = new LoanProductTestBuilder().withPrincipal(loanPrincipalAmount)
+ .withNumberOfRepayments(numberOfRepayments).withinterestRatePerPeriod(interestRatePerPeriod)
+ .withInterestRateFrequencyTypeAsYear().build(null);
+ this.loanProductId = this.loanTransactionHelper.getLoanProductId(loanProductJSON);
+ }
+
+ public void setGroupCalendarId(Integer groupCalendarId) {
+ this.groupCalendarId = groupCalendarId;
+ }
+}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java
index 7322400..14c58c5 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ExternalServicesConfigurationTest.java
@@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
public class ExternalServicesConfigurationTest {
+
private final static Logger LOG = LoggerFactory.getLogger(ExternalServicesConfigurationTest.class);
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@@ -65,11 +66,11 @@ public class ExternalServicesConfigurationTest {
String value = null;
if (name.equals(configName)) {
value = (String) externalServicesConfig.get(configIndex).get("value");
- if(value == null){
+ if (value == null) {
value = "testnull";
}
String newValue = "test";
- LOG.info( "{} : {}",name, value);
+ LOG.info("{} : {}", name, value);
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "S3", name, newValue);
Assertions.assertNotNull(arrayListValue.get("value"));
@@ -93,11 +94,11 @@ public class ExternalServicesConfigurationTest {
String value = null;
if (name.equals(configName)) {
value = (String) externalServicesConfig.get(configIndex).get("value");
- if(value == null){
+ if (value == null) {
value = "testnull";
}
String newValue = "test";
- LOG.info("{} : {}",name,value);
+ LOG.info("{} : {}", name, value);
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
responseSpec, "SMTP", name, newValue);
Assertions.assertNotNull(arrayListValue.get("value"));
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FinancialActivityAccountsTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FinancialActivityAccountsTest.java
old mode 100755
new mode 100644
index bd71de5..453601f
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FinancialActivityAccountsTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FinancialActivityAccountsTest.java
@@ -86,7 +86,8 @@ public class FinancialActivityAccountsTest {
* Fetch Created Financial Activity to Account Mapping and validate
* created values
**/
- assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount);
+ assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID,
+ liabilityTransferAccount);
/**
* Update Existing Financial Activity to Account Mapping and assert
@@ -129,8 +130,8 @@ public class FinancialActivityAccountsTest {
invalidFinancialActivityAccountError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
/** Should be able to delete a Financial Activity to Account Mapping **/
- Integer deletedFinancialActivityAccountId = financialActivityAccountHelper.deleteFinancialActivityAccount(
- financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
+ Integer deletedFinancialActivityAccountId = financialActivityAccountHelper
+ .deleteFinancialActivityAccount(financialActivityAccountId, responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
@@ -138,7 +139,8 @@ public class FinancialActivityAccountsTest {
financialActivityAccountHelper.getFinancialActivityAccount(deletedFinancialActivityAccountId, responseSpecForResourceNotFoundError);
}
- private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId, Account glAccount) {
+ private void assertFinancialActivityAccountCreation(Integer financialActivityAccountId, Integer financialActivityId,
+ Account glAccount) {
HashMap mappingDetails = financialActivityAccountHelper.getFinancialActivityAccount(financialActivityAccountId, responseSpec);
Assertions.assertEquals(financialActivityId, ((HashMap) mappingDetails.get("financialActivityData")).get("id"));
Assertions.assertEquals(glAccount.getAccountID(), ((HashMap) mappingDetails.get("glAccountData")).get("id"));
@@ -152,8 +154,8 @@ public class FinancialActivityAccountsTest {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
for (HashMap financialActivity : financialActivities) {
Integer financialActivityAccountId = (Integer) financialActivity.get("id");
- Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper.deleteFinancialActivityAccount(
- financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
+ Integer deletedFinancialActivityAccountId = this.financialActivityAccountHelper
+ .deleteFinancialActivityAccount(financialActivityAccountId, this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID);
Assertions.assertNotNull(deletedFinancialActivityAccountId);
Assertions.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
index 3cf612a..f6b640b 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java
@@ -65,6 +65,7 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access" })
public class FixedDepositTest {
+
private final static Logger LOG = LoggerFactory.getLogger(FixedDepositTest.class);
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;
@@ -100,9 +101,12 @@ public class FixedDepositTest {
public static final Integer BIANNULLY_INTERVAL = 6;
public static final Integer ANNUL_INTERVAL = 12;
- // TODO Given the difference in calculation methods in test vs application, the exact values
- // returned may differ enough to cause differences in rounding. Given this, we only compare the full
- // digits. A proper solution would be to implement the exact interest calculation in this test,
+ // TODO Given the difference in calculation methods in test vs application,
+ // the exact values
+ // returned may differ enough to cause differences in rounding. Given this,
+ // we only compare the full
+ // digits. A proper solution would be to implement the exact interest
+ // calculation in this test,
// and then to compare the exact results
@BeforeEach
@@ -173,8 +177,8 @@ public class FixedDepositTest {
/***
* Apply for FD account with created product and verify status
*/
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -229,8 +233,7 @@ public class FixedDepositTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -240,21 +243,19 @@ public class FixedDepositTest {
this.responseSpec, fixedDepositAccountId.toString());
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
-
/***
* Verify journal entry transactions for preclosure transaction
*/
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
fixedDepositAccountId);
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
- JournalEntry.TransactionType.CREDIT));
- this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
- JournalEntry.TransactionType.DEBIT));
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE,
+ new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE,
+ new JournalEntry(maturityAmount, JournalEntry.TransactionType.DEBIT));
}
-
@Test
public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal_WITH_HOLD_TAX() {
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
@@ -367,8 +368,7 @@ public class FixedDepositTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -389,16 +389,15 @@ public class FixedDepositTest {
Assertions.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
- this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
- JournalEntry.TransactionType.CREDIT));
- this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount,
- JournalEntry.TransactionType.DEBIT));
- this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
- JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE,
+ new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE,
+ new JournalEntry(maturityAmount, JournalEntry.TransactionType.DEBIT));
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE,
+ new JournalEntry(withHoldTax, JournalEntry.TransactionType.CREDIT));
}
-
@Test
public void testFixedDepositAccountClosureTypeWithdrawal_WITH_HOLD_TAX() throws InterruptedException {
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
@@ -508,7 +507,7 @@ public class FixedDepositTest {
* FD account verify whether account is matured
*/
- SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec);
+ SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec);
String JobName = "Update Deposit Accounts Maturity details";
schedulerJobHelper.executeAndAwaitJob(JobName);
@@ -518,9 +517,8 @@ public class FixedDepositTest {
HashMap summary = (HashMap) accountDetails.get("summary");
Assertions.assertNotNull(summary.get("totalWithholdTax"));
Float withHoldTax = (Float) summary.get("totalWithholdTax");
- this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE, new JournalEntry(withHoldTax,
- JournalEntry.TransactionType.CREDIT));
-
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccountForTax, CLOSED_ON_DATE,
+ new JournalEntry(withHoldTax, JournalEntry.TransactionType.CREDIT));
fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -528,13 +526,12 @@ public class FixedDepositTest {
}
-
@Test
public void testFixedDepositAccountWithPeriodInterestRateChart() {
final String chartToUse = "period";
final String depositAmount = "10000";
final String depositPeriod = "12";
- final Float interestRate = (float)6.0;
+ final Float interestRate = (float) 6.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -543,7 +540,7 @@ public class FixedDepositTest {
final String chartToUse = "period";
final String depositAmount = "2000";
final String depositPeriod = "12";
- final Float interestRate = (float)6.0;
+ final Float interestRate = (float) 6.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -552,7 +549,7 @@ public class FixedDepositTest {
final String chartToUse = "period";
final String depositAmount = "10000";
final String depositPeriod = "18";
- final Float interestRate = (float)7.0;
+ final Float interestRate = (float) 7.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -561,7 +558,7 @@ public class FixedDepositTest {
final String chartToUse = "amount";
final String depositAmount = "10000";
final String depositPeriod = "12";
- final Float interestRate = (float)7.0;
+ final Float interestRate = (float) 7.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -570,7 +567,7 @@ public class FixedDepositTest {
final String chartToUse = "amount";
final String depositAmount = "5000";
final String depositPeriod = "12";
- final Float interestRate = (float)5.0;
+ final Float interestRate = (float) 5.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -579,7 +576,7 @@ public class FixedDepositTest {
final String chartToUse = "amount";
final String depositAmount = "10000";
final String depositPeriod = "26";
- final Float interestRate = (float)7.0;
+ final Float interestRate = (float) 7.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -588,7 +585,7 @@ public class FixedDepositTest {
final String chartToUse = "period_amount";
final String depositAmount = "10000";
final String depositPeriod = "12";
- final Float interestRate = (float)7.0;
+ final Float interestRate = (float) 7.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -597,7 +594,7 @@ public class FixedDepositTest {
final String chartToUse = "period_amount";
final String depositAmount = "5000";
final String depositPeriod = "12";
- final Float interestRate = (float)6.0;
+ final Float interestRate = (float) 6.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -606,7 +603,7 @@ public class FixedDepositTest {
final String chartToUse = "period_amount";
final String depositAmount = "10000";
final String depositPeriod = "20";
- final Float interestRate = (float)9.0;
+ final Float interestRate = (float) 9.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -615,7 +612,7 @@ public class FixedDepositTest {
final String chartToUse = "amount_period";
final String depositAmount = "10000";
final String depositPeriod = "12";
- final Float interestRate = (float)8.0;
+ final Float interestRate = (float) 8.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -624,7 +621,7 @@ public class FixedDepositTest {
final String chartToUse = "amount_period";
final String depositAmount = "5000";
final String depositPeriod = "12";
- final Float interestRate = (float)6.0;
+ final Float interestRate = (float) 6.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -633,7 +630,7 @@ public class FixedDepositTest {
final String chartToUse = "amount_period";
final String depositAmount = "10000";
final String depositPeriod = "6";
- final Float interestRate = (float)7.0;
+ final Float interestRate = (float) 7.0;
testFixedDepositAccountForInterestRate(chartToUse, depositAmount, depositPeriod, interestRate);
}
@@ -663,8 +660,8 @@ public class FixedDepositTest {
/***
* Apply for FD account with created product and verify status
*/
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM, depositAmount, depositPeriod);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM, depositAmount, depositPeriod);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -761,8 +758,8 @@ public class FixedDepositTest {
incomeAccount, expenseAccount);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -819,8 +816,7 @@ public class FixedDepositTest {
*/
Account financialAccount = getMappedLiabilityFinancialAccount();
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
/***
* Preclose the account and verify journal entries
@@ -842,11 +838,13 @@ public class FixedDepositTest {
* transaction is an account transfer you should get financial account
* mapping details and verify amounts
*/
- this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(prematurityAmount,
- JournalEntry.TransactionType.CREDIT), new JournalEntry(prematurityAmount, JournalEntry.TransactionType.DEBIT));
+ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE,
+ new JournalEntry(prematurityAmount, JournalEntry.TransactionType.CREDIT),
+ new JournalEntry(prematurityAmount, JournalEntry.TransactionType.DEBIT));
- this.journalEntryHelper.checkJournalEntryForAssetAccount(financialAccount, CLOSED_ON_DATE, new JournalEntry(prematurityAmount,
- JournalEntry.TransactionType.DEBIT), new JournalEntry(prematurityAmount, JournalEntry.TransactionType.CREDIT));
+ this.journalEntryHelper.checkJournalEntryForAssetAccount(financialAccount, CLOSED_ON_DATE,
+ new JournalEntry(prematurityAmount, JournalEntry.TransactionType.DEBIT),
+ new JournalEntry(prematurityAmount, JournalEntry.TransactionType.CREDIT));
HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance");
@@ -913,8 +911,8 @@ public class FixedDepositTest {
incomeAccount, expenseAccount);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -957,8 +955,7 @@ public class FixedDepositTest {
this.journalEntryHelper.checkJournalEntryForAssetAccount(expenseAccount, INTEREST_POSTED_DATE, expenseAccountEntry);
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, INTEREST_POSTED_DATE, liablilityAccountEntry);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
ArrayList<HashMap> errorResponse = (ArrayList<HashMap>) fixedDepositAccountHelperValidationError.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_REINVEST, null, CommonConstants.RESPONSE_ERROR);
@@ -994,13 +991,12 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- this.fixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec,
- this.responseSpec);
- this.fixedDepositProductHelper.retrieveFixedDepositProductById(this.requestSpec,
- this.responseSpec, fixedDepositProductId.toString());
+ this.fixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec, this.responseSpec);
+ this.fixedDepositProductHelper.retrieveFixedDepositProductById(this.requestSpec, this.responseSpec,
+ fixedDepositProductId.toString());
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
todaysDate.add(Calendar.DATE, -1);
@@ -1038,8 +1034,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1081,8 +1077,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1122,8 +1118,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1161,8 +1157,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1204,8 +1200,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1222,12 +1218,12 @@ public class FixedDepositTest {
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
Integer daysInYear = (Integer) daysInYearMap.get("id");
- ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
- this.requestSpec, this.responseSpec, fixedDepositProductId);
+ ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
+ .getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
- LOG.info("per day = {}" , perDay);
+ LOG.info("per day = {}", perDay);
double interestPerDay = interestRateInFraction * perDay;
todaysDate.getActualMaximum(Calendar.DATE);
@@ -1237,7 +1233,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount);
- LOG.info("{}",principal.toString());
+ LOG.info("{}", principal.toString());
Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account");
}
@@ -1272,13 +1268,13 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
- this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
- fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
- WHOLE_TERM, INTEREST_CALCULATION_USING_DAILY_BALANCE, MONTHLY, MONTHLY);
+ this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), fixedDepositProductId.toString(),
+ fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, WHOLE_TERM,
+ INTEREST_CALCULATION_USING_DAILY_BALANCE, MONTHLY, MONTHLY);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1294,12 +1290,12 @@ public class FixedDepositTest {
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
Integer daysInYear = (Integer) daysInYearMap.get("id");
- ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
- this.requestSpec, this.responseSpec, fixedDepositProductId);
+ ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
+ .getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
- LOG.info("per day = {}" , perDay);
+ LOG.info("per day = {}", perDay);
double interestPerDay = interestRateInFraction * perDay;
todaysDate.getActualMaximum(Calendar.DATE);
@@ -1309,7 +1305,7 @@ public class FixedDepositTest {
principal = (float) Math.floor(principal);
maturityAmount = (float) Math.floor(maturityAmount);
- LOG.info("{}",principal.toString());
+ LOG.info("{}", principal.toString());
Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account");
}
@@ -1348,8 +1344,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1369,14 +1365,14 @@ public class FixedDepositTest {
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
Integer daysInYear = (Integer) daysInYearMap.get("id");
- ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
- this.requestSpec, this.responseSpec, fixedDepositProductId);
+ ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
+ .getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
- LOG.info("per day = {}" , perDay);
+ LOG.info("per day = {}", perDay);
double interestPerDay = interestRateInFraction * perDay;
todaysDate.add(Calendar.MONTH, -1);
@@ -1387,15 +1383,14 @@ public class FixedDepositTest {
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
- LOG.info("{}",monthDayFormat.format(todaysDate.getTime()));
+ LOG.info("{}", monthDayFormat.format(todaysDate.getTime()));
interestPerMonth = (float) (interestPerDay * principal * currentDate);
- LOG.info("IPM = {}" , interestPerMonth);
+ LOG.info("IPM = {}", interestPerMonth);
principal += interestPerMonth;
- LOG.info("principal = {}" , principal);
+ LOG.info("principal = {}", principal);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1450,13 +1445,13 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
- this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
- fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
- WHOLE_TERM, INTEREST_CALCULATION_USING_DAILY_BALANCE, MONTHLY, MONTHLY);
+ this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), fixedDepositProductId.toString(),
+ fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, WHOLE_TERM,
+ INTEREST_CALCULATION_USING_DAILY_BALANCE, MONTHLY, MONTHLY);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1475,8 +1470,8 @@ public class FixedDepositTest {
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
Integer daysInYear = (Integer) daysInYearMap.get("id");
- ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
- this.requestSpec, this.responseSpec, fixedDepositProductId);
+ ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
+ .getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
interestRate -= preClosurePenalInterestRate;
@@ -1493,15 +1488,14 @@ public class FixedDepositTest {
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
- LOG.info("{}",monthDayFormat.format(todaysDate.getTime()));
+ LOG.info("{}", monthDayFormat.format(todaysDate.getTime()));
interestPerMonth = (float) (interestPerDay * principal * currentDate);
- LOG.info("IPM = {}" , interestPerMonth);
+ LOG.info("IPM = {}", interestPerMonth);
principal += interestPerMonth;
- LOG.info("principal = {}" , principal);
+ LOG.info("principal = {}", principal);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1556,8 +1550,8 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- TILL_PREMATURE_WITHDRAWAL);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, TILL_PREMATURE_WITHDRAWAL);
Assertions.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -1576,8 +1570,8 @@ public class FixedDepositTest {
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
Integer daysInYear = (Integer) daysInYearMap.get("id");
- ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
- this.requestSpec, this.responseSpec, fixedDepositProductId);
+ ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
+ .getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
Calendar activationDate = Calendar.getInstance();
activationDate.add(Calendar.MONTH, -1);
@@ -1593,7 +1587,7 @@ public class FixedDepositTest {
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
- LOG.info("per day = {}" , perDay);
+ LOG.info("per day = {}", perDay);
double interestPerDay = interestRateInFraction * perDay;
todaysDate.add(Calendar.MONTH, -1);
@@ -1604,15 +1598,14 @@ public class FixedDepositTest {
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
- LOG.info("{}",monthDayFormat.format(todaysDate.getTime()));
+ LOG.info("{}", monthDayFormat.format(todaysDate.getTime()));
interestPerMonth = (float) (interestPerDay * principal * currentDate);
- LOG.info("IPM = {}" , interestPerMonth);
+ LOG.info("IPM = {}", interestPerMonth);
principal += interestPerMonth;
- LOG.info("principal = {}" , principal);
+ LOG.info("principal = {}", principal);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1667,13 +1660,13 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- TILL_PREMATURE_WITHDRAWAL);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, TILL_PREMATURE_WITHDRAWAL);
Assertions.assertNotNull(fixedDepositAccountId);
- this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
- fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360,
- TILL_PREMATURE_WITHDRAWAL, INTEREST_CALCULATION_USING_DAILY_BALANCE, MONTHLY, MONTHLY);
+ this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), fixedDepositProductId.toString(),
+ fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_360, TILL_PREMATURE_WITHDRAWAL,
+ INTEREST_CALCULATION_USING_DAILY_BALANCE, MONTHLY, MONTHLY);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1691,8 +1684,8 @@ public class FixedDepositTest {
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
Integer daysInYear = (Integer) daysInYearMap.get("id");
- ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
- this.requestSpec, this.responseSpec, fixedDepositProductId);
+ ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
+ .getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
Calendar activationDate = Calendar.getInstance();
activationDate.add(Calendar.MONTH, -1);
@@ -1708,7 +1701,7 @@ public class FixedDepositTest {
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
- LOG.info("per day = {}" , perDay);
+ LOG.info("per day = {}", perDay);
double interestPerDay = interestRateInFraction * perDay;
todaysDate.add(Calendar.MONTH, -1);
@@ -1719,15 +1712,14 @@ public class FixedDepositTest {
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
- LOG.info("{}",monthDayFormat.format(todaysDate.getTime()));
+ LOG.info("{}", monthDayFormat.format(todaysDate.getTime()));
interestPerMonth = (float) (interestPerDay * principal * currentDate);
- LOG.info("IPM = {}" , interestPerMonth);
+ LOG.info("IPM = {}", interestPerMonth);
principal += interestPerMonth;
- LOG.info("principal = {}" , principal);
+ LOG.info("principal = {}", principal);
- this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
- CLOSED_ON_DATE);
+ this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId, CLOSED_ON_DATE);
Integer prematureClosureTransactionId = (Integer) this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(
fixedDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_WITHDRAW_DEPOSIT, null, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1778,13 +1770,13 @@ public class FixedDepositTest {
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
Assertions.assertNotNull(fixedDepositProductId);
- Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), SUBMITTED_ON_DATE,
- WHOLE_TERM);
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
+ SUBMITTED_ON_DATE, WHOLE_TERM);
Assertions.assertNotNull(fixedDepositAccountId);
- this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(),
- fixedDepositProductId.toString(), fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365,
- WHOLE_TERM, INTEREST_CALCULATION_USING_DAILY_BALANCE, DAILY, MONTHLY);
+ this.fixedDepositAccountHelper.updateInterestCalculationConfigForFixedDeposit(clientId.toString(), fixedDepositProductId.toString(),
+ fixedDepositAccountId.toString(), SUBMITTED_ON_DATE, VALID_FROM, VALID_TO, DAYS_365, WHOLE_TERM,
+ INTEREST_CALCULATION_USING_DAILY_BALANCE, DAILY, MONTHLY);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
this.responseSpec, fixedDepositAccountId.toString());
@@ -1800,13 +1792,13 @@ public class FixedDepositTest {
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
... 177242 lines suppressed ...