From f05239c35b6bc1dc8fdd7b8da2e357717eb349a5 Mon Sep 17 00:00:00 2001 From: percyashu Date: Mon, 22 Jun 2020 11:42:43 +0100 Subject: [PATCH 001/131] FINERACT-822 Enforce UnusedNestedClass check --- fineract-provider/build.gradle | 2 +- .../FineractEntityAccessReadServiceImpl.java | 42 ------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index ef2c5da15..5ce3f356b 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -387,7 +387,6 @@ tasks.withType(JavaCompile) { "UnusedMethod", "ModifiedButNotUsed", "TypeParameterUnusedInFormals", - "UnusedNestedClass", "UndefinedEquals", "JdkObsolete", "EmptyBlockTag", @@ -461,6 +460,7 @@ tasks.withType(JavaCompile) { "EqualsUnsafeCast", "DoubleBraceInitialization", "UnnecessaryDefaultInEnumSwitch", + "UnusedNestedClass", "InconsistentCapitalization", "MissingOverride", // "InvalidBlockTag", diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java index fdddb0406..15e62924c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java @@ -23,10 +23,8 @@ import java.sql.SQLException; import java.util.Collection; import java.util.Date; import org.apache.fineract.infrastructure.core.service.RoutingDataSource; -import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityAccessData; import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityRelationData; import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityToEntityMappingData; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntity; import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType; import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation; import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepositoryWrapper; @@ -147,46 +145,6 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess return str.toString(); } - private static final class FineractEntityAccessDataMapper implements RowMapper { - - @Override - public FineractEntityAccessData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException { - final String entityType = rs.getString("entity_type"); - final Long entityId = rs.getLong("entity_id"); - // final String entityName = rs.getString("entity_name"); - // final Long accessId = rs.getLong("access_id"); - final String accessTypeDesc = rs.getString("access_type_desc"); - // final String code = rs.getString("code"); - final Long secondEntityId = rs.getLong("second_entity_id"); - // final String secondEntityName = - // rs.getString("second_entity_name"); - final String secondEntityType = rs.getString("second_entity_type"); - - FineractEntity firstEntity = null; - FineractEntityType etype = FineractEntityType.get(entityType); - if (etype != null) { - firstEntity = new FineractEntity(entityId, etype); - } - - FineractEntity secondEntity = null; - FineractEntityType secondetype = FineractEntityType.get(secondEntityType); - if (etype != null) { - secondEntity = new FineractEntity(secondEntityId, secondetype); - } - - FineractEntityAccessType accessType = null; - if (accessTypeDesc != null) { - accessType = FineractEntityAccessType.get(accessTypeDesc); - } - - FineractEntityAccessData returnFineractEntityAccessData = null; - if (firstEntity != null && secondEntity != null && accessType != null) { - returnFineractEntityAccessData = new FineractEntityAccessData(firstEntity, accessType, secondEntity); - } - return returnFineractEntityAccessData; - } - } - @Override public String getSQLQueryInClauseIDList_ForLoanProductsForOffice(Long officeId, boolean includeAllOffices) { From a7fdafd4071b3f9df9f687cf82ed6976939133c9 Mon Sep 17 00:00:00 2001 From: percyashu Date: Mon, 22 Jun 2020 11:56:32 +0100 Subject: [PATCH 002/131] FINERACT-822 Enforce UnusedMethod check --- fineract-provider/build.gradle | 2 +- .../common/accounting/JournalEntryHelper.java | 9 --------- .../adhocquery/api/AdHocApiResource.java | 5 ----- ...atatableChecksWritePlatformServiceImpl.java | 18 ------------------ .../domain/InteropIdentifier.java | 16 ---------------- .../address/domain/FieldConfiguration.java | 9 --------- .../portfolio/loanaccount/domain/Loan.java | 15 --------------- .../domain/DefaultScheduledDateGenerator.java | 15 --------------- 8 files changed, 1 insertion(+), 88 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 5ce3f356b..98aad47dc 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -384,7 +384,6 @@ tasks.withType(JavaCompile) { disable( "UnusedVariable", "SameNameButDifferent", - "UnusedMethod", "ModifiedButNotUsed", "TypeParameterUnusedInFormals", "UndefinedEquals", @@ -461,6 +460,7 @@ tasks.withType(JavaCompile) { "DoubleBraceInitialization", "UnnecessaryDefaultInEnumSwitch", "UnusedNestedClass", + "UnusedMethod", "InconsistentCapitalization", "MissingOverride", // "InvalidBlockTag", diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/accounting/JournalEntryHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/accounting/JournalEntryHelper.java index a6c53271a..a02a7af95 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/accounting/JournalEntryHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/accounting/JournalEntryHelper.java @@ -66,15 +66,6 @@ public class JournalEntryHelper { } - private String getEntryValueFromJournalEntry(final ArrayList entryResponse, final int entryNumber) { - final HashMap map = (HashMap) entryResponse.get(entryNumber).get("entryType"); - return (String) map.get("value"); - } - - private Float getTransactionAmountFromJournalEntry(final ArrayList entryResponse, final int entryNumber) { - return (Float) entryResponse.get(entryNumber).get("amount"); - } - private void checkJournalEntry(final Integer officeId, final Account account, final String date, final JournalEntry... accountEntries) { final String url = createURLForGettingAccountEntries(account, date, officeId); final ArrayList response = Utils.performServerGet(this.requestSpec, this.responseSpec, url, "pageItems"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java index a642d9e71..4bf684207 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java @@ -37,7 +37,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; -import org.apache.commons.lang3.StringUtils; import org.apache.fineract.adhocquery.data.AdHocData; import org.apache.fineract.adhocquery.service.AdHocReadPlatformService; import org.apache.fineract.commands.domain.CommandWrapper; @@ -173,8 +172,4 @@ public class AdHocApiResource { return this.toApiJsonSerializer.serialize(result); } - private boolean is(final String commandParam, final String commandValue) { - return StringUtils.isNotBlank(commandParam) && commandParam.trim().equalsIgnoreCase(commandValue); - } - } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java index 580ede22f..e28e5b5b4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java @@ -248,24 +248,6 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData return isMakerCheckerEnabled; } - private List getDatatableNames(Long status, String entity, Long productId) { - List ret = new ArrayList<>(); - List tableRequiredBeforeAction = null; - if (productId != null) { - tableRequiredBeforeAction = this.entityDatatableChecksRepository.findByEntityStatusAndProduct(entity, status, productId); - } - - if (tableRequiredBeforeAction == null || tableRequiredBeforeAction.size() < 1) { - tableRequiredBeforeAction = this.entityDatatableChecksRepository.findByEntityStatusAndNoProduct(entity, status); - } - if (tableRequiredBeforeAction != null && tableRequiredBeforeAction.size() > 0) { - for (EntityDatatableChecks t : tableRequiredBeforeAction) { - ret.add(t.getDatatableName()); - } - } - return ret; - } - @Transactional @Override public CommandProcessingResult deleteCheck(final Long entityDatatableCheckId) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java index eb9ab9cde..7f6d4c1b4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java @@ -88,18 +88,10 @@ public class InteropIdentifier extends AbstractPersistableCustom { return account; } - private void setAccount(SavingsAccount account) { - this.account = account; - } - public InteropIdentifierType getType() { return type; } - private void setType(InteropIdentifierType type) { - this.type = type; - } - public String getValue() { return value; } @@ -120,18 +112,10 @@ public class InteropIdentifier extends AbstractPersistableCustom { return createdBy; } - private void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - public Date getCreatedOn() { return createdOn; } - private void setCreatedOn(Date createdOn) { - this.createdOn = createdOn; - } - public String geModifiedBy() { return modifiedBy; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java index 0e2176848..8cc4370a9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java @@ -20,7 +20,6 @@ package org.apache.fineract.portfolio.address.domain; import javax.persistence.Entity; import javax.persistence.Table; -import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom; @Entity @@ -47,12 +46,4 @@ public class FieldConfiguration extends AbstractPersistableCustom { } - private static FieldConfiguration fromJson(final JsonCommand command) { - final String entity = command.stringValueOfParameterNamed("entity"); - final String table = command.stringValueOfParameterNamed("table"); - final String field = command.stringValueOfParameterNamed("field"); - final boolean is_enabled = command.booleanPrimitiveValueOfParameterNamed("implementationKey"); - - return new FieldConfiguration(entity, table, field, is_enabled); - } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index dd40ec085..e6ad2a67e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -924,21 +924,6 @@ public class Loan extends AbstractPersistableCustom { return amount; } - private boolean isFirstTrancheDisbursement() { - if (isMultiDisburmentLoan()) { - int totalTranchDisbursementCount = 0; - for (final LoanDisbursementDetails loanDisbursementDetail : this.disbursementDetails) { - if (loanDisbursementDetail.actualDisbursementDate() != null) { - totalTranchDisbursementCount++; - } - } - if (totalTranchDisbursementCount < 2) { - return true; - } - } - return false; - } - /** * @return */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java index 6391bee50..01a70da38 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java @@ -233,21 +233,6 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { return dueRepaymentPeriodDate; } - private LocalDate adjustToNthWeekDay(LocalDate dueRepaymentPeriodDate, int nthDay, int dayOfWeek) { - // adjust date to start of month - dueRepaymentPeriodDate = dueRepaymentPeriodDate.withDayOfMonth(1); - // adjust date to next week if current day is past specified day of - // week. - if (dueRepaymentPeriodDate.getDayOfWeek() > dayOfWeek) { - dueRepaymentPeriodDate = dueRepaymentPeriodDate.plusWeeks(1); - } - // adjust date to specified date of week - dueRepaymentPeriodDate = dueRepaymentPeriodDate.withDayOfWeek(dayOfWeek); - // adjust to specified nth week day - dueRepaymentPeriodDate = dueRepaymentPeriodDate.plusWeeks(nthDay - 1); - return dueRepaymentPeriodDate; - } - @Override public Boolean isDateFallsInSchedule(final PeriodFrequencyType frequency, final int repaidEvery, final LocalDate startDate, final LocalDate date) { From 9542e357024335563f268b9600770bb8a3ffb331 Mon Sep 17 00:00:00 2001 From: percyashu Date: Mon, 22 Jun 2020 17:10:25 +0100 Subject: [PATCH 003/131] FINERACT-822 Enforce ModifiedButNotUsed check --- fineract-provider/build.gradle | 2 +- .../common/ProvisioningIntegrationTest.java | 2 -- .../common/shares/DividendsIntegrationTests.java | 4 ---- .../LoanScheduleCalculationPlatformServiceImpl.java | 11 ----------- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 98aad47dc..04510a5f0 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -384,7 +384,6 @@ tasks.withType(JavaCompile) { disable( "UnusedVariable", "SameNameButDifferent", - "ModifiedButNotUsed", "TypeParameterUnusedInFormals", "UndefinedEquals", "JdkObsolete", @@ -461,6 +460,7 @@ tasks.withType(JavaCompile) { "UnnecessaryDefaultInEnumSwitch", "UnusedNestedClass", "UnusedMethod", + "ModifiedButNotUsed", "InconsistentCapitalization", "MissingOverride", // "InvalidBlockTag", diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java index 8e568db0f..db2610823 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ProvisioningIntegrationTest.java @@ -74,7 +74,6 @@ public class ProvisioningIntegrationTest { public void testCreateProvisioningCriteria() { ProvisioningTransactionHelper transactionHelper = new ProvisioningTransactionHelper(requestSpec, responseSpec); ArrayList loanProducts = new ArrayList<>(LOANPRODUCTS_SIZE); - List loans = new ArrayList<>(); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec); ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID); for (int i = 0; i < LOANPRODUCTS_SIZE; i++) { @@ -90,7 +89,6 @@ public class ProvisioningIntegrationTest { LOG.info("-------------------------------DISBURSE LOAN-------------------------------------------"); loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - loans.add(loanID); Assertions.assertNotNull(loanID); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/DividendsIntegrationTests.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/DividendsIntegrationTests.java index 95b21a1b8..a4ecbc517 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/DividendsIntegrationTests.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/DividendsIntegrationTests.java @@ -60,15 +60,11 @@ public class DividendsIntegrationTests { public void testCreateDividends() { DateFormat simple = new SimpleDateFormat("dd MMM yyyy"); final Integer productId = createShareProduct(); - ArrayList clients = new ArrayList<>(); - ArrayList savingAccounts = new ArrayList<>(); ArrayList shareAccounts = new ArrayList<>(); for (int i = 0; i < 5; i++) { final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); - clients.add(clientId); Assertions.assertNotNull(clientId); Integer savingsAccountId = SavingsAccountHelper.openSavingsAccount(requestSpec, responseSpec, clientId, "1000"); - savingAccounts.add(savingsAccountId); Assertions.assertNotNull(savingsAccountId); final Integer shareAccountId = createShareAccount(clientId, productId, savingsAccountId, dates[i], shares[i]); shareAccounts.add(shareAccountId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java index 003b8c72a..ffdc200d6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java @@ -40,7 +40,6 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; import org.apache.fineract.portfolio.loanaccount.domain.LoanDisbursementDetails; import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleTransactionProcessorFactory; -import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.LoanRepaymentScheduleTransactionProcessor; import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanScheduleData; import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanSchedulePeriodData; @@ -183,16 +182,6 @@ public class LoanScheduleCalculationPlatformServiceImpl implements LoanScheduleC totalAmount = totalAmount.plus(interestDue); } boolean isNewPaymentRequired = loanRepaymentScheduleInstallment.isInterestDue(currency) || totalPrincipal.isGreaterThanZero(); - final List modifiedTransactions = new ArrayList<>(); - List transactions = loan.retreiveListOfTransactionsPostDisbursementExcludeAccruals(); - for (LoanTransaction loanTransaction : transactions) { - modifiedTransactions.add(LoanTransaction.copyTransactionProperties(loanTransaction)); - } - if (isNewPaymentRequired) { - LoanTransaction ondayPaymentTransaction = LoanTransaction.repayment(null, totalAmount, null, today, null, - DateUtils.getLocalDateTimeOfTenant(), null); - modifiedTransactions.add(ondayPaymentTransaction); - } LoanScheduleModel model = this.loanScheduleAssembler.assembleForInterestRecalculation(loanApplicationTerms, loan.getOfficeId(), loan, loanRepaymentScheduleTransactionProcessor, loan.fetchInterestRecalculateFromDate()); From c529fdf58c335adb4dd938b0551f7e355e9eb56d Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sat, 20 Jun 2020 23:26:52 +0200 Subject: [PATCH 004/131] increase auto formatting comment line length from 80 to 120 --- config/fineractdev-formatter.xml | 2 +- .../AccountNumberPreferencesTest.java | 9 +- .../integrationtests/BatchApiTest.java | 73 ++++----- .../BatchRequestsIntegrationTest.java | 20 +-- .../ClientLoanIntegrationTest.java | 97 +++++------- .../ClientSavingsIntegrationTest.java | 143 +++++++----------- .../DisbursalAndRepaymentScheduleTest.java | 3 +- .../FinancialActivityAccountsTest.java | 9 +- .../integrationtests/FixedDepositTest.java | 42 +++-- ...SavingsInterestPostingIntegrationTest.java | 3 +- .../GlobalConfigurationTest.java | 9 +- .../fineract/integrationtests/GroupTest.java | 3 +- .../integrationtests/HookIntegrationTest.java | 4 +- .../LoanApplicationApprovalTest.java | 9 +- ...oanDisbursementDetailsIntegrationTest.java | 132 ++++++---------- ...iveInterestAndWriteOffIntegrationTest.java | 3 +- ...BetweenDisbursalAndFirstRepaymentTest.java | 10 +- .../RecurringDepositTest.java | 104 ++++++------- .../SurveyIntegrationTest.java | 3 +- .../integrationtests/common/BatchHelper.java | 76 ++++------ .../common/ClientChargesTest.java | 33 ++-- .../common/GlobalConfigurationHelper.java | 15 +- .../common/SchedulerJobHelper.java | 4 +- .../integrationtests/common/Utils.java | 4 +- .../loans/LoanApplicationTestBuilder.java | 12 +- .../loans/LoanDisbursementTestBuilder.java | 31 ++-- .../EntityDatatableChecksIntegrationTest.java | 3 +- .../apache/fineract/ServerApplication.java | 13 +- .../AccrualAccountingDataValidator.java | 3 +- .../api/GLClosuresApiResourceSwagger.java | 3 +- .../closure/data/GLClosureData.java | 3 +- .../GLClosureDuplicateException.java | 3 +- .../exception/GLClosureNotFoundException.java | 3 +- ...ClosureCommandFromApiJsonDeserializer.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../common/AccountingConstants.java | 9 +- ...ncialActivityAccountRepositoryWrapper.java | 3 +- ...inancialActivityAccountFoundException.java | 3 +- ...ancialActivityAccountInvalidException.java | 3 +- ...ncialActivityAccountNotFoundException.java | 3 +- ...tivityAccountWritePlatformServiceImpl.java | 3 +- .../glaccount/data/GLAccountData.java | 3 +- .../exception/GLAccountDisableException.java | 3 +- .../GLAccountDuplicateException.java | 3 +- ...AccountInvalidClassificationException.java | 3 +- .../GLAccountInvalidDeleteException.java | 3 +- .../GLAccountInvalidParentException.java | 3 +- .../GLAccountInvalidUpdateException.java | 3 +- .../GLAccountInvalidUsageException.java | 3 +- ...AccountCommandFromApiJsonDeserializer.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../journalentry/data/JournalEntryData.java | 3 +- .../domain/JournalEntryRepository.java | 10 +- ...alEntryCommandFromApiJsonDeserializer.java | 3 +- .../AccountingProcessorForSavingsFactory.java | 5 +- .../service/AccountingProcessorHelper.java | 83 ++++------ ...ccrualBasedAccountingProcessorForLoan.java | 46 ++---- ...ountingProcessorForClientTransactions.java | 12 +- .../CashBasedAccountingProcessorForLoan.java | 39 ++--- ...ashBasedAccountingProcessorForSavings.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 11 +- ...uctToGLAccountMappingInvalidException.java | 3 +- ...ctToGLAccountMappingNotFoundException.java | 3 +- ...AccountMappingFromApiJsonDeserializer.java | 26 ++-- .../LoanProductToGLAccountMappingHelper.java | 3 +- .../ProductToGLAccountMappingHelper.java | 43 +++--- ...ccountMappingWritePlatformServiceImpl.java | 21 ++- ...avingsProductToGLAccountMappingHelper.java | 3 +- .../ShareProductToGLAccountMappingHelper.java | 3 +- .../rule/data/AccountingRuleData.java | 3 +- .../AccountingRuleDuplicateException.java | 3 +- .../AccountingRuleNotFoundException.java | 3 +- .../adhocquery/api/AdHocApiResource.java | 3 +- .../service/AdHocDataValidator.java | 9 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../fineract/batch/api/BatchApiResource.java | 16 +- .../batch/command/CommandContext.java | 11 +- .../batch/command/CommandStrategy.java | 10 +- .../command/CommandStrategyProvider.java | 20 +-- .../ActivateClientCommandStrategy.java | 12 +- .../internal/ApplyLoanCommandStrategy.java | 12 +- .../internal/ApplySavingsCommandStrategy.java | 12 +- .../internal/ApproveLoanCommandStrategy.java | 12 +- .../CollectChargesCommandStrategy.java | 12 +- .../internal/CreateChargeCommandStrategy.java | 12 +- .../internal/CreateClientCommandStrategy.java | 12 +- .../internal/DisburseLoanCommandStrategy.java | 12 +- .../internal/RepayLoanCommandStrategy.java | 8 +- .../internal/UnknownCommandStrategy.java | 5 +- .../internal/UpdateClientCommandStrategy.java | 12 +- .../fineract/batch/domain/BatchRequest.java | 17 +-- .../fineract/batch/domain/BatchResponse.java | 13 +- .../apache/fineract/batch/domain/Header.java | 5 +- .../batch/exception/ErrorHandler.java | 11 +- .../fineract/batch/exception/ErrorInfo.java | 6 +- .../serialization/BatchRequestJsonHelper.java | 9 +- .../batch/service/BatchApiService.java | 20 +-- .../batch/service/BatchApiServiceImpl.java | 11 +- .../batch/service/ResolutionHelper.java | 18 +-- .../commands/annotation/CommandType.java | 3 +- ...ommandIsNotApprovedByCheckerException.java | 11 +- .../UnsupportedCommandException.java | 4 +- .../provider/CommandHandlerProvider.java | 12 +- ...CommandSourceWritePlatformServiceImpl.java | 6 +- .../SynchronousCommandProcessingService.java | 10 +- .../AccountNumberFormatDataValidator.java | 6 +- .../service/AccountNumberFormatConstants.java | 5 +- ...ntNumberFormatReadPlatformServiceImpl.java | 5 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../populator/PersonnelSheetPopulator.java | 10 +- .../RuntimeDelegatingCacheManager.java | 8 +- .../email/api/EmailCampaignApiResource.java | 4 +- .../EmailCampaignReadPlatformServiceImpl.java | 5 +- ...mpaignWritePlatformCommandHandlerImpl.java | 23 ++- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../service/SmsCampaignDomainServiceImpl.java | 5 +- ...msCampaignWritePlatformServiceJpaImpl.java | 17 +-- .../infrastructure/codes/CodeConstants.java | 3 +- .../domain/CodeValueRepositoryWrapper.java | 11 +- ...emDefinedCodeCannotBeChangedException.java | 3 +- .../service/CodeValueReadPlatformService.java | 6 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../domain/ConfigurationDomainServiceJpa.java | 3 +- .../GlobalConfigurationRepositoryWrapper.java | 3 +- ...onfigurationPropertyNotFoundException.java | 3 +- ...urationCommandFromApiJsonDeserializer.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../core/api/ApiRequestParameterHelper.java | 7 +- .../infrastructure/core/api/DateAdapter.java | 4 +- .../core/api/JodaDateTimeAdapter.java | 3 +- .../core/api/JodaLocalDateAdapter.java | 4 +- .../core/api/JodaMonthDayAdapter.java | 4 +- .../infrastructure/core/api/JsonCommand.java | 4 +- .../infrastructure/core/api/JsonQuery.java | 3 +- .../AbstractApplicationConfiguration.java | 9 +- .../EmbeddedTomcatWithSSLConfiguration.java | 11 +- .../core/boot/WebXmlOauthConfiguration.java | 3 +- .../core/data/ApiGlobalErrorResponse.java | 15 +- .../core/data/ApiParameterError.java | 13 +- .../core/data/CommandProcessingResult.java | 3 +- .../data/CommandProcessingResultBuilder.java | 3 +- .../core/data/DataValidatorBuilder.java | 10 +- .../core/debug/EchoHeadersResource.java | 13 +- .../core/domain/AbstractAuditableCustom.java | 8 +- .../domain/AbstractPersistableCustom.java | 10 +- .../core/domain/JdbcSupport.java | 4 +- .../AbstractPlatformDomainRuleException.java | 3 +- ...ractPlatformResourceNotFoundException.java | 3 +- ...ctPlatformServiceUnavailableException.java | 3 +- .../GeneralPlatformDomainRuleException.java | 3 +- .../core/exception/InvalidJsonException.java | 4 +- .../core/exception/MultiException.java | 10 +- .../PlatformDataIntegrityException.java | 3 +- .../UnsupportedParameterException.java | 4 +- .../AccessDeniedExceptionMapper.java | 8 +- .../BadCredentialsExceptionMapper.java | 9 +- .../InvalidJsonExceptionMapper.java | 3 +- ...nvalidTenantIdentifierExceptionMapper.java | 8 +- .../JsonSyntaxExceptionMapper.java | 3 +- .../MalformedJsonExceptionMapper.java | 3 +- .../NoAuthorizationExceptionMapper.java | 8 +- ...tformApiDataValidationExceptionMapper.java | 8 +- .../PlatformDataIntegrityExceptionMapper.java | 8 +- .../PlatformDomainRuleExceptionMapper.java | 8 +- ...PlatformInternalServerExceptionMapper.java | 7 +- ...atformResourceNotFoundExceptionMapper.java | 9 +- ...formServiceUnavailableExceptionMapper.java | 9 +- .../UnAuthenticatedUserExceptionMapper.java | 4 +- ...UnrecognizedQueryParamExceptionMapper.java | 8 +- .../UnsupportedCommandExceptionMapper.java | 4 +- .../UnsupportedParameterExceptionMapper.java | 4 +- .../core/filters/ResponseCorsFilter.java | 4 +- .../AbstractFromApiJsonDeserializer.java | 3 +- .../AbstractFromCommandJsonDeserializer.java | 3 +- .../ApiRequestJsonSerializationSettings.java | 4 +- .../CommandSerializerDefaultToJson.java | 3 +- .../DefaultToApiJsonSerializer.java | 4 +- .../core/serialization/FromJsonHelper.java | 7 +- .../core/serialization/JsonParserHelper.java | 7 +- ...onedConnectionCleanupShutdownListener.java | 13 +- .../core/service/RoutingDataSource.java | 9 +- .../service/RoutingDataSourceService.java | 3 +- .../RoutingDataSourceServiceFactory.java | 3 +- .../core/service/SearchParameters.java | 6 +- .../service/TenantDatabaseUpgradeService.java | 6 +- .../TomcatJdbcDataSourcePerTenantService.java | 8 +- .../data/ResultsetColumnValueData.java | 3 +- .../domain/ReportParameterUsage.java | 19 +-- .../domain/ReportRepositoryWrapper.java | 5 +- .../DatatableEntryRequiredException.java | 3 +- ...tatableChecksWritePlatformServiceImpl.java | 3 +- .../service/GenericDataServiceImpl.java | 3 +- .../service/ReadReportingServiceImpl.java | 83 ++++------ .../ReadWriteNonCoreDataServiceImpl.java | 25 ++- .../ReportWritePlatformServiceImpl.java | 3 +- .../api/DocumentManagementApiResource.java | 13 +- .../api/ImagesApiResource.java | 8 +- .../ContentRepositoryUtils.java | 7 +- ...ityTypeForDocumentManagementException.java | 3 +- ...FineractEntityAccessRepositoryWrapper.java | 3 +- .../domain/FineractEntityRelation.java | 6 +- .../domain/FineractEntityToEntityMapping.java | 8 +- .../NotOfficeSpecificProductException.java | 3 +- .../FineractEntityAccessReadServiceImpl.java | 15 +- .../FineractEntityAccessWriteService.java | 8 +- .../FineractEntityAccessWriteServiceImpl.java | 10 +- .../infrastructure/gcm/GcmConstants.java | 24 ++- .../infrastructure/gcm/domain/Message.java | 3 +- .../gcm/domain/MulticastResult.java | 3 +- .../gcm/domain/Notification.java | 3 +- .../infrastructure/gcm/domain/Result.java | 12 +- .../infrastructure/gcm/domain/Sender.java | 46 +++--- .../jobs/annotation/CronMethodParser.java | 3 +- .../jobs/service/JobRegisterServiceImpl.java | 12 +- .../jobs/service/SchedulerJobListener.java | 5 +- .../jobs/service/SchedulerStopListener.java | 3 +- .../openjpa/OpenJpaDialect.java | 16 +- .../openjpa/OpenJpaVendorAdapter.java | 12 +- ...rtMailingJobEmailAttachmentFileFormat.java | 7 +- ...ilingJobStretchyReportParamDateOption.java | 16 +- .../data/ReportMailingJobTimelineData.java | 3 +- .../domain/ReportMailingJob.java | 3 +- .../domain/ReportMailingJobRepository.java | 3 +- .../ReportMailingJobRepositoryWrapper.java | 3 +- ...lingJobConfigurationNotFoundException.java | 3 +- .../ReportMailingJobNotFoundException.java | 3 +- ...MailingJobRunHistoryNotFoundException.java | 3 +- .../reportmailingjob/helper/IPv4Helper.java | 6 +- .../ReportMailingJobEmailServiceImpl.java | 3 +- .../ReportMailingJobReadPlatformService.java | 6 +- ...ilingJobRunHistoryReadPlatformService.java | 3 +- ...ortMailingJobWritePlatformServiceImpl.java | 3 +- .../util/ReportMailingJobDateUtil.java | 3 +- .../validation/ReportMailingJobValidator.java | 3 +- .../security/data/PlatformRequestLog.java | 3 +- .../InvalidTenantIdentiferException.java | 3 +- .../exception/NoAuthorizationException.java | 4 +- .../exception/ResetPasswordException.java | 4 +- ...InsecureTwoFactorAuthenticationFilter.java | 6 +- .../TenantAwareBasicAuthenticationFilter.java | 13 +- .../TenantAwareTenantIdentifierFilter.java | 11 +- .../filter/TwoFactorAuthenticationFilter.java | 18 +-- .../BasicAuthTenantDetailsServiceJdbc.java | 4 +- .../CustomAuthenticationFailureHandler.java | 18 +-- .../service/JdbcTenantDetailsService.java | 4 +- .../service/PlatformSecurityContext.java | 7 +- ...SpringSecurityPlatformSecurityContext.java | 3 +- ...antAwareJpaPlatformUserDetailsService.java | 3 +- .../security/utils/SQLBuilder.java | 37 ++--- .../data/SmsMessageApiQueueResourceData.java | 3 +- .../data/SmsMessageApiReportResourceData.java | 3 +- .../data/SmsMessageDeliveryReportData.java | 3 +- .../SmsMessageScheduledJobService.java | 3 +- .../SmsMessageScheduledJobServiceImpl.java | 6 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../service/WriteLikelihoodServiceImpl.java | 3 +- .../interoperation/util/MathUtil.java | 3 +- .../domain/HolidayRepositoryWrapper.java | 3 +- .../ApplicationCurrencyRepositoryWrapper.java | 13 +- .../exception/CurrencyInUseException.java | 3 +- ...ganizationalCurrencyNotFoundException.java | 3 +- .../office/api/OfficesApiResource.java | 3 +- .../domain/OfficeRepositoryWrapper.java | 3 +- ...OrganisationCurrencyRepositoryWrapper.java | 9 +- .../exception/InvalidOfficeException.java | 3 +- .../OfficeTransactionNotFoundException.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 7 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../staff/api/StaffApiResource.java | 3 +- .../staff/domain/StaffRepositoryWrapper.java | 3 +- .../service/StaffReadPlatformService.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../organisation/teller/data/CashierData.java | 24 +-- .../organisation/teller/data/TellerData.java | 6 +- .../teller/data/TellerTransactionData.java | 6 +- .../organisation/teller/domain/Cashier.java | 37 ++--- .../teller/domain/CashierRepository.java | 3 +- .../teller/domain/CashierTransaction.java | 3 +- .../organisation/teller/domain/Teller.java | 7 +- .../teller/domain/TellerRepository.java | 3 +- .../domain/TellerTransactionRepository.java | 3 +- .../AllocateCashToCashierCommandHandler.java | 3 +- ...AllocateCashierToTellerCommandHandler.java | 3 +- .../handler/CreateTellerCommandHandler.java | 3 +- ...DeleteCashierAllocationCommandHandler.java | 3 +- .../handler/DeleteTellerCommandHandler.java | 3 +- .../handler/ModifyCashierCommandHandler.java | 3 +- .../SettleCashFromCashierCommandHandler.java | 3 +- ...UpdateCashierAllocationCommandHandler.java | 3 +- .../handler/UpdateTellerCommandHandler.java | 3 +- .../service/TellerWritePlatformService.java | 4 +- .../TellerWritePlatformServiceJpaImpl.java | 12 +- .../data/AdjustedDateDetailsDTO.java | 4 +- .../domain/WorkingDaysRepositoryWrapper.java | 3 +- .../api/AccountTransfersApiConstants.java | 5 +- .../AccountTransferStandingInstruction.java | 3 +- ...ntAssociationsReadPlatformServiceImpl.java | 13 +- ...rtfolioAccountReadPlatformServiceImpl.java | 4 +- ...ingInstructionReadPlatformServiceImpl.java | 20 +-- .../data/AccountSummaryCollectionData.java | 3 +- .../portfolio/address/domain/Address.java | 4 +- .../portfolio/calendar/domain/Calendar.java | 21 ++- .../domain/CalendarFrequencyType.java | 6 +- .../domain/CalendarInstanceRepository.java | 3 +- .../CalendarInstanceRepositoryWrapper.java | 10 +- .../domain/CalendarRepositoryWrapper.java | 9 +- .../CalendarInstanceNotFoundException.java | 3 +- .../CalendarReadPlatformServiceImpl.java | 19 +-- .../calendar/service/CalendarUtils.java | 35 ++--- ...WritePlatformServiceJpaRepositoryImpl.java | 27 ++-- .../portfolio/charge/domain/Charge.java | 11 +- .../domain/ChargeRepositoryWrapper.java | 9 +- ...tDisbursementCannotBePenaltyException.java | 4 +- .../ChargeMustBePenaltyException.java | 4 +- .../LoanChargeCannotBeAddedException.java | 3 +- .../LoanChargeNotFoundException.java | 3 +- ...nChargeWithoutMandatoryFieldException.java | 3 +- ...SavingsAccountChargeNotFoundException.java | 3 +- ...tChargeWithoutMandatoryFieldException.java | 3 +- ...tChargeWithoutMandatoryFieldException.java | 3 +- .../service/ChargeReadPlatformService.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../client/api/ClientApiConstants.java | 5 +- .../data/ClientApiCollectionConstants.java | 5 +- .../client/data/ClientDataValidator.java | 18 +-- .../client/data/ClientTimelineData.java | 3 +- .../client/domain/AccountNumberGenerator.java | 5 +- .../ClientNonPersonRepositoryWrapper.java | 3 +- .../domain/ClientRepositoryWrapper.java | 3 +- .../client/domain/ClientTransaction.java | 3 +- .../ClientIdentifierNotFoundException.java | 3 +- ...tNonPersonNotFoundByClientIdException.java | 3 +- .../ClientNonPersonNotFoundException.java | 3 +- .../DuplicateClientIdentifierException.java | 3 +- .../InvalidClientSavingProductException.java | 4 +- ...InvalidClientStateTransitionException.java | 4 +- .../UpdateClientAddressCommandHandler.java | 5 +- ...ntifierCommandFromApiJsonDeserializer.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 9 +- ...FamilyMembersWritePlatformServiceImpl.java | 6 +- ...WritePlatformServiceJpaRepositoryImpl.java | 17 +-- .../collateral/domain/LoanCollateral.java | 17 +-- ...lateralCommandFromApiJsonDeserializer.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 9 +- .../data/IndividualClientData.java | 3 +- ...IndividualCollectionSheetLoanFlatData.java | 3 +- .../collectionsheet/data/JLGClientData.java | 10 +- .../data/JLGCollectionSheetFlatData.java | 3 +- .../collectionsheet/data/JLGGroupData.java | 3 +- .../collectionsheet/data/LoanDueData.java | 3 +- .../collectionsheet/data/SavingsDueData.java | 3 +- ...sbursalCommandFromApiJsonDeserializer.java | 3 +- ...paymentCommandFromApiJsonDeserializer.java | 3 +- ...ollectionSheetReadPlatformServiceImpl.java | 5 +- .../common/domain/DaysInMonthType.java | 3 +- .../common/domain/DaysInYearType.java | 3 +- .../common/service/BusinessEventListner.java | 5 +- .../service/BusinessEventNotifierService.java | 15 +- .../BusinessEventNotifierServiceImpl.java | 30 ++-- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../group/api/GroupingTypesApiConstants.java | 5 +- .../group/data/GroupGeneralData.java | 3 +- .../group/data/GroupTimelineData.java | 3 +- .../portfolio/group/domain/Group.java | 3 +- .../group/domain/GroupRepositoryWrapper.java | 3 +- .../exception/InvalidGroupLevelException.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 35 ++--- .../InterestRateChartRepositoryWrapper.java | 10 +- ...nterestRateChartSlabRepositoryWrapper.java | 10 +- .../domain/InterestIncentives.java | 6 +- .../domain/InterestRateChart.java | 3 +- .../service/InterestRateChartAssembler.java | 3 +- .../InterestRateChartSlabAssembler.java | 3 +- .../loanaccount/api/LoansApiResource.java | 7 +- .../command/UpdateLoanOfficerCommand.java | 3 +- .../loanaccount/data/LoanAccountData.java | 18 +-- .../data/LoanApplicationTimelineData.java | 3 +- .../loanaccount/data/LoanChargeData.java | 3 +- .../data/LoanTransactionEnumData.java | 4 +- .../domain/ChangedTransactionDetail.java | 3 +- .../portfolio/loanaccount/domain/Loan.java | 132 +++++++--------- .../domain/LoanAccountDomainService.java | 5 +- .../domain/LoanAccountDomainServiceJpa.java | 34 ++--- .../loanaccount/domain/LoanCharge.java | 20 +-- .../LoanInterestRecalculationDetails.java | 3 +- ...oanRepaymentScheduleProcessingWrapper.java | 3 +- .../domain/LoanRepositoryWrapper.java | 3 +- .../loanaccount/domain/LoanSummary.java | 3 +- .../domain/LoanSummaryWrapper.java | 3 +- .../domain/LoanTermVariationsComparator.java | 4 +- .../loanaccount/domain/LoanTransaction.java | 15 +- .../domain/LoanTransactionComparator.java | 8 +- .../domain/LoanTransactionType.java | 12 +- ...RepaymentScheduleTransactionProcessor.java | 49 +++--- ...RepaymentScheduleTransactionProcessor.java | 3 +- ...RepaymentScheduleTransactionProcessor.java | 20 +-- ...RepaymentScheduleTransactionProcessor.java | 11 +- ...RepaymentScheduleTransactionProcessor.java | 16 +- ...RepaymentScheduleTransactionProcessor.java | 14 +- ...RepaymentScheduleTransactionProcessor.java | 11 +- ...RepaymentScheduleTransactionProcessor.java | 11 +- ...RepaymentScheduleTransactionProcessor.java | 17 +-- .../exception/DateMismatchException.java | 4 +- .../InvalidLoanStateTransitionException.java | 4 +- .../InvalidLoanTransactionTypeException.java | 4 +- .../exception/InvalidLoanTypeException.java | 4 +- .../InvalidPaidInAdvanceAmountException.java | 4 +- ...ndPendingApprovalStateCannotBeDeleted.java | 3 +- ...dPendingApprovalStateCannotBeModified.java | 3 +- .../LoanTemplateTypeRequiredException.java | 3 +- ...onProcessingStrategyNotFoundException.java | 3 +- ...alAndFirstRepaymentViolationException.java | 5 +- ...NotSupportedLoanTemplateTypeException.java | 3 +- .../exception/InvalidGuarantorException.java | 3 +- ...arantorCommandFromApiJsonDeserializer.java | 3 +- .../service/GuarantorDomainServiceImpl.java | 37 ++--- .../service/GuarantorReadPlatformService.java | 3 +- .../loanschedule/data/LoanScheduleData.java | 12 +- .../data/LoanSchedulePeriodData.java | 10 +- .../domain/AbstractLoanScheduleGenerator.java | 33 ++-- ...gBalanceInterestLoanScheduleGenerator.java | 19 +-- .../domain/DefaultScheduledDateGenerator.java | 15 +- .../domain/FinanicalFunctions.java | 14 +- .../FlatInterestLoanScheduleGenerator.java | 10 +- .../domain/LoanApplicationTerms.java | 48 +++--- .../LoanScheduleModelDisbursementPeriod.java | 3 +- .../LoanScheduleModelRepaymentPeriod.java | 3 +- .../service/LoanScheduleAssembler.java | 24 ++- ...cheduleCalculationPlatformServiceImpl.java | 3 +- .../api/RescheduleLoansApiResource.java | 16 +- .../LoanRescheduleRequestTimelineData.java | 3 +- .../domain/LoanRescheduleRequest.java | 8 +- ...oanRescheduleRequestNotFoundException.java | 3 +- ...nRescheduleRequestReadPlatformService.java | 5 +- ...heduleRequestWritePlatformServiceImpl.java | 22 +-- ...anApplicationCommandFromApiJsonHelper.java | 5 +- ...WritePlatformServiceJpaRepositoryImpl.java | 13 +- .../service/LoanReadPlatformService.java | 9 +- .../service/LoanReadPlatformServiceImpl.java | 16 +- ...WritePlatformServiceJpaRepositoryImpl.java | 27 ++-- ...nterestRecalculationCompoundingMethod.java | 3 +- .../InterestRecalculationPeriodMethod.java | 3 +- .../loanproduct/domain/LendingStrategy.java | 10 +- .../loanproduct/domain/LoanProduct.java | 7 +- .../domain/LoanProductMinMaxConstraints.java | 3 +- ...MinimumRepaymentScheduleRelatedDetail.java | 3 +- .../domain/LoanProductRelatedDetail.java | 4 +- .../domain/LoanRescheduleStrategyMethod.java | 3 +- .../exception/InvalidCurrencyException.java | 3 +- .../exception/InvalidLendingStrategy.java | 3 +- .../exception/NotInMinMaxRangeException.java | 3 +- .../ProductMixNotFoundException.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../domain/MeetingRepositoryWrapper.java | 9 +- .../MeetingNotSupportedResourceException.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 17 +-- .../portfolio/note/data/NoteData.java | 3 +- .../portfolio/rate/domain/RateRepository.java | 3 +- .../rate/service/RateWriteServiceImpl.java | 3 +- .../savings/DepositAccountOnClosureType.java | 4 +- .../DepositAccountOnHoldTransactionType.java | 3 +- .../portfolio/savings/DepositAccountType.java | 3 +- .../SavingsAccountTransactionType.java | 3 +- .../SavingsCompoundingInterestPeriodType.java | 3 +- ...ingsInterestCalculationDaysInYearType.java | 3 +- .../SavingsInterestCalculationType.java | 6 +- .../SavingsPostingInterestPeriodType.java | 4 +- ...DepositAccountTransactionsApiResource.java | 6 +- .../api/SavingsAccountsApiResource.java | 14 +- .../savings/api/SavingsApiSetConstants.java | 10 +- .../savings/data/DepositAccountData.java | 3 +- .../data/DepositAccountDataValidator.java | 27 ++-- .../savings/data/DepositProductData.java | 4 +- .../data/DepositProductDataValidator.java | 10 +- .../savings/data/FixedDepositProductData.java | 5 +- .../data/RecurringDepositProductData.java | 5 +- ...SavingsAccountApplicationTimelineData.java | 3 +- .../savings/data/SavingsAccountConstant.java | 10 +- .../SavingsAccountTransactionEnumData.java | 3 +- .../savings/data/SavingsProductData.java | 4 +- .../data/SavingsProductDataValidator.java | 39 ++--- .../domain/DepositAccountAssembler.java | 5 +- .../DepositAccountDomainServiceJpa.java | 18 +-- .../domain/DepositPreClosureDetail.java | 5 +- .../domain/DepositProductAmountDetails.java | 3 +- .../domain/DepositRecurringDetail.java | 5 +- .../savings/domain/DepositTermDetail.java | 3 +- .../savings/domain/FixedDepositAccount.java | 10 +- .../domain/RecurringDepositAccount.java | 33 ++-- .../savings/domain/SavingsAccount.java | 51 +++---- .../domain/SavingsAccountAssembler.java | 10 +- .../savings/domain/SavingsAccountCharge.java | 11 +- ...SavingsAccountChargeRepositoryWrapper.java | 3 +- .../SavingsAccountRepositoryWrapper.java | 9 +- .../savings/domain/SavingsAccountSummary.java | 3 +- .../domain/SavingsAccountTransaction.java | 8 +- .../SavingsAccountTransactionComparator.java | 3 +- ...vingsAccountTransactionSummaryWrapper.java | 4 +- .../savings/domain/SavingsProduct.java | 12 +- .../interest/CompoundInterestHelper.java | 7 +- .../domain/interest/EndOfDayBalance.java | 10 +- .../domain/interest/PostingPeriod.java | 7 +- ...AccountTransactionNotAllowedException.java | 3 +- .../InsufficientAccountBalanceException.java | 3 +- ...ctivityPriorToClientTransferException.java | 4 +- ...erTransactionsCannotBeUndoneException.java | 4 +- ...erestRateChartReadPlatformServiceImpl.java | 17 +-- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...positsDropdownReadPlatformServiceImpl.java | 18 +-- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...SavingsAccountReadPlatformServiceImpl.java | 73 ++++----- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../TaxMappingNotFoundException.java | 3 +- .../TransferNotSupportedException.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 60 ++++---- .../template/service/TrustModifier.java | 3 +- .../api/UsersApiResource.java | 3 +- .../useradministration/domain/AppUser.java | 3 +- ...issionCantBeMakerCheckerableException.java | 3 +- .../UnAuthenticatedUserException.java | 4 +- ...issionsCommandFromApiJsonDeserializer.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 7 +- .../PermissionReadPlatformServiceImpl.java | 5 +- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +- .../apache/fineract/batch/BatchBuilder.java | 3 +- .../fineract/common/RestAssuredFixture.java | 7 +- .../org/apache/fineract/common/Utils.java | 8 +- ...ClasspathHellDuplicatesCheckExtension.java | 12 +- .../spring/SpringConfigurationTest.java | 23 ++- ...WithoutDatabaseAndNoJobsConfiguration.java | 15 +- ...ymentScheduleTransactionProcessorTest.java | 3 +- ...ymentScheduleTransactionProcessorTest.java | 10 +- .../LoanProductRelatedDetailTestHelper.java | 5 +- .../LoanScheduleTestDataHelper.java | 16 +- .../loanaccount/LoanTransactionBuilder.java | 3 +- 541 files changed, 1995 insertions(+), 3177 deletions(-) mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorForSavingsFactory.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformServiceUnavailableExceptionMapper.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceServiceFactory.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerStopListener.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientSavingProductException.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventListner.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierService.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/ChangedTransactionDetail.java diff --git a/config/fineractdev-formatter.xml b/config/fineractdev-formatter.xml index 0a412cb1e..05b6ad355 100644 --- a/config/fineractdev-formatter.xml +++ b/config/fineractdev-formatter.xml @@ -79,7 +79,7 @@ - + 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 3fa7566e6..8c1ca0a66 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 @@ -112,8 +112,7 @@ public class AccountNumberPreferencesTest { this.deleteAllAccountNumberPreferences(); /* - * Validate the default account number generation rules for clients, - * loans and savings accounts. + * Validate the default account number generation rules for clients, loans and savings accounts. */ this.validateDefaultAccountNumberGeneration(); @@ -121,8 +120,7 @@ public class AccountNumberPreferencesTest { this.createAccountNumberPreference(); /* - * Validate account number preference rules apply to Clients,Loans and - * Saving Accounts + * Validate account number preference rules apply to Clients,Loans and Saving Accounts */ this.validateAccountNumberGenerationWithPreferences(); @@ -130,8 +128,7 @@ public class AccountNumberPreferencesTest { this.updateAccountNumberPreference(); /* - * Validate account number preference rules apply to Clients,Loans and - * Saving Accounts after Updation + * Validate account number preference rules apply to Clients,Loans and Saving Accounts after Updation */ this.validateAccountNumberGenerationWithPreferences(); 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 fbbeca996..e0f45b871 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 @@ -41,10 +41,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** - * Test class for - * {@link org.apache.fineract.batch.command.CommandStrategyProvider}. This tests - * the response provided by commandStrategy by injecting it with a - * {@code BatchRequest}. + * Test class for {@link org.apache.fineract.batch.command.CommandStrategyProvider}. This tests the response provided by + * commandStrategy by injecting it with a {@code BatchRequest}. * * @author RishabhShukla * @@ -57,9 +55,8 @@ public class BatchApiTest { private RequestSpecification requestSpec; /** - * Sets up the essential settings for the TEST like contentType, - * expectedStatusCode. It uses the '@BeforeEach' annotation provided by - * jUnit. + * Sets up the essential settings for the TEST like contentType, expectedStatusCode. It uses the '@BeforeEach' + * annotation provided by jUnit. */ @BeforeEach public void setup() { @@ -70,9 +67,8 @@ public class BatchApiTest { } /** - * Tests for the unimplemented command Strategies by returning 501 status - * code. For a unknownRequest a statusCode 501 is returned back with - * response. + * Tests for the unimplemented command Strategies by returning 501 status code. For a unknownRequest a statusCode + * 501 is returned back with response. * * @see org.apache.fineract.batch.command.internal.UnknownCommandStrategy */ @@ -93,9 +89,8 @@ public class BatchApiTest { } /** - * Tests for the successful response for a createClient request from - * createClientCommand. A successful response with statusCode '200' is - * returned back. + * Tests for the successful response for a createClient request from createClientCommand. A successful response with + * statusCode '200' is returned back. * * @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy */ @@ -113,10 +108,9 @@ public class BatchApiTest { } /** - * Tests for an erroneous response with statusCode '501' if transaction - * fails. If Query Parameter 'enclosingTransaction' is set to 'true' and if - * one of the request in BatchRequest fails then all transactions are rolled - * back. + * Tests for an erroneous response with statusCode '501' if transaction fails. If Query Parameter + * 'enclosingTransaction' is set to 'true' and if one of the request in BatchRequest fails then all transactions are + * rolled back. * * @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy * @see org.apache.fineract.batch.api.BatchApiResource @@ -156,9 +150,8 @@ public class BatchApiTest { } /** - * Tests that a client information was successfully updated through - * updateClientCommand. A 'changes' parameter is returned in the response - * after successful update of client information. + * Tests that a client information was successfully updated through updateClientCommand. A 'changes' parameter is + * returned in the response after successful update of client information. * * @see org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy */ @@ -190,10 +183,8 @@ public class BatchApiTest { } /** - * Tests that a ApplyLoanCommand was successfully executed and returned a - * 200(OK) status. It creates a new client and apply a loan to that client. - * This also verifies the successful resolution of dependencies among two - * requests. + * Tests that a ApplyLoanCommand was successfully executed and returned a 200(OK) status. It creates a new client + * and apply a loan to that client. This also verifies the successful resolution of dependencies among two requests. * * @see org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy */ @@ -240,9 +231,8 @@ public class BatchApiTest { } /** - * Tests that a new savings accounts was applied to an existing client and a - * 200(OK) status was returned. It first creates a new client and a savings - * product, then uses the cliendId and ProductId to apply a savings account. + * Tests that a new savings accounts was applied to an existing client and a 200(OK) status was returned. It first + * creates a new client and a savings product, then uses the cliendId and ProductId to apply a savings account. * * @see org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy */ @@ -282,10 +272,9 @@ public class BatchApiTest { } /** - * Tests that a new charge was added to a newly created loan and charges are - * Collected properly 200(OK) status was returned for successful responses. - * It first creates a new client and apply a loan, then creates a new charge - * for the create loan and then fetches all the applied charges + * Tests that a new charge was added to a newly created loan and charges are Collected properly 200(OK) status was + * returned for successful responses. It first creates a new client and apply a loan, then creates a new charge for + * the create loan and then fetches all the applied charges * * @see org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy * @see org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy @@ -334,10 +323,9 @@ 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 */ @@ -398,9 +386,8 @@ public class BatchApiTest { } /** - * Test for the successful activation of a pending client using - * 'ActivateClientCommandStrategy'. A '200' status code is expected on - * successful activation. + * Test for the successful activation of a pending client using 'ActivateClientCommandStrategy'. A '200' status code + * is expected on successful activation. * * @see org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy */ @@ -428,9 +415,8 @@ public class BatchApiTest { } /** - * Test for the successful approval and disbursal of a loan using - * 'ApproveLoanCommandStrategy' and 'DisburseLoanCommandStrategy'. A '200' - * status code is expected on successful activation. + * Test for the successful approval and disbursal of a loan using 'ApproveLoanCommandStrategy' and + * 'DisburseLoanCommandStrategy'. 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 @@ -483,9 +469,8 @@ 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 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 9a9b137f0..6891640dd 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 @@ -40,9 +40,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Test class for testing the integration of Batch API with custom batch - * requests and various user defined workflow. Like in the case of mifos - * community-app + * Test class for testing the integration of Batch API with custom batch requests and various user defined workflow. + * Like in the case of mifos community-app * * @author Rishabh Shukla */ @@ -57,9 +56,8 @@ public class BatchRequestsIntegrationTest { } /** - * Sets up the essential settings for the TEST like contentType, - * expectedStatusCode. It uses the '@BeforeEach' annotation provided by - * jUnit. + * Sets up the essential settings for the TEST like contentType, expectedStatusCode. It uses the '@BeforeEach' + * annotation provided by jUnit. */ @BeforeEach public void setup() { @@ -72,12 +70,10 @@ public class BatchRequestsIntegrationTest { @Test /** - * Tests that a loan is successfully applied to client members of a group. - * Firstly, it'll create a few new clients and then will add those clients - * to the group. Then a few loans will be created and one of those loans - * will be chosen at random and similarily a few of the created clients will - * be chosen on random. Now, the selected loan will be applied to these - * clients through Batch - API ApplyLoanCommandStrategy. + * Tests that a loan is successfully applied to client members of a group. Firstly, it'll create a few new clients + * and then will add those clients to the group. Then a few loans will be created and one of those loans will be + * chosen at random and similarily a few of the created clients will be chosen on random. Now, the selected loan + * will be applied to these clients through Batch - API ApplyLoanCommandStrategy. */ public void shouldReturnOkStatusForLoansAppliedToSelectedClients() { 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 aa8c7ed1c..aeb528065 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 @@ -62,9 +62,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Client Loan Integration Test for checking Loan Application Repayments - * Schedule, loan charges, penalties, loan repayments and verifying accounting - * transactions + * Client Loan Integration Test for checking Loan Application Repayments Schedule, loan charges, penalties, loan + * repayments and verifying accounting transactions */ @SuppressWarnings({ "rawtypes", "unchecked" }) public class ClientLoanIntegrationTest { @@ -1249,8 +1248,7 @@ 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() { @@ -1426,8 +1424,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() { @@ -1606,8 +1604,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() { @@ -1787,8 +1785,7 @@ 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() { @@ -1981,8 +1978,8 @@ public class ClientLoanIntegrationTest { } /*** - * 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() { @@ -2171,8 +2168,8 @@ public class ClientLoanIntegrationTest { } /*** - * 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() { @@ -2368,8 +2365,7 @@ public class ClientLoanIntegrationTest { } /*** - * 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 { @@ -2467,14 +2463,10 @@ public class ClientLoanIntegrationTest { validateCharge(flatInstallmentFee, loanCharges, "50", "100.00", "50.0", "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"), - * JournalEntry.TransactionType.DEBIT)); + * 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"), JournalEntry.TransactionType.DEBIT)); */ final String jobName = "Add Accrual Transactions"; @@ -2561,8 +2553,8 @@ public class ClientLoanIntegrationTest { } /** - * 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 { @@ -2663,14 +2655,10 @@ public class ClientLoanIntegrationTest { validateCharge(percentageInstallmentFee, loanCharges, "1", "61.19", "29.11", "29.70"); /* - * 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"), - * JournalEntry.TransactionType.DEBIT)); + * 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"), JournalEntry.TransactionType.DEBIT)); */ final String jobName = "Add Accrual Transactions"; @@ -2758,8 +2746,8 @@ public class ClientLoanIntegrationTest { } /*** - * 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 { @@ -2861,13 +2849,10 @@ 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"), - * JournalEntry.TransactionType.DEBIT)); + * 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)); */ final String jobName = "Add Accrual Transactions"; @@ -3032,8 +3017,7 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("0.00", String.valueOf(firstInstallment.get("totalOutstandingForPeriod"))); /*** - * Verify 2nd and 3rd repayments dues before making excess payment for - * installment no 2 + * Verify 2nd and 3rd repayments dues before making excess payment for installment no 2 */ HashMap secondInstallment = loanSchedule.get(2); HashMap thirdInstallment = loanSchedule.get(3); @@ -3051,18 +3035,15 @@ 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"))); @@ -3072,16 +3053,14 @@ 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); @@ -4948,8 +4927,8 @@ public class ClientLoanIntegrationTest { .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 + * 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); 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 index db31fdfa3..93d074edc 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java @@ -656,9 +656,8 @@ public class ClientSavingsIntegrationTest { } /*** - * Test case for overdraft account functionality. Open account with zero - * balance, perform transactions then post interest and verify posted - * interest + * Test case for overdraft account functionality. Open account with zero balance, perform transactions then post + * interest and verify posted interest */ @SuppressWarnings("unchecked") @Test @@ -675,8 +674,7 @@ public class ClientSavingsIntegrationTest { final String minBalanceForInterestCalculation = null; /*** - * Create savings product with zero opening balance and overdraft - * enabled + * Create savings product with zero opening balance and overdraft enabled */ final String zeroOpeningBalance = "0.0"; final String minRequiredBalance = null; @@ -734,9 +732,8 @@ public class ClientSavingsIntegrationTest { Float balance = Float.valueOf(zeroOpeningBalance); /*** - * Perform withdraw transaction, verify account balance(account balance - * will go to negative as no deposits are there prior to this - * transaction) + * Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are + * there prior to this transaction) */ Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT, ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); @@ -746,8 +743,7 @@ public class ClientSavingsIntegrationTest { assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal"); /*** - * Perform Deposit transaction on last day of month and verify account - * balance. + * Perform Deposit transaction on last day of month and verify account balance. * * @param transactionDate * this value is every time last day of previous month @@ -768,9 +764,8 @@ public class ClientSavingsIntegrationTest { 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 - * month before this account balance is negative. + * Calculate expected interest to be posted, interest should be posted for one day only because deposit + * transaction happened on last day of month before this account balance is negative. */ final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString()); final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType"); @@ -781,8 +776,7 @@ public class ClientSavingsIntegrationTest { Float interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -812,8 +806,7 @@ public class ClientSavingsIntegrationTest { final String minBalanceForInterestCalculation = null; /*** - * Create savings product with zero opening balance and overdraft - * enabled + * Create savings product with zero opening balance and overdraft enabled */ final String zeroOpeningBalance = "0.0"; final String minRequiredBalance = null; @@ -876,8 +869,7 @@ public class ClientSavingsIntegrationTest { String TRANSACTION_DATE = dateFormat.format(transactionDate.getTime()); /*** - * Perform Deposit transaction on last day of month and verify account - * balance. + * Perform Deposit transaction on last day of month and verify account balance. * * @param transactionDate * this value is every time last day of previous month @@ -890,9 +882,8 @@ public class ClientSavingsIntegrationTest { assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit"); /*** - * Calculate expected interest to be posted, interest should be posted - * for one day only because deposit transaction happened on last day of - * month before this account balance is negative. + * Calculate expected interest to be posted, interest should be posted for one day only because deposit + * transaction happened on last day of month before this account balance is negative. */ this.savingsAccountHelper.postInterestForSavings(savingsId); HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId); @@ -908,8 +899,7 @@ public class ClientSavingsIntegrationTest { Float interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -931,8 +921,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -958,8 +947,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -989,8 +977,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 19); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1020,8 +1007,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 8); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1047,8 +1033,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1072,8 +1057,7 @@ public class ClientSavingsIntegrationTest { final String minBalanceForInterestCalculation = null; /*** - * Create savings product with zero opening balance and overdraft - * enabled + * Create savings product with zero opening balance and overdraft enabled */ final String zeroOpeningBalance = "0.0"; final String minRequiredBalance = null; @@ -1136,9 +1120,8 @@ public class ClientSavingsIntegrationTest { 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) + * Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are + * there prior to this transaction) */ Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT, ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); @@ -1148,8 +1131,7 @@ public class ClientSavingsIntegrationTest { assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal"); /*** - * Perform Deposit transaction on last day of month and verify account - * balance. + * Perform Deposit transaction on last day of month and verify account balance. * * @param transactionDate * this value is every time last day of previous month @@ -1162,9 +1144,8 @@ public class ClientSavingsIntegrationTest { assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit"); /*** - * Calculate expected interest to be posted, interest should be posted - * for one day only because deposit transaction happened on last day of - * month before this account balance is negative. + * Calculate expected interest to be posted, interest should be posted for one day only because deposit + * transaction happened on last day of month before this account balance is negative. */ this.savingsAccountHelper.postInterestForSavings(savingsId); HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId); @@ -1180,8 +1161,7 @@ public class ClientSavingsIntegrationTest { Float interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1203,8 +1183,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1230,8 +1209,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1261,8 +1239,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 19); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1292,8 +1269,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 8); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1319,8 +1295,7 @@ public class ClientSavingsIntegrationTest { interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1344,8 +1319,7 @@ public class ClientSavingsIntegrationTest { final String minBalanceForInterestCalculation = null; /*** - * Create savings product with zero opening balance and overdraft - * enabled + * Create savings product with zero opening balance and overdraft enabled */ final String zeroOpeningBalance = "0.0"; final String minRequiredBalance = null; @@ -1408,9 +1382,8 @@ public class ClientSavingsIntegrationTest { Float balance = Float.valueOf(zeroOpeningBalance); /*** - * Perform withdraw transaction, verify account balance(account balance - * will go to negative as no deposits are there prior to this - * transaction) + * Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are + * there prior to this transaction) */ Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT, ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); @@ -1420,8 +1393,7 @@ public class ClientSavingsIntegrationTest { assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal"); /*** - * Perform Deposit transaction on last day of month and verify account - * balance. + * Perform Deposit transaction on last day of month and verify account balance. * * @param transactionDate * this value is every time last day of previous month @@ -1442,9 +1414,8 @@ public class ClientSavingsIntegrationTest { 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 - * month before this account balance is negative. + * Calculate expected interest to be posted, interest should be posted for one day only because deposit + * transaction happened on last day of month before this account balance is negative. */ this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_TRANSACTION_DATE); HashMap accountDetailsPostInterest = this.savingsAccountHelper.getSavingsDetails(savingsId); @@ -1453,9 +1424,8 @@ public class ClientSavingsIntegrationTest { Float accountDetailsPostInterestPosted = 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 - * month before this account balance is negative. + * Calculate expected interest to be posted, interest should be posted for one day only because deposit + * transaction happened on last day of month before this account balance is negative. */ final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString()); final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType"); @@ -1466,8 +1436,7 @@ public class ClientSavingsIntegrationTest { Float interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1518,8 +1487,7 @@ public class ClientSavingsIntegrationTest { final String minBalanceForInterestCalculation = null; /*** - * Create savings product with zero opening balance and overdraft - * enabled + * Create savings product with zero opening balance and overdraft enabled */ final String zeroOpeningBalance = "0.0"; final String minRequiredBalance = null; @@ -1587,9 +1555,8 @@ public class ClientSavingsIntegrationTest { Float balance = Float.valueOf(zeroOpeningBalance); /*** - * Perform withdraw transaction, verify account balance(account balance - * will go to negative as no deposits are there prior to this - * transaction) + * Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are + * there prior to this transaction) */ Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT, ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID); @@ -1599,8 +1566,7 @@ public class ClientSavingsIntegrationTest { assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal"); /*** - * Perform Deposit transaction on last day of month and verify account - * balance. + * Perform Deposit transaction on last day of month and verify account balance. * * @param transactionDate * this value is every time last day of previous month @@ -1621,9 +1587,8 @@ public class ClientSavingsIntegrationTest { 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 - * month before this account balance is negative. + * Calculate expected interest to be posted, interest should be posted for one day only because deposit + * transaction happened on last day of month before this account balance is negative. */ final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString()); final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType"); @@ -1634,8 +1599,7 @@ public class ClientSavingsIntegrationTest { Float interestPosted = (float) (interestPerDay * balance * 1); /*** - * Apply rounding on interestPosted, actualInterestPosted and verify - * both are same + * Apply rounding on interestPosted, actualInterestPosted and verify both are same */ DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("#.###"); @@ -1957,13 +1921,10 @@ public class ClientSavingsIntegrationTest { } /* - * private void verifySavingsInterest(final Object savingsInterest) { - * LOG.info( - * "--------------------VERIFYING THE BALANCE, INTEREST --------------------------" - * ); + * private void verifySavingsInterest(final Object savingsInterest) { LOG.info( + * "--------------------VERIFYING THE BALANCE, INTEREST --------------------------" ); * - * assertEquals("Verifying Interest Calculation", Float.valueOf("238.3399"), - * savingsInterest); } + * assertEquals("Verifying Interest Calculation", Float.valueOf("238.3399"), savingsInterest); } */ @SuppressWarnings("unchecked") @@ -2082,8 +2043,8 @@ 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 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 a9bac38ee..fd4462421 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 @@ -46,8 +46,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** - * Tests loan schedule change based on group meeting changes and loan - * rescheduling + * Tests loan schedule change based on group meeting changes and loan rescheduling **/ @SuppressWarnings({ "rawtypes" }) @Disabled 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 index 453601f80..87ca0e088 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FinancialActivityAccountsTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FinancialActivityAccountsTest.java @@ -83,15 +83,13 @@ public class FinancialActivityAccountsTest { Assertions.assertNotNull(financialActivityAccountId); /*** - * Fetch Created Financial Activity to Account Mapping and validate - * created values + * Fetch Created Financial Activity to Account Mapping and validate created values **/ assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityTransferAccount); /** - * Update Existing Financial Activity to Account Mapping and assert - * changes + * Update Existing Financial Activity to Account Mapping and assert changes **/ Account newLiabilityTransferAccount = accountHelper.createLiabilityAccount(); Assertions.assertNotNull(newLiabilityTransferAccount); @@ -120,8 +118,7 @@ public class FinancialActivityAccountsTest { duplicateFinancialActivityAccountError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE)); /** - * Associating incorrect GL account types with a financial activity - * should fail + * Associating incorrect GL account types with a financial activity should fail **/ List invalidFinancialActivityAccountError = (List) financialActivityAccountHelper.updateFinancialActivityAccount( financialActivityAccountId, assetTransferFinancialActivityId, newLiabilityTransferAccount.getAccountID(), 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 25f125be2..7fc0aaf84 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 @@ -121,8 +121,8 @@ public class FixedDepositTest { } /*** - * Test case for Fixed Deposit Account premature closure with transaction - * type withdrawal and Cash Based accounting enabled + * Test case for Fixed Deposit Account premature closure with transaction type withdrawal and Cash Based accounting + * enabled */ @Test public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal() { @@ -202,8 +202,7 @@ public class FixedDepositTest { Float depositAmount = (Float) accountSummary.get("totalDeposits"); /*** - * Verify journal entries posted for initial deposit transaction which - * happened at activation time + * Verify journal entries posted for initial deposit transaction which happened at activation time */ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) }; final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) }; @@ -336,8 +335,7 @@ public class FixedDepositTest { Float depositAmount = (Float) accountSummary.get("totalDeposits"); /*** - * Verify journal entries posted for initial deposit transaction which - * happened at activation time + * Verify journal entries posted for initial deposit transaction which happened at activation time */ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) }; final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) }; @@ -479,8 +477,7 @@ public class FixedDepositTest { Float depositAmount = (Float) accountSummary.get("totalDeposits"); /*** - * Verify journal entries posted for initial deposit transaction which - * happened at activation time + * Verify journal entries posted for initial deposit transaction which happened at activation time */ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) }; final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) }; @@ -686,8 +683,8 @@ public class FixedDepositTest { } /*** - * Test case for FD Account premature closure with transaction transfers to - * savings account and Cash Based accounting enabled + * Test case for FD Account premature closure with transaction transfers to savings account and Cash Based + * accounting enabled */ @Test public void testFixedDepositAccountWithPrematureClosureTypeTransferToSavings() { @@ -777,8 +774,7 @@ public class FixedDepositTest { Float depositAmount = (Float) accountSummary.get("totalDeposits"); /*** - * Verify journal entries posted for initial deposit transaction which - * happened at activation time + * Verify journal entries posted for initial deposit transaction which happened at activation time */ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) }; final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) }; @@ -834,9 +830,8 @@ public class FixedDepositTest { Float prematurityAmount = (Float) fixedDepositData.get("maturityAmount"); /*** - * Verify journal entry transactions for preclosure transaction As this - * transaction is an account transfer you should get financial account - * mapping details and verify amounts + * Verify journal entry transactions for preclosure transaction As this 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), @@ -855,8 +850,8 @@ public class FixedDepositTest { } /*** - * Test case for Fixed Deposit Account premature closure with transaction - * type ReInvest and Cash Based accounting enabled + * Test case for Fixed Deposit Account premature closure with transaction type ReInvest and Cash Based accounting + * enabled */ @Test public void testFixedDepositAccountWithPrematureClosureTypeReinvest() { @@ -930,8 +925,7 @@ public class FixedDepositTest { Float depositAmount = (Float) accountSummary.get("totalDeposits"); /*** - * Verify journal entries posted for initial deposit transaction which - * happened at activation time + * Verify journal entries posted for initial deposit transaction which happened at activation time */ final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) }; final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) }; @@ -2376,8 +2370,8 @@ public class FixedDepositTest { } /*** - * Test case for Fixed Deposit Account rollover with maturity instruction as - * re invest maturity amount(principal+interest) + * Test case for Fixed Deposit Account rollover with maturity instruction as re invest maturity + * amount(principal+interest) */ @Test public void testFixedDepositAccountWithRolloverMaturityAmount() { @@ -2457,8 +2451,7 @@ public class FixedDepositTest { } /*** - * Test case for Fixed Deposit Account rollover with maturity instruction as - * re invest principal only + * Test case for Fixed Deposit Account rollover with maturity instruction as re invest principal only */ @Test public void testFixedDepositAccountWithRolloverPrincipal() { @@ -2648,8 +2641,7 @@ public class FixedDepositTest { List financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec); final Account financialAccount; /*** - * if no financial activities are defined for account transfers, create - * liability financial accounting mappings + * if no financial activities are defined for account transfers, create liability financial accounting mappings */ if (financialActivities.isEmpty()) { financialAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java index 9401d7377..7ca4884d4 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FlexibleSavingsInterestPostingIntegrationTest.java @@ -78,8 +78,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest { this.savingsAccountHelper.depositToSavingsAccount(savingsId, "1000", startDate, CommonConstants.RESPONSE_RESOURCE_ID); /*** - * Perform Post interest transaction and verify the posted transaction - * date + * Perform Post interest transaction and verify the posted transaction date */ this.savingsAccountHelper.postInterestForSavings(savingsId); HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GlobalConfigurationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GlobalConfigurationTest.java index 0d9058d53..51d6a15de 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GlobalConfigurationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GlobalConfigurationTest.java @@ -160,8 +160,7 @@ public class GlobalConfigurationTest { Assertions.assertNotNull(configId); /* - * Update force-password-reset-days with value as 0 and Enable - * as true - failure case + * Update force-password-reset-days with value as 0 and Enable as true - failure case */ ArrayList error = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec, this.httpStatusForidden, configId, newValue, newBooleanValue, CommonConstants.RESPONSE_ERROR); @@ -172,8 +171,7 @@ public class GlobalConfigurationTest { "Force Password Reset days value must be greater than zero."); /* - * Update force-password-reset-days with value as 50 and Enable - * as true - success case + * Update force-password-reset-days with value as 50 and Enable as true - success case */ final HashMap updateSuccess = (HashMap) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration( this.requestSpec, this.responseSpec, configId, "50", newBooleanValue, "changes"); @@ -185,8 +183,7 @@ public class GlobalConfigurationTest { Assertions.assertNotNull(updateSuccess1); /* - * Update without sending value and Enable as true - failure - * case + * Update without sending value and Enable as true - failure case */ ArrayList failure = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec, this.httpStatusForidden, configId, null, newBooleanValue, CommonConstants.RESPONSE_ERROR); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java index 9320ae039..7d7392ab1 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/GroupTest.java @@ -41,8 +41,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Group Test for checking Group: Creation, Activation, Client Association, - * Updating & Deletion + * Group Test for checking Group: Creation, Activation, Client Association, Updating & Deletion */ public class GroupTest { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java index 3729c464e..36cc3b2aa 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java @@ -70,8 +70,8 @@ public class HookIntegrationTest { try { /** - * sleep for a three seconds after each failure to increase the - * likelihood of the previous request for creating office completing + * sleep for a three seconds after each failure to increase the likelihood of the previous request for + * creating office completing **/ for (int i = 0; i < 6; i++) { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java index 8d3ee936c..8cb924c27 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanApplicationApprovalTest.java @@ -87,8 +87,7 @@ public class LoanApplicationApprovalTest { } /* - * Negative test case: Approved amount non zero is greater than proposed - * amount + * Negative test case: Approved amount non zero is greater than proposed amount */ @Test public void loanApplicationApprovedAmountGreaterThanProposedAmount() { @@ -236,10 +235,8 @@ public class LoanApplicationApprovalTest { /* If tranches are not specified for a multi-disburse loan */ /** - * error = - * this.loanTransactionHelper.approveLoanForTranches(approveDate, - * expectedDisbursementDate, approvalAmount5, loanID, approveTranche5, - * CommonConstants.RESPONSE_ERROR); + * error = this.loanTransactionHelper.approveLoanForTranches(approveDate, expectedDisbursementDate, + * approvalAmount5, loanID, approveTranche5, CommonConstants.RESPONSE_ERROR); * assertEquals("error.msg.disbursementData.required", * error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE)); **/ diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java index dc98baa98..0a8381594 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java @@ -232,113 +232,79 @@ public class LoanDisbursementDetailsIntegrationTest { /* Uncomment and modify test builder values once MIFOSX-2006 is closed. */ /* - * private void validateRepaymentScheduleWithoutEMI(ArrayList - * periods){ LoanDisbursementTestBuilder expectedRepaymentSchedule0 = new - * LoanDisbursementTestBuilder( "[2015, 6, 1]", 0.0f, 0.0f, null, null, - * 5000.0f, null, null, null); + * private void validateRepaymentScheduleWithoutEMI(ArrayList periods){ LoanDisbursementTestBuilder + * expectedRepaymentSchedule0 = new LoanDisbursementTestBuilder( "[2015, 6, 1]", 0.0f, 0.0f, null, null, 5000.0f, + * null, null, null); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new - * LoanDisbursementTestBuilder( "[2015, 7, 1]", 800.0f, 800.0f, 50.0f, - * 750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new LoanDisbursementTestBuilder( "[2015, 7, 1]", 800.0f, + * 800.0f, 50.0f, 750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new - * LoanDisbursementTestBuilder( "[2015, 8, 1]", 800.0f, 800.0f, 42.5f, - * 757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new LoanDisbursementTestBuilder( "[2015, 8, 1]", 800.0f, + * 800.0f, 42.5f, 757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new - * LoanDisbursementTestBuilder( "[2015, 9, 1]", 0.0f, 0.0f, null, null, - * 5000.0f, null, null, null); + * LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new LoanDisbursementTestBuilder( "[2015, 9, 1]", 0.0f, + * 0.0f, null, null, 5000.0f, null, null, null); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new - * LoanDisbursementTestBuilder( "[2015, 9, 1]", 800.0f, 800.0f, 34.92f, - * 765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new LoanDisbursementTestBuilder( "[2015, 9, 1]", 800.0f, + * 800.0f, 34.92f, 765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new - * LoanDisbursementTestBuilder( "[2015, 10, 1]", 800.0f, 800.0f, 77.27f, - * 722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new LoanDisbursementTestBuilder( "[2015, 10, 1]", + * 800.0f, 800.0f, 77.27f, 722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new - * LoanDisbursementTestBuilder( "[2015, 11, 1]", 800.0f, 800.0f, 70.05f, - * 729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new LoanDisbursementTestBuilder( "[2015, 11, 1]", + * 800.0f, 800.0f, 70.05f, 729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new - * LoanDisbursementTestBuilder( "[2015, 12, 1]", 800.0f, 800.0f, 62.75f, - * 737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new LoanDisbursementTestBuilder( "[2015, 12, 1]", + * 800.0f, 800.0f, 62.75f, 737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new - * LoanDisbursementTestBuilder( "[2016, 1, 1]", 800.0f, 800.0f, 55.37f, - * 744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new LoanDisbursementTestBuilder( "[2016, 1, 1]", 800.0f, + * 800.0f, 55.37f, 744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new - * LoanDisbursementTestBuilder( "[2016, 2, 1]", 800.0f, 800.0f, 47.93f, - * 752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new LoanDisbursementTestBuilder( "[2016, 2, 1]", 800.0f, + * 800.0f, 47.93f, 752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new - * LoanDisbursementTestBuilder( "[2016, 3, 1]", 800.0f, 800.0f, 40.41f, - * 759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new LoanDisbursementTestBuilder( "[2016, 3, 1]", + * 800.0f, 800.0f, 40.41f, 759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new - * LoanDisbursementTestBuilder( "[2016, 4, 1]", 800.0f, 800.0f, 32.81f, - * 767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new LoanDisbursementTestBuilder( "[2016, 4, 1]", + * 800.0f, 800.0f, 32.81f, 767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new - * LoanDisbursementTestBuilder( "[2016, 5, 1]", 800.0f, 800.0f, 25.14f, - * 774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new LoanDisbursementTestBuilder( "[2016, 5, 1]", + * 800.0f, 800.0f, 25.14f, 774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new - * LoanDisbursementTestBuilder( "[2016, 6, 1]", 800.0f, 800.0f, 17.39f, - * 782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new LoanDisbursementTestBuilder( "[2016, 6, 1]", + * 800.0f, 800.0f, 17.39f, 782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]"); * - * LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new - * LoanDisbursementTestBuilder( "[2016, 7, 1]", 966.11f, 966.11f, 9.57f, - * 956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]"); + * LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new LoanDisbursementTestBuilder( "[2016, 7, 1]", + * 966.11f, 966.11f, 9.57f, 956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]"); * - * ArrayList list = new - * ArrayList(); - * list.add(expectedRepaymentSchedule0); - * list.add(expectedRepaymentSchedule1); - * list.add(expectedRepaymentSchedule2); - * list.add(expectedRepaymentSchedule3); - * list.add(expectedRepaymentSchedule4); - * list.add(expectedRepaymentSchedule5); - * list.add(expectedRepaymentSchedule6); - * list.add(expectedRepaymentSchedule7); - * list.add(expectedRepaymentSchedule8); - * list.add(expectedRepaymentSchedule9); - * list.add(expectedRepaymentSchedule10); - * list.add(expectedRepaymentSchedule11); - * list.add(expectedRepaymentSchedule12); - * list.add(expectedRepaymentSchedule13); - * list.add(expectedRepaymentSchedule14); + * ArrayList list = new ArrayList(); + * list.add(expectedRepaymentSchedule0); list.add(expectedRepaymentSchedule1); list.add(expectedRepaymentSchedule2); + * list.add(expectedRepaymentSchedule3); list.add(expectedRepaymentSchedule4); list.add(expectedRepaymentSchedule5); + * list.add(expectedRepaymentSchedule6); list.add(expectedRepaymentSchedule7); list.add(expectedRepaymentSchedule8); + * list.add(expectedRepaymentSchedule9); list.add(expectedRepaymentSchedule10); + * list.add(expectedRepaymentSchedule11); list.add(expectedRepaymentSchedule12); + * list.add(expectedRepaymentSchedule13); list.add(expectedRepaymentSchedule14); * - * for (int i = 0; i < list.size(); i++) { - * this.assertRepaymentScheduleValuesWithoutEMI(periods.get(i), list.get(i), + * for (int i = 0; i < list.size(); i++) { this.assertRepaymentScheduleValuesWithoutEMI(periods.get(i), list.get(i), * i); } } * - * private void assertRepaymentScheduleValuesWithoutEMI(HashMap period, - * LoanDisbursementTestBuilder expectedRepaymentSchedule, int position) { + * private void assertRepaymentScheduleValuesWithoutEMI(HashMap period, LoanDisbursementTestBuilder + * expectedRepaymentSchedule, int position) { * - * assertEquals(period.get("dueDate").toString(), - * expectedRepaymentSchedule.getDueDate()); + * assertEquals(period.get("dueDate").toString(), expectedRepaymentSchedule.getDueDate()); * assertEquals(period.get("principalLoanBalanceOutstanding"), * expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding()); - * assertEquals(period.get("totalOriginalDueForPeriod"), - * expectedRepaymentSchedule.getTotalOriginalDueForPeriod()); - * assertEquals(period.get("totalOutstandingForPeriod"), - * expectedRepaymentSchedule.getTotalOutstandingForPeriod()); + * assertEquals(period.get("totalOriginalDueForPeriod"), expectedRepaymentSchedule.getTotalOriginalDueForPeriod()); + * assertEquals(period.get("totalOutstandingForPeriod"), expectedRepaymentSchedule.getTotalOutstandingForPeriod()); * * if (position != 0 && position != 3) { * - * assertEquals(period.get("interestOutstanding"), - * expectedRepaymentSchedule.getInterestOutstanding()); - * assertEquals(period.get("principalOutstanding"), - * expectedRepaymentSchedule.getPrincipalOutstanding()); - * assertEquals(period.get("principalDue"), - * expectedRepaymentSchedule.getPrincipalDue()); - * assertEquals(period.get("principalOriginalDue"), - * expectedRepaymentSchedule.getPrincipalOriginalDue()); - * assertEquals(period.get("fromDate").toString(), - * expectedRepaymentSchedule.getFromDate()); } } + * assertEquals(period.get("interestOutstanding"), expectedRepaymentSchedule.getInterestOutstanding()); + * assertEquals(period.get("principalOutstanding"), expectedRepaymentSchedule.getPrincipalOutstanding()); + * assertEquals(period.get("principalDue"), expectedRepaymentSchedule.getPrincipalDue()); + * assertEquals(period.get("principalOriginalDue"), expectedRepaymentSchedule.getPrincipalOriginalDue()); + * assertEquals(period.get("fromDate").toString(), expectedRepaymentSchedule.getFromDate()); } } */ private Integer applyForLoanApplicationWithEmiAmount(final Integer clientID, final Integer loanProductID, final String proposedAmount, List tranches, final String installmentAmount) { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java index 53ce86a4f..3570e89b0 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanWithWaiveInterestAndWriteOffIntegrationTest.java @@ -37,8 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Client Loan Integration Test for checking Loan Disbursement with Waive - * Interest and Write-Off. + * Client Loan Integration Test for checking Loan Disbursement with Waive Interest and Write-Off. */ @SuppressWarnings({ "rawtypes" }) public class LoanWithWaiveInterestAndWriteOffIntegrationTest { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/MinimumDaysBetweenDisbursalAndFirstRepaymentTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/MinimumDaysBetweenDisbursalAndFirstRepaymentTest.java index 3de38288f..7acd7cfc0 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/MinimumDaysBetweenDisbursalAndFirstRepaymentTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/MinimumDaysBetweenDisbursalAndFirstRepaymentTest.java @@ -66,9 +66,8 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest { } /* - * MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days - * between disbursal date and first repayment is set as 7. system should - * allow to create this loan and allow to disburse + * MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days between disbursal date and first repayment + * is set as 7. system should allow to create this loan and allow to disburse */ @Test public void createLoanEntity_WITH_DAY_BETWEEN_DISB_DATE_AND_REPAY_START_DATE_GREATER_THAN_MIN_DAY_CRITERIA() { @@ -112,9 +111,8 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest { } /* - * MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days - * between disbursal date and first repayment is set as 7. system should - * allow to create this loan and allow to disburse + * MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days between disbursal date and first repayment + * is set as 7. system should allow to create this loan and allow to disburse */ @SuppressWarnings("unchecked") @Test diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java index 45f72622a..7474bf90f 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java @@ -122,8 +122,8 @@ public class RecurringDepositTest { } /*** - * Test case for Recurring Deposit Account premature closure with - * transaction type withdrawal and Cash Based accounting enabled + * Test case for Recurring Deposit Account premature closure with transaction type withdrawal and Cash Based + * accounting enabled */ @Test public void testRecurringDepositAccountWithPrematureClosureTypeWithdrawal() { @@ -208,8 +208,7 @@ public class RecurringDepositTest { Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); /*** - * Perform Deposit transaction and verify journal entries are posted for - * the transaction + * Perform Deposit transaction and verify journal entries are posted for the transaction */ Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE); @@ -272,9 +271,8 @@ public class RecurringDepositTest { } /*** - * Test case for Recurring Deposit Account premature closure with - * transaction transfers to savings account and Cash Based accounting - * enabled + * Test case for Recurring Deposit Account premature closure with transaction transfers to savings account and Cash + * Based accounting enabled */ @Test public void testRecurringDepositAccountWithPrematureClosureTypeTransferToSavings() { @@ -388,8 +386,7 @@ public class RecurringDepositTest { Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); /*** - * Perform Deposit transaction and verify journal entries are posted for - * the transaction + * Perform Deposit transaction and verify journal entries are posted for the transaction */ Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE); @@ -451,9 +448,8 @@ public class RecurringDepositTest { recurringDepositAccountId); Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString()); /*** - * Verify journal entry transactions for preclosure transaction As this - * transaction is an account transfer you should get financial account - * mapping details and verify amounts + * Verify journal entry transactions for preclosure transaction As this transaction is an account transfer you + * should get financial account mapping details and verify amounts */ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT), @@ -592,8 +588,7 @@ public class RecurringDepositTest { Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); /*** - * Perform Deposit transaction and verify journal entries are posted for - * the transaction + * Perform Deposit transaction and verify journal entries are posted for the transaction */ Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE); @@ -656,9 +651,8 @@ public class RecurringDepositTest { recurringDepositAccountId); Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString()); /*** - * Verify journal entry transactions for preclosure transaction As this - * transaction is an account transfer you should get financial account - * mapping details and verify amounts + * Verify journal entry transactions for preclosure transaction As this transaction is an account transfer you + * should get financial account mapping details and verify amounts */ this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE, new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT), @@ -804,8 +798,7 @@ public class RecurringDepositTest { Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); /*** - * Perform Deposit transaction and verify journal entries are posted for - * the transaction + * Perform Deposit transaction and verify journal entries are posted for the transaction */ todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -20); @@ -846,8 +839,8 @@ public class RecurringDepositTest { } /*** - * Test case for Recurring Deposit Account premature closure with - * transaction type ReInvest and Cash Based accounting enabled + * Test case for Recurring Deposit Account premature closure with transaction type ReInvest and Cash Based + * accounting enabled */ @Test public void testRecurringDepositAccountWithPrematureClosureTypeReinvest() { @@ -941,8 +934,7 @@ public class RecurringDepositTest { Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); /*** - * Perform Deposit transaction and verify journal entries are posted for - * the transaction + * Perform Deposit transaction and verify journal entries are posted for the transaction */ Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, DEPOSIT_AMOUNT, EXPECTED_FIRST_DEPOSIT_ON_DATE); @@ -981,8 +973,7 @@ public class RecurringDepositTest { .calculatePrematureAmountForRecurringDeposit(recurringDepositAccountId, CLOSED_ON_DATE); /*** - * Expected to get an error response from api because re-invest option - * is not supported for account preClosure + * Expected to get an error response from api because re-invest option is not supported for account preClosure */ ArrayList errorResponse = (ArrayList) recurringDepositAccountHelperValidationError .prematureCloseForRecurringDeposit(recurringDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_REINVEST, null, @@ -1130,8 +1121,7 @@ public class RecurringDepositTest { } /*** - * Test case for Closure of Recurring Deposit Account(Withdrawn by - * applicant) + * Test case for Closure of Recurring Deposit Account(Withdrawn by applicant) */ @Test public void testRecurringDepositAccountWithdrawnByClientAndClosed() { @@ -1298,8 +1288,7 @@ public class RecurringDepositTest { Float balanceBefore = (Float) recurringDepositSummaryBefore.get("accountBalance"); /*** - * Perform Deposit transaction and verify journal entries are posted for - * the transaction + * Perform Deposit transaction and verify journal entries are posted for the transaction */ Integer transactionIdForDeposit = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, DEPOSIT_AMOUNT, DEPOSIT_DATE); @@ -1351,8 +1340,7 @@ public class RecurringDepositTest { } /*** - * Test case for verify maturity amount with monthly compounding and monthly - * posting with 365 days in year + * Test case for verify maturity amount with monthly compounding and monthly posting with 365 days in year */ @Test public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Days() { @@ -1429,8 +1417,7 @@ public class RecurringDepositTest { } /*** - * Test case for verify maturity amount with monthly compounding and monthly - * posting with 360 days in year + * Test case for verify maturity amount with monthly compounding and monthly posting with 360 days in year */ @Test public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Days() { @@ -1606,8 +1593,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with penal interest for - * whole term with closure transaction type withdrawal and 365 days in year + * Test case for verify premature closure amount with penal interest for whole term with closure transaction type + * withdrawal and 365 days in year */ @Test public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365_Days() { @@ -1731,8 +1718,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with penal interest for - * whole term with closure transaction type withdrawal and 360 days in year + * Test case for verify premature closure amount with penal interest for whole term with closure transaction type + * withdrawal and 360 days in year */ @Test public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360_Days() { @@ -1861,9 +1848,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with penal interest till - * maturity date with closure transaction type withdrawal and 365 days in - * year + * Test case for verify premature closure amount with penal interest till maturity date with closure transaction + * type withdrawal and 365 days in year */ @Test public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_With_365_Days() { @@ -1999,9 +1985,8 @@ public class RecurringDepositTest { } /*** - * Test case verify premature closure amount with penal interest till - * maturity date with closure transaction type withdrawal and 360 days in - * year + * Test case verify premature closure amount with penal interest till maturity date with closure transaction type + * withdrawal and 360 days in year */ @Test public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_With_360_Days() { @@ -2142,8 +2127,7 @@ public class RecurringDepositTest { } /*** - * Test case for verify maturity amount with daily compounding and monthly - * posting with 365 days in year + * Test case for verify maturity amount with daily compounding and monthly posting with 365 days in year */ @Test public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days() { @@ -2224,8 +2208,7 @@ public class RecurringDepositTest { } /*** - * Test case for verify maturity amount with daily compounding and monthly - * posting with 360 days in year + * Test case for verify maturity amount with daily compounding and monthly posting with 360 days in year */ @Test public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days() { @@ -2307,8 +2290,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with Bi-annual interest - * compounding and Bi-annual interest posting with 365 days in year + * Test case for verify premature closure amount with Bi-annual interest compounding and Bi-annual interest posting + * with 365 days in year */ @Test public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_365_Days() { @@ -2397,8 +2380,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with Bi-annual interest - * compounding and Bi-annual interest posting with 360 days in year + * Test case for verify premature closure amount with Bi-annual interest compounding and Bi-annual interest posting + * with 360 days in year */ @Test public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_360_Days() { @@ -2487,8 +2470,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify maturity amount with Daily interest compounding and - * annual interest posting with 365 days in year + * Test case for verify maturity amount with Daily interest compounding and annual interest posting with 365 days in + * year */ @Test public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Days() { @@ -2577,8 +2560,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify maturity amount with Daily interest compounding and - * annual interest posting with 360 days in year + * Test case for verify maturity amount with Daily interest compounding and annual interest posting with 360 days in + * year */ @Test public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_360_Days() { @@ -2667,8 +2650,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with Quarterly interest - * compounding and Quarterly interest posting with 365 days in year + * Test case for verify premature closure amount with Quarterly interest compounding and Quarterly interest posting + * with 365 days in year */ @Test public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_365_Days() { @@ -2757,8 +2740,8 @@ public class RecurringDepositTest { } /*** - * Test case for verify premature closure amount with Quarterly interest - * compounding and Quarterly interest posting with 360 days in year + * Test case for verify premature closure amount with Quarterly interest compounding and Quarterly interest posting + * with 360 days in year */ @Test public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_360_Days() { @@ -3112,8 +3095,7 @@ public class RecurringDepositTest { List financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec); final Account financialAccount; /*** - * if no financial activities are defined for account transfers, create - * liability financial accounting mappings + * if no financial activities are defined for account transfers, create liability financial accounting mappings */ if (financialActivities.isEmpty()) { financialAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SurveyIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SurveyIntegrationTest.java index 0ae3d3864..d417e4b1e 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SurveyIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SurveyIntegrationTest.java @@ -28,8 +28,7 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper; import org.junit.jupiter.api.BeforeEach; /** - * Client Loan Integration Test for checking Loan Application Repayment - * Schedule. + * Client Loan Integration Test for checking Loan Application Repayment Schedule. */ @SuppressWarnings({ "rawtypes", "unchecked" }) public class SurveyIntegrationTest { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java index 5a026b523..bc70fbae3 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java @@ -32,9 +32,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Helper class for {@link org.apache.fineract.integrationtests.BatchApiTest}. - * It takes care of creation of {@code BatchRequest} list and posting this list - * to the server. + * Helper class for {@link org.apache.fineract.integrationtests.BatchApiTest}. It takes care of creation of + * {@code BatchRequest} list and posting this list to the server. * * @author Rishabh Shukla * @@ -81,9 +80,8 @@ public final class BatchHelper { } /** - * Returns a list of BatchResponse with query parameter enclosing - * transaction set to false by posting the jsonified BatchRequest to the - * server. + * Returns a list of BatchResponse with query parameter enclosing transaction set to false by posting the jsonified + * BatchRequest to the server. * * @param requestSpec * @param responseSpec @@ -97,9 +95,8 @@ public final class BatchHelper { } /** - * Returns a list of BatchResponse with query parameter enclosing - * transaction set to true by posting the jsonified BatchRequest to the - * server. + * Returns a list of BatchResponse with query parameter enclosing transaction set to true by posting the jsonified + * BatchRequest to the server. * * @param requestSpec * @param responseSpec @@ -113,8 +110,7 @@ public final class BatchHelper { } /** - * Returns a BatchResponse based on the given BatchRequest, by posting the - * request to the server. + * Returns a BatchResponse based on the given BatchRequest, by posting the request to the server. * * @param BatchRequest * @return List @@ -137,9 +133,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy} - * Request as one of the request in Batch. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy} Request as + * one of the request in Batch. * * @param reqId * @param externalId @@ -168,9 +163,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy} - * Request as one of the request in Batch. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy} Request as + * one of the request in Batch. * * @param reqId * @param externalId @@ -200,9 +194,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy} Request with + * given requestId and reference. * * @param reqId * @param clientId @@ -222,9 +215,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy} Request with + * given requestId and reference. * * @param requestId * @param reference @@ -253,9 +245,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy} Request with + * given requestId and reference. * * @param requestId * @param reference @@ -279,9 +270,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy} - * Request with given requestId and reference + * Creates and returns a {@link org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy} Request with + * given requestId and reference * * @param requestId * @param reference @@ -303,9 +293,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy} Request + * with given requestId and reference. * * @param requestId * @param reference @@ -325,9 +314,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy} Request + * with given requestId and reference. * * * @param requestId @@ -348,9 +336,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy} Request with + * given requestId and reference. * * * @param requestId @@ -371,9 +358,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy} - * Request with given requestId and reference. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy} Request with + * given requestId and reference. * * * @param requestId @@ -393,9 +379,8 @@ public final class BatchHelper { } /** - * Creates and returns a - * {@link org.apache.fineract.batch.command.internal.RepayLoanCommandStrategy} - * Request with given requestId. + * Creates and returns a {@link org.apache.fineract.batch.command.internal.RepayLoanCommandStrategy} Request with + * given requestId. * * * @param requestId @@ -416,8 +401,7 @@ public final class BatchHelper { } /** - * Checks that the client with given externalId is not created on the - * server. + * Checks that the client with given externalId is not created on the server. * * @param requestSpec * @param responseSpec diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientChargesTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientChargesTest.java index 0a0b4af6c..89c769cd6 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientChargesTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/ClientChargesTest.java @@ -66,9 +66,8 @@ public class ClientChargesTest { Assertions.assertNotNull(clientId); /** - * create a charge for loan and try to associate to client created in - * the above lines.it will be an invalid scenario the reason is client - * is not allowed to have only client charge. + * create a charge for loan and try to associate to client created in the above lines.it will be an invalid + * scenario the reason is client is not allowed to have only client charge. * */ final Integer loanChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec, @@ -80,8 +79,7 @@ public class ClientChargesTest { Assertions.assertNull(clientLoanChargeId); /** - * associates a clientCharge to a client and pay client charge for 10 - * USD--success scenario + * associates a clientCharge to a client and pay client charge for 10 USD--success scenario **/ final Integer clientChargeId = ClientHelper.addChargesForClient(this.requestSpec, this.responseSpec, clientId, ClientHelper.getSpecifiedDueDateChargesClientAsJSON(chargeId.toString(), "29 October 2011")); @@ -93,16 +91,15 @@ public class ClientChargesTest { (float) 190.0); /** - * Revert the paid client charge transaction by passing the - * clientChargePaidTransactionId and ensure the same is reverted. + * Revert the paid client charge transaction by passing the clientChargePaidTransactionId and ensure the same is + * reverted. */ final Integer undoTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, clientId.toString(), clientChargePaidTransactionId); Assertions.assertNotNull(undoTrxnId); isReversedTransaction(clientId.toString(), undoTrxnId.toString()); /** - * Now pay client charge for 20 USD and ensure the outstanding amount is - * updated properly + * Now pay client charge for 20 USD and ensure the outstanding amount is updated properly */ ResponseSpecification responseSpecFailure = new ResponseSpecBuilder().expectStatusCode(400).build(); DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy"); @@ -119,32 +116,28 @@ public class ClientChargesTest { Assertions.assertNotNull(waiveOffClientChargeTransactionId); /** - * Revert the waived off client charge transaction by passing the - * waiveOffClientChargeTransactionId and ensured the transaction is - * reversed. + * Revert the waived off client charge transaction by passing the waiveOffClientChargeTransactionId and ensured + * the transaction is reversed. */ final Integer undoWaiveTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, clientId.toString(), waiveOffClientChargeTransactionId); Assertions.assertNotNull(undoWaiveTrxnId); isReversedTransaction(clientId.toString(), undoWaiveTrxnId.toString()); /** - * pay client charge before client activation date and ensured its a - * failure test case + * pay client charge before client activation date and ensured its a failure test case */ final String responseId_activationDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId, clientChargeId, ClientHelper.getPayChargeJSON("30 September 2011", "20")); Assertions.assertNull(responseId_activationDate_failure); /** - * pay client charge more than outstanding amount amount and ensured its - * a failure test case + * pay client charge more than outstanding amount amount and ensured its a failure test case */ final String responseId_moreAmount_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId, clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "300")); Assertions.assertNull(responseId_moreAmount_failure); /** - * pay client charge for 10 USD and ensure outstanding amount is updated - * properly + * pay client charge for 10 USD and ensure outstanding amount is updated properly */ final String chargePaid_responseId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId, clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "100")); @@ -168,8 +161,8 @@ public class ClientChargesTest { } /** - * Check whether the outStandingAmount is equal to expected Amount or not - * after paying or after waiving off the client charge. + * Check whether the outStandingAmount is equal to expected Amount or not after paying or after waiving off the + * client charge. * * @param outStandingAmount * @param expectedAmount diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java index fa52e444d..6710ed2d3 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java @@ -110,16 +110,13 @@ public class GlobalConfigurationHelper { } /** - * Helper method to get the current default instance data of the - * /configurations endpoint. Used to reset and verify that no global - * configuration affects state between integration tests. + * Helper method to get the current default instance data of the /configurations endpoint. Used to reset and verify + * that no global configuration affects state between integration tests. * - * @see FINERACT-722 - * This is a quick, fail fast and early implementation to resolve this - * issue. TODO: A more robust future solution would be isolating all - * integration test state using Spring Framework's integration test - * infrastructure for transaction commits and rollbacks. + * @see FINERACT-722 This is a quick, fail fast + * and early implementation to resolve this issue. TODO: A more robust future solution would be isolating all + * integration test state using Spring Framework's integration test infrastructure for transaction commits and + * rollbacks. */ private static ArrayList getAllDefaultGlobalConfigurations() { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java index 1a4f2871c..990c1ff1b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java @@ -142,9 +142,7 @@ public class SchedulerJobHelper { * Launches a Job and awaits its completion. * * @param jobName - * displayName (see - * {@link org.apache.fineract.infrastructure.jobs.service.JobName}) - * of Scheduler Job + * displayName (see {@link org.apache.fineract.infrastructure.jobs.service.JobName}) of Scheduler Job * * @author Michael Vorburger.ch */ diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java index 512e62702..38b3cb747 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java @@ -45,8 +45,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Util for RestAssured tests. This class here in src/integrationTest is - * copy/pasted to src/test; please keep them in sync. + * Util for RestAssured tests. This class here in src/integrationTest is copy/pasted to src/test; please keep them in + * sync. */ @SuppressWarnings("unchecked") public class Utils { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java index c3c39999f..9e811821b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java @@ -334,12 +334,10 @@ public class LoanApplicationTestBuilder { } /** - * calendarID parameter is used to sync repayments with group meetings, - * especially when using jlg loans + * calendarID parameter is used to sync repayments with group meetings, especially when using jlg loans * * @param calendarId - * the id of the calender record of the group meeting from - * m_calendar table + * the id of the calender record of the group meeting from m_calendar table * @return */ public LoanApplicationTestBuilder withCalendarID(String calendarId) { @@ -348,10 +346,8 @@ public class LoanApplicationTestBuilder { } /** - * This indicator is used mainly for jlg loans when we want to sync - * disbursement with the group meetings (it seems that if we do use this - * parameter we should also use calendarID to sync repayment with group - * meetings) + * This indicator is used mainly for jlg loans when we want to sync disbursement with the group meetings (it seems + * that if we do use this parameter we should also use calendarID to sync repayment with group meetings) * * @return */ diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanDisbursementTestBuilder.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanDisbursementTestBuilder.java index e2b78eb5e..70357c594 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanDisbursementTestBuilder.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanDisbursementTestBuilder.java @@ -81,27 +81,18 @@ public class LoanDisbursementTestBuilder { } /* - * public HashMap build(String dueDate,String - * totalOriginalDueForPeriod,String totalOutstandingForPeriod, String - * interestOutstanding, String principalOutstanding, String - * principalLoanBalanceOutstanding, String principalDue, String - * principalOriginalDue, String fromDate) { HashMap - * expectedRepaymentSchedule = new HashMap(); - * expectedRepaymentSchedule.put("dueDate", dueDate); - * expectedRepaymentSchedule.put("totalOriginalDueForPeriod", - * totalOriginalDueForPeriod); - * expectedRepaymentSchedule.put("totalOutstandingForPeriod", - * totalOutstandingForPeriod); - * expectedRepaymentSchedule.put("interestOutstanding", - * interestOutstanding); - * expectedRepaymentSchedule.put("principalOutstanding", - * principalOutstanding); - * expectedRepaymentSchedule.put("principalLoanBalanceOutstanding", - * principalLoanBalanceOutstanding); + * public HashMap build(String dueDate,String totalOriginalDueForPeriod,String + * totalOutstandingForPeriod, String interestOutstanding, String principalOutstanding, String + * principalLoanBalanceOutstanding, String principalDue, String principalOriginalDue, String fromDate) { + * HashMap expectedRepaymentSchedule = new HashMap(); + * expectedRepaymentSchedule.put("dueDate", dueDate); expectedRepaymentSchedule.put("totalOriginalDueForPeriod", + * totalOriginalDueForPeriod); expectedRepaymentSchedule.put("totalOutstandingForPeriod", + * totalOutstandingForPeriod); expectedRepaymentSchedule.put("interestOutstanding", interestOutstanding); + * expectedRepaymentSchedule.put("principalOutstanding", principalOutstanding); + * expectedRepaymentSchedule.put("principalLoanBalanceOutstanding", principalLoanBalanceOutstanding); * expectedRepaymentSchedule.put("principalDue", principalDue); - * expectedRepaymentSchedule.put("principalOriginalDue", - * principalOriginalDue); expectedRepaymentSchedule.put("fromDate", - * fromDate); + * expectedRepaymentSchedule.put("principalOriginalDue", principalOriginalDue); + * expectedRepaymentSchedule.put("fromDate", fromDate); * * return expectedRepaymentSchedule; } */ diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java index 630c1eec1..f7c82fad9 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/EntityDatatableChecksIntegrationTest.java @@ -46,8 +46,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Entity Datatable Checks Integration Test for checking Creation, Deletion and - * Retrieval of Entity-Datatable Check + * Entity Datatable Checks Integration Test for checking Creation, Deletion and Retrieval of Entity-Datatable Check */ public class EntityDatatableChecksIntegrationTest { diff --git a/fineract-provider/src/main/java/org/apache/fineract/ServerApplication.java b/fineract-provider/src/main/java/org/apache/fineract/ServerApplication.java index 34d3175de..aad208e5b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/ServerApplication.java +++ b/fineract-provider/src/main/java/org/apache/fineract/ServerApplication.java @@ -29,16 +29,13 @@ import org.springframework.context.annotation.Import; import org.springframework.context.annotation.ImportResource; /** - * Fineract main() application which launches Fineract in an embedded Tomcat - * HTTP (using Spring Boot). + * Fineract main() application which launches Fineract in an embedded Tomcat HTTP (using Spring Boot). * - * The DataSource used is a to a "normal" external database (not use MariaDB4j). - * This DataSource can be configured with parameters, see - * {@link DataSourceProperties}. + * The DataSource used is a to a "normal" external database (not use MariaDB4j). This DataSource can be configured with + * parameters, see {@link DataSourceProperties}. * - * You can easily launch this via Debug as Java Application in your IDE - - * without needing command line Gradle stuff, no need to build and deploy a WAR, - * remote attachment etc. + * You can easily launch this via Debug as Java Application in your IDE - without needing command line Gradle stuff, no + * need to build and deploy a WAR, remote attachment etc. * * It's the old/classic Mifos (non-X) Workspace 2.0 reborn for Fineract! ;-) * diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java index 6d42ebaec..c4ee398b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java @@ -45,8 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link GuarantorCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s. */ @Component public final class AccrualAccountingDataValidator { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java index 703dd3328..99345a13c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java @@ -29,8 +29,7 @@ final class GLClosuresApiResourceSwagger { } /** - * TODO: describe where this belongs: {@link GLClosuresApiResource } - * {@Link GLClosuresApiResource} + * TODO: describe where this belongs: {@link GLClosuresApiResource } {@Link GLClosuresApiResource} */ // Check !! diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/data/GLClosureData.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/data/GLClosureData.java index 889d0c08d..e346b2d18 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/data/GLClosureData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/data/GLClosureData.java @@ -26,8 +26,7 @@ import org.joda.time.LocalDate; /** * Immutable object representing a General Ledger Account * - * Note: no getter/setters required as google-gson will produce json from fields - * of object. + * Note: no getter/setters required as google-gson will produce json from fields of object. */ public class GLClosureData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureDuplicateException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureDuplicateException.java index 52862b03f..41ea6ef15 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureDuplicateException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureDuplicateException.java @@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR import org.joda.time.LocalDate; /** - * A {@link RuntimeException} thrown when a GL Closure for a given date and - * Office combination is already present + * A {@link RuntimeException} thrown when a GL Closure for a given date and Office combination is already present */ public class GLClosureDuplicateException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java index b627444bf..92fa3f5d9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.closure.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when GL account closure resources are not - * found. + * A {@link RuntimeException} thrown when GL account closure resources are not found. */ public class GLClosureNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/serialization/GLClosureCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/serialization/GLClosureCommandFromApiJsonDeserializer.java index a59b503b9..a0e9a4251 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/serialization/GLClosureCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/serialization/GLClosureCommandFromApiJsonDeserializer.java @@ -36,8 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link GuarantorCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s. */ @Component public final class GLClosureCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java index 411836a54..9f6c7686a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java @@ -124,8 +124,7 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure .orElseThrow(() -> new GLClosureNotFoundException(glClosureId)); /** - * check if any closures are present for this branch at a later date - * than this closure date + * check if any closures are present for this branch at a later date than this closure date **/ final Date closureDate = glClosure.getClosingDate(); final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(glClosure.getOffice().getId()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java index 3df460077..e87a01e2a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java @@ -102,8 +102,7 @@ public class AccountingConstants { } /*** - * Enum of all accounting related input parameter names used while - * creating/updating a loan product + * Enum of all accounting related input parameter names used while creating/updating a loan product ***/ public static enum LoanProductAccountingParams { @@ -201,8 +200,7 @@ public class AccountingConstants { } /*** - * Enum of all accounting related input parameter names used while - * creating/updating a savings product + * Enum of all accounting related input parameter names used while creating/updating a savings product ***/ public static enum SavingProductAccountingParams { @@ -374,8 +372,7 @@ public class AccountingConstants { } /*** - * Enum of all accounting related input parameter names used while - * creating/updating a savings product + * Enum of all accounting related input parameter names used while creating/updating a savings product ***/ public static enum SharesProductAccountingParams { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccountRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccountRepositoryWrapper.java index 169182409..6ff241e71 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccountRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccountRepositoryWrapper.java @@ -25,8 +25,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link FinancialActivityAccountRepository} that adds NULL - * checking and Error handling capabilities + * Wrapper for {@link FinancialActivityAccountRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/DuplicateFinancialActivityAccountFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/DuplicateFinancialActivityAccountFoundException.java index 070532b1b..c88139fed 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/DuplicateFinancialActivityAccountFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/DuplicateFinancialActivityAccountFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.financialactivityaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when product to GL account mapping are not - * found. + * A {@link RuntimeException} thrown when product to GL account mapping are not found. */ public class DuplicateFinancialActivityAccountFoundException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java index 1e62cb3b6..5b4431a55 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java @@ -23,8 +23,7 @@ import org.apache.fineract.accounting.glaccount.domain.GLAccount; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when product to GL account mapping are not - * found. + * A {@link RuntimeException} thrown when product to GL account mapping are not found. */ public class FinancialActivityAccountInvalidException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java index a99523969..e6350be58 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.financialactivityaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when product to GL account mapping are not - * found. + * A {@link RuntimeException} thrown when product to GL account mapping are not found. */ public class FinancialActivityAccountNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java index 7d14a953d..e3ccb20b3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java @@ -89,8 +89,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi } /** - * Validate that the GL Account is appropriate for the particular Financial - * Activity Type + * Validate that the GL Account is appropriate for the particular Financial Activity Type **/ private void validateFinancialActivityAndAccountMapping(FinancialActivityAccount financialActivityAccount) { FinancialActivity financialActivity = FinancialActivity.fromInt(financialActivityAccount.getFinancialActivityType()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/data/GLAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/data/GLAccountData.java index 8d725b208..0859cb2eb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/data/GLAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/data/GLAccountData.java @@ -30,8 +30,7 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData; /** * Immutable object representing a General Ledger Account * - * Note: no getter/setters required as google-gson will produce json from fields - * of object. + * Note: no getter/setters required as google-gson will produce json from fields of object. */ public class GLAccountData implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDisableException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDisableException.java index 251e87cc6..ca47194a4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDisableException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDisableException.java @@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR /** * - * when gl account is attached with any product(loan/saving) then we can not - * disable the gl account + * when gl account is attached with any product(loan/saving) then we can not disable the gl account */ public class GLAccountDisableException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDuplicateException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDuplicateException.java index fb9b831b3..c7906d7a5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDuplicateException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountDuplicateException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when a GL Account with a given GL Code of - * the particular type is already present + * A {@link RuntimeException} thrown when a GL Account with a given GL Code of the particular type is already present */ public class GLAccountDuplicateException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidClassificationException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidClassificationException.java index dce9a7e5c..f0ecc86df 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidClassificationException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidClassificationException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when trying to fetch accounts belonging to - * an Invalid Usage Type + * A {@link RuntimeException} thrown when trying to fetch accounts belonging to an Invalid Usage Type */ public class GLAccountInvalidClassificationException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java index efd53a25b..f90a76f78 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when a GL Account with a given GL Code of - * the particular type is already present + * A {@link RuntimeException} thrown when a GL Account with a given GL Code of the particular type is already present */ public class GLAccountInvalidDeleteException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidParentException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidParentException.java index e541d9c51..529d4d261 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidParentException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidParentException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when trying to map invalid parents to a GL - * account + * A {@link RuntimeException} thrown when trying to map invalid parents to a GL account */ public class GLAccountInvalidParentException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java index 1c88da238..157a57d2f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when an error is encountered during - * updating a GL Account + * A {@link RuntimeException} thrown when an error is encountered during updating a GL Account */ public class GLAccountInvalidUpdateException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUsageException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUsageException.java index b13f3fb63..c0996c638 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUsageException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUsageException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when trying to fetch accounts belonging to - * an Invalid Type + * A {@link RuntimeException} thrown when trying to fetch accounts belonging to an Invalid Type */ public class GLAccountInvalidUsageException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/serialization/GLAccountCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/serialization/GLAccountCommandFromApiJsonDeserializer.java index 284e979cb..d960cb29e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/serialization/GLAccountCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/serialization/GLAccountCommandFromApiJsonDeserializer.java @@ -35,8 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link GuarantorCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s. */ @Component public final class GLAccountCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java index 88083f0fe..fd83c9d2c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java @@ -151,8 +151,7 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount } /** - * a detail account cannot be changed to a header account if - * transactions are already logged against it + * a detail account cannot be changed to a header account if transactions are already logged against it **/ if (changesOnly.containsKey(GLAccountJsonInputParams.USAGE.getValue())) { if (glAccount.isHeaderAccount()) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/JournalEntryData.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/JournalEntryData.java index 347ae8802..fd4b5e67f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/JournalEntryData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/JournalEntryData.java @@ -28,8 +28,7 @@ import org.joda.time.LocalDate; /** * Immutable object representing a General Ledger Account * - * Note: no getter/setters required as google will produce json from fields of - * object. + * Note: no getter/setters required as google will produce json from fields of object. */ public class JournalEntryData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntryRepository.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntryRepository.java index 8014c64f8..1ad32c78e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntryRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntryRepository.java @@ -46,13 +46,11 @@ public interface JournalEntryRepository * @Query("select journalEntry from JournalEntry journalEntry where glAccount.id= :accountId and transactionId= :transactionId and transactionDate= :transactionDate" * + * " and type= :journalEntryType and entityType=1 and entityId= :loanId and loanTransaction.id= :loanTransactionId" - * ) JournalEntry findLOANJournalEntryWith(@Param("accountId") Long - * accountId, @Param("transactionId") String transactionId, + * ) JournalEntry findLOANJournalEntryWith(@Param("accountId") Long accountId, @Param("transactionId") String + * transactionId, * - * @Param("transactionDate") Date - * transactionDate, @Param("journalEntryType") Integer journalEntryType, + * @Param("transactionDate") Date transactionDate, @Param("journalEntryType") Integer journalEntryType, * - * @Param("loanId") Long loanId, @Param("loanTransactionId") Long - * loanTransactionId); + * @Param("loanId") Long loanId, @Param("loanTransactionId") Long loanTransactionId); */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/serialization/JournalEntryCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/serialization/JournalEntryCommandFromApiJsonDeserializer.java index d98a5df23..2741eda53 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/serialization/JournalEntryCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/serialization/JournalEntryCommandFromApiJsonDeserializer.java @@ -41,8 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link JournalEntryCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link JournalEntryCommand}'s. */ @Component public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorForSavingsFactory.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorForSavingsFactory.java old mode 100755 new mode 100644 index 13947229b..35e7e219d --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorForSavingsFactory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorForSavingsFactory.java @@ -34,9 +34,8 @@ public class AccountingProcessorForSavingsFactory { } /*** - * Looks like overkill for now, but wanted to keep the savings side of - * accounting identical to that of Loans (would we need an Accrual based - * accounting in the future?) + * Looks like overkill for now, but wanted to keep the savings side of accounting identical to that of Loans (would + * we need an Accrual based accounting in the future?) ***/ public AccountingProcessorForSavings determineProcessor(final SavingsDTO savingsDTO) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java index 700668e3a..b555f74b6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java @@ -338,11 +338,9 @@ public class AccountingProcessorHelper { } /** - * Convenience method that creates a pair of related Debits and Credits for - * Accrual Based accounting. + * Convenience method that creates a pair of related Debits and Credits for Accrual Based accounting. * - * The target accounts for debits and credits are switched in case of a - * reversal + * The target accounts for debits and credits are switched in case of a reversal * * @param office * @param accountTypeToBeDebited @@ -372,11 +370,9 @@ public class AccountingProcessorHelper { } /** - * Convenience method that creates a pair of related Debits and Credits for - * Accrual Based accounting. + * Convenience method that creates a pair of related Debits and Credits for Accrual Based accounting. * - * The target accounts for debits and credits are switched in case of a - * reversal + * The target accounts for debits and credits are switched in case of a reversal * * @param office * office @@ -445,11 +441,9 @@ public class AccountingProcessorHelper { } /** - * Convenience method that creates a pair of related Debits and Credits for - * Cash Based accounting. + * Convenience method that creates a pair of related Debits and Credits for Cash Based accounting. * - * The target accounts for debits and credits are switched in case of a - * reversal + * The target accounts for debits and credits are switched in case of a reversal * * @param office * @param accountTypeToBeDebited @@ -480,11 +474,9 @@ public class AccountingProcessorHelper { } /** - * Convenience method that creates a pair of related Debits and Credits for - * Cash Based accounting. + * Convenience method that creates a pair of related Debits and Credits for Cash Based accounting. * - * The target accounts for debits and credits are switched in case of a - * reversal + * The target accounts for debits and credits are switched in case of a reversal * * @param office * @param accountTypeToBeDebited @@ -535,8 +527,7 @@ public class AccountingProcessorHelper { */ public void checkForBranchClosures(final GLClosure latestGLClosure, final Date transactionDate) { /** - * check if an accounting closure has happened for this branch after the - * transaction Date + * check if an accounting closure has happened for this branch after the transaction Date **/ if (latestGLClosure != null) { if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().equals(transactionDate)) { @@ -573,11 +564,9 @@ public class AccountingProcessorHelper { } /** - * Convenience method that creates a pair of related Debits and Credits for - * Cash Based accounting. + * Convenience method that creates a pair of related Debits and Credits for Cash Based accounting. * - * The target accounts for debits and credits are switched in case of a - * reversal + * The target accounts for debits and credits are switched in case of a reversal * * @param office * @param currencyCode @@ -695,8 +684,7 @@ public class AccountingProcessorHelper { final Date transactionDate, final BigDecimal totalAmount, final Boolean isReversal, final List chargePaymentDTOs) { /*** - * Map to track each account and the net credit to be made for a - * particular account + * Map to track each account and the net credit to be made for a particular account ***/ final Map creditDetailsMap = new LinkedHashMap<>(); for (final ChargePaymentDTO chargePaymentDTO : chargePaymentDTOs) { @@ -736,11 +724,9 @@ public class AccountingProcessorHelper { } /** - * Convenience method that creates a pair of related Debits and Credits for - * Cash Based accounting. + * Convenience method that creates a pair of related Debits and Credits for Cash Based accounting. * - * The target accounts for debits and credits are switched in case of a - * reversal + * The target accounts for debits and credits are switched in case of a reversal * * @param office * office @@ -775,10 +761,9 @@ public class AccountingProcessorHelper { // TODO Vishwas: Remove this validation, as and when appropriate Junit // tests are written for accounting /** - * Accounting module currently supports a single charge per transaction, - * throw an error if this is not the case here so any developers - * changing the expected portfolio behavior would also take care of - * modifying the accounting code appropriately + * Accounting module currently supports a single charge per transaction, throw an error if this is not the case + * here so any developers changing the expected portfolio behavior would also take care of modifying the + * accounting code appropriately **/ if (chargePaymentDTOs.size() != 1) { throw new PlatformDataIntegrityException("Recent Portfolio changes w.r.t Charges for Savings have Broken the accounting code", @@ -1124,9 +1109,8 @@ public class AccountingProcessorHelper { PortfolioProductType.LOAN.getValue(), accountMappingTypeId); /**** - * Get more specific mapping for FUND source accounts (based on - * payment channels). Note that fund source placeholder ID would be - * same for both cash and accrual accounts + * Get more specific mapping for FUND source accounts (based on payment channels). Note that fund source + * placeholder ID would be same for both cash and accrual accounts ***/ if (accountMappingTypeId == CashAccountsForLoan.FUND_SOURCE.getValue()) { final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository @@ -1150,10 +1134,9 @@ public class AccountingProcessorHelper { ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(loanProductId, PortfolioProductType.LOAN.getValue(), accountMappingTypeId); /***** - * Get more specific mappings for Charges and penalties (based on the - * actual charge /penalty coupled with the loan product). Note the - * income from fees and income from penalties placeholder ID would be - * the same for both cash and accrual based accounts + * Get more specific mappings for Charges and penalties (based on the actual charge /penalty coupled with the + * loan product). Note the income from fees and income from penalties placeholder ID would be the same for both + * cash and accrual based accounts *****/ // Vishwas TODO: remove this condition as it should always be true @@ -1174,10 +1157,9 @@ public class AccountingProcessorHelper { ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(savingsProductId, PortfolioProductType.SAVING.getValue(), accountMappingTypeId); /***** - * Get more specific mappings for Charges and penalties (based on the - * actual charge /penalty coupled with the loan product). Note the - * income from fees and income from penalties placeholder ID would be - * the same for both cash and accrual based accounts + * Get more specific mappings for Charges and penalties (based on the actual charge /penalty coupled with the + * loan product). Note the income from fees and income from penalties placeholder ID would be the same for both + * cash and accrual based accounts *****/ // Vishwas TODO: remove this condition as it should always be true @@ -1204,9 +1186,8 @@ public class AccountingProcessorHelper { ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(savingsProductId, PortfolioProductType.SAVING.getValue(), accountMappingTypeId); /**** - * Get more specific mapping for FUND source accounts (based on - * payment channels). Note that fund source placeholder ID would be - * same for both cash and accrual accounts + * Get more specific mapping for FUND source accounts (based on payment channels). Note that fund source + * placeholder ID would be same for both cash and accrual accounts ***/ if (accountMappingTypeId == CashAccountsForSavings.SAVINGS_REFERENCE.getValue()) { final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository @@ -1249,10 +1230,9 @@ public class AccountingProcessorHelper { ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(shareProductId, PortfolioProductType.SHARES.getValue(), accountMappingTypeId); /***** - * Get more specific mappings for Charges and penalties (based on the - * actual charge /penalty coupled with the loan product). Note the - * income from fees and income from penalties placeholder ID would be - * the same for both cash and accrual based accounts + * Get more specific mappings for Charges and penalties (based on the actual charge /penalty coupled with the + * loan product). Note the income from fees and income from penalties placeholder ID would be the same for both + * cash and accrual based accounts *****/ final ProductToGLAccountMapping chargeSpecificIncomeAccountMapping = this.accountMappingRepository @@ -1276,8 +1256,7 @@ public class AccountingProcessorHelper { final Long clientId, final Long transactionId, final Date transactionDate, final Boolean isReversal, final List clientChargePaymentDTOs) { /*** - * Map to track each account affected and the net credit to be made for - * a particular account + * Map to track each account affected and the net credit to be made for a particular account ***/ final Map creditDetailsMap = new LinkedHashMap<>(); for (final ClientChargePaymentDTO clientChargePaymentDTO : clientChargePaymentDTOs) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java index 6f9079ec7..5836042ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java @@ -65,8 +65,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess } /*** - * Handle repayments, repayments at disbursement and reversal of - * Repayments and Repayments at disbursement + * Handle repayments, repayments at disbursement and reversal of Repayments and Repayments at disbursement ***/ else if (loanTransactionDTO.getTransactionType().isRepayment() || loanTransactionDTO.getTransactionType().isRepaymentAtDisbursement() @@ -144,35 +143,27 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess *
*
* - * Principal Repayment: Debits "Fund Source" and Credits "Loan - * Portfolio"
+ * Principal Repayment: Debits "Fund Source" and Credits "Loan Portfolio"
* - * Interest Repayment:Debits "Fund Source" and and Credits - * "Receivable Interest"
+ * Interest Repayment:Debits "Fund Source" and and Credits "Receivable Interest"
* - * Fee Repayment:Debits "Fund Source" (or "Interest on Loans" in case - * of repayment at disbursement) and and Credits "Receivable Fees"
+ * Fee Repayment:Debits "Fund Source" (or "Interest on Loans" in case of repayment at disbursement) and and + * Credits "Receivable Fees"
* - * Penalty Repayment: Debits "Fund Source" and and Credits - * "Receivable Penalties"
+ * Penalty Repayment: Debits "Fund Source" and and Credits "Receivable Penalties"
*
* Handles write offs using the following posting rules
*
- * Principal Write off: Debits "Losses Written Off" and Credits "Loan - * Portfolio"
+ * Principal Write off: Debits "Losses Written Off" and Credits "Loan Portfolio"
* - * Interest Write off:Debits "Losses Written off" and and Credits - * "Receivable Interest"
+ * Interest Write off:Debits "Losses Written off" and and Credits "Receivable Interest"
* - * Fee Write off:Debits "Losses Written off" and and Credits - * "Receivable Fees"
+ * Fee Write off:Debits "Losses Written off" and and Credits "Receivable Fees"
* - * Penalty Write off: Debits "Losses Written off" and and Credits - * "Receivable Penalties"
+ * Penalty Write off: Debits "Losses Written off" and and Credits "Receivable Penalties"
*
*
- * In case the loan transaction has been reversed, all debits are turned - * into credits and vice versa + * In case the loan transaction has been reversed, all debits are turned into credits and vice versa * * @param loanTransactionDTO * @param loanDTO @@ -289,8 +280,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess } /** - * Single DEBIT transaction for write-offs or Repayments (and their - * reversals) + * Single DEBIT transaction for write-offs or Repayments (and their reversals) ***/ if (!(totalDebitAmount.compareTo(BigDecimal.ZERO) == 0)) { if (writeOff) { @@ -315,11 +305,9 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess } /** - * Create a single Debit to fund source and a single credit to "Income from - * Recovery" + * Create a single Debit to fund source and a single credit to "Income from Recovery" * - * In case the loan transaction is a reversal, all debits are turned into - * credits and vice versa + * In case the loan transaction is a reversal, all debits are turned into credits and vice versa */ private void createJournalEntriesForRecoveryRepayments(final LoanDTO loanDTO, final LoanTransactionDTO loanTransactionDTO, final Office office) { @@ -345,11 +333,9 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess * Recognize the receivable interest
* Debit "Interest Receivable" and Credit "Income from Interest" * - * Fees: Debit Fees Receivable and credit Income from - * Fees
+ * Fees: Debit Fees Receivable and credit Income from Fees
* - * Penalties: Debit Penalties Receivable and credit Income - * from Penalties + * Penalties: Debit Penalties Receivable and credit Income from Penalties * * Also handles reversals for both fees and payment applications * diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForClientTransactions.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForClientTransactions.java index 4f240690a..e21759224 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForClientTransactions.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForClientTransactions.java @@ -52,11 +52,10 @@ public class CashBasedAccountingProcessorForClientTransactions implements Accoun } /** - * Create a single debit to fund source and multiple credits for the income - * account mapped with each charge this payment pays off + * Create a single debit to fund source and multiple credits for the income account mapped with each charge this + * payment pays off * - * In case the loan transaction is a reversal, all debits are turned into - * credits and vice versa + * In case the loan transaction is a reversal, all debits are turned into credits and vice versa */ private void createJournalEntriesForChargePayments(final ClientTransactionDTO clientTransactionDTO, final Office office) { // client properties @@ -74,9 +73,8 @@ public class CashBasedAccountingProcessorForClientTransactions implements Accoun transactionId, transactionDate, isReversal, clientTransactionDTO.getChargePayments()); /*** - * create a single Debit entry (or reversal) for the entire amount - * that was credited (accounting is turned on at the level of for - * each charge that has been paid by this transaction) + * create a single Debit entry (or reversal) for the entire amount that was credited (accounting is turned + * on at the level of for each charge that has been paid by this transaction) **/ this.helper.createDebitJournalEntryOrReversalForClientChargePayments(office, currencyCode, clientId, transactionId, transactionDate, totalCreditedAmount, isReversal); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java index 22c42d246..bd7d0a31d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java @@ -63,8 +63,8 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF createJournalEntriesForDisbursements(loanDTO, loanTransactionDTO, office); } /*** - * Logic for repayments, repayments at disbursement and reversal of - * Repayments and Repayments at disbursement + * Logic for repayments, repayments at disbursement and reversal of Repayments and Repayments at + * disbursement ***/ else if (loanTransactionDTO.getTransactionType().isRepayment() || loanTransactionDTO.getTransactionType().isRepaymentAtDisbursement() @@ -82,9 +82,8 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF createJournalEntriesForRefund(loanDTO, loanTransactionDTO, office); } /*** - * Only principal write off affects cash based accounting (interest - * and fee write off need not be considered). Debit losses written - * off and credit Loan Portfolio + * Only principal write off affects cash based accounting (interest and fee write off need not be + * considered). Debit losses written off and credit Loan Portfolio **/ else if (loanTransactionDTO.getTransactionType().isWriteOff()) { final BigDecimal principalAmount = loanTransactionDTO.getPrincipal(); @@ -109,8 +108,7 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF /** * Debit loan Portfolio and credit Fund source for a Disbursement
* - * All debits are turned into credits and vice versa in case of disbursement - * reversals + * All debits are turned into credits and vice versa in case of disbursement reversals * * * @param loanDTO @@ -149,8 +147,7 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF /** * Debit loan Portfolio and credit Fund source for a Disbursement
* - * All debits are turned into credits and vice versa in case of disbursement - * reversals + * All debits are turned into credits and vice versa in case of disbursement reversals * * * @param loanDTO @@ -182,13 +179,11 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF } /** - * Create a single Debit to fund source and multiple credits if applicable - * (loan portfolio for principal repayments, Interest on loans for interest - * repayments, Income from fees for fees payment and Income from penalties - * for penalty payment) + * Create a single Debit to fund source and multiple credits if applicable (loan portfolio for principal repayments, + * Interest on loans for interest repayments, Income from fees for fees payment and Income from penalties for + * penalty payment) * - * In case the loan transaction is a reversal, all debits are turned into - * credits and vice versa + * In case the loan transaction is a reversal, all debits are turned into credits and vice versa */ private void createJournalEntriesForRepayments(final LoanDTO loanDTO, final LoanTransactionDTO loanTransactionDTO, final Office office) { @@ -256,11 +251,9 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF } /** - * Create a single Debit to fund source and a single credit to "Income from - * Recovery" + * Create a single Debit to fund source and a single credit to "Income from Recovery" * - * In case the loan transaction is a reversal, all debits are turned into - * credits and vice versa + * In case the loan transaction is a reversal, all debits are turned into credits and vice versa */ private void createJournalEntriesForRecoveryRepayments(final LoanDTO loanDTO, final LoanTransactionDTO loanTransactionDTO, final Office office) { @@ -283,12 +276,10 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF } /** - * Credit loan Portfolio and Debit Suspense Account for a Transfer - * Initiation. A Transfer acceptance would be treated the opposite i.e Debit - * Loan Portfolio and Credit Suspense Account
+ * Credit loan Portfolio and Debit Suspense Account for a Transfer Initiation. A Transfer acceptance would be + * treated the opposite i.e Debit Loan Portfolio and Credit Suspense Account
* - * All debits are turned into credits and vice versa in case of Transfer - * Initiation disbursals + * All debits are turned into credits and vice versa in case of Transfer Initiation disbursals * * * @param loanDTO diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java index 6d57f7a6b..746ffe6e6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java @@ -146,8 +146,7 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal); } /** - * Handle Interest Applications and reversals of Interest - * Applications + * Handle Interest Applications and reversals of Interest Applications **/ else if (savingsTransactionDTO.getTransactionType().isInterestPosting() && savingsTransactionDTO.isOverdraftTransaction()) { // Post journal entry if earned interest amount is greater than diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java index c121fd642..15295e0ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java @@ -226,8 +226,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa private void validateDebitOrCreditArrayForExistingGLAccount(final GLAccount glaccount, final SingleDebitOrCreditEntryCommand[] creditOrDebits) { /** - * If a glaccount is assigned for a rule the credits or debits array - * should have only one entry and it must be same as existing account + * If a glaccount is assigned for a rule the credits or debits array should have only one entry and it must be + * same as existing account */ if (creditOrDebits.length != 1) { throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.INVALID_DEBIT_OR_CREDIT_ACCOUNTS, null, null, null); @@ -305,8 +305,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa private void validateGLAccountForTransaction(final GLAccount creditOrDebitAccountHead) { /*** - * validate that the account allows manual adjustments and is not - * disabled + * validate that the account allows manual adjustments and is not disabled **/ if (creditOrDebitAccountHead.isDisabled()) { throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.GL_ACCOUNT_DISABLED, null, @@ -644,8 +643,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa } /** - * TODO: Need a better implementation with guaranteed uniqueness (but not a - * long UUID)...maybe something tied to system clock.. + * TODO: Need a better implementation with guaranteed uniqueness (but not a long UUID)...maybe something tied to + * system clock.. */ private String generateTransactionId(final Long officeId) { final AppUser user = this.context.authenticatedUser(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingInvalidException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingInvalidException.java index acc074034..1d6717be5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingInvalidException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingInvalidException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.producttoaccountmapping.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when product to GL account mapping are not - * found. + * A {@link RuntimeException} thrown when product to GL account mapping are not found. */ public class ProductToGLAccountMappingInvalidException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingNotFoundException.java index 35541be0d..7ea65125e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/exception/ProductToGLAccountMappingNotFoundException.java @@ -22,8 +22,7 @@ import org.apache.fineract.accounting.producttoaccountmapping.domain.PortfolioPr import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when product to GL account mapping are not - * found. + * A {@link RuntimeException} thrown when product to GL account mapping are not found. */ public class ProductToGLAccountMappingNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java index 67f12f294..e53fb6059 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java @@ -47,25 +47,21 @@ import org.springframework.stereotype.Component; /** * TODO Vishwas find a better approach for validation * - * Currently, validation of the passed in JSON is done before calling save or - * update method on the target resource (in our case the loan Product) + * Currently, validation of the passed in JSON is done before calling save or update method on the target resource (in + * our case the loan Product) * - * However, in the case of a loan product it would be difficult to validate the - * passed in JSON for valid {@link LoanProduct} to {@link GLAccount} mappings - * during update because of the following scenario + * However, in the case of a loan product it would be difficult to validate the passed in JSON for valid + * {@link LoanProduct} to {@link GLAccount} mappings during update because of the following scenario * - * The accounting rule type may be changed in the update command, so we would - * have to validate if all required account heads for a particular account type - * have been passed in (would be different for CASH and Accrual based). However, - * till we have access to the domain object it would not be possible to detect - * if an accounting rule has actually been changed + * The accounting rule type may be changed in the update command, so we would have to validate if all required account + * heads for a particular account type have been passed in (would be different for CASH and Accrual based). However, + * till we have access to the domain object it would not be possible to detect if an accounting rule has actually been + * changed * - * Hence, method {@link #validateForLoanProductCreate(String)} from this class - * is called separately for validation only if an accounting rule change is - * detected by {@link ProductToGLAccountMappingWritePlatformService} + * Hence, method {@link #validateForLoanProductCreate(String)} from this class is called separately for validation only + * if an accounting rule change is detected by {@link ProductToGLAccountMappingWritePlatformService} * - * Also, the class is probably named wrong (*FromApiJsonDeserializer) should - * probably be named as (*Validator) instead + * Also, the class is probably named wrong (*FromApiJsonDeserializer) should probably be named as (*Validator) instead * */ @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java index 8e6f2f59b..9dd074e89 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java @@ -212,8 +212,7 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi } /** - * Examines and updates each account mapping for given loan product with - * changes passed in from the Json element + * Examines and updates each account mapping for given loan product with changes passed in from the Json element * * @param loanProductId * @param changes diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java index d8c9fba3a..2db50c55f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java @@ -127,8 +127,8 @@ public class ProductToGLAccountMappingHelper { } /** - * Saves the payment type to Fund source mappings for a particular - * product/product type (also populates the changes array if passed in) + * Saves the payment type to Fund source mappings for a particular product/product type (also populates the changes + * array if passed in) * * @param command * @param element @@ -154,8 +154,8 @@ public class ProductToGLAccountMappingHelper { } /** - * Saves the Charge to Income / Liability account mappings for a particular - * product/product type (also populates the changes array if passed in) + * Saves the Charge to Income / Liability account mappings for a particular product/product type (also populates the + * changes array if passed in) * * @param command * @param element @@ -210,14 +210,12 @@ public class ProductToGLAccountMappingHelper { final JsonArray chargeToIncomeAccountMappingArray = this.fromApiJsonHelper.extractJsonArrayNamed(arrayFragmentName, element); /** - * Variable stores a map representation of charges (key) and their - * associated income Id's (value) extracted from the passed in - * Jsoncommand + * Variable stores a map representation of charges (key) and their associated income Id's (value) extracted from + * the passed in Jsoncommand **/ final Map inputChargeToIncomeAccountMap = new HashMap<>(); /*** - * Variable stores all charges which have already been mapped to Income - * Accounts in the system + * Variable stores all charges which have already been mapped to Income Accounts in the system **/ final Set existingCharges = new HashSet<>(); if (chargeToIncomeAccountMappingArray != null) { @@ -238,10 +236,8 @@ public class ProductToGLAccountMappingHelper { } /** * Else,
* update existing mappings OR
- * delete old mappings (which are already present, but not passed - * in as a part of Jsoncommand)
- * Create new mappings for charges that are passed in as a part of - * the Jsoncommand but not already present + * delete old mappings (which are already present, but not passed in as a part of Jsoncommand)
+ * Create new mappings for charges that are passed in as a part of the Jsoncommand but not already present * **/ else { @@ -296,13 +292,12 @@ public class ProductToGLAccountMappingHelper { final JsonArray paymentChannelMappingArray = this.fromApiJsonHelper .extractJsonArrayNamed(LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), element); /** - * Variable stores a map representation of Payment channels (key) and - * their fund sources (value) extracted from the passed in Jsoncommand + * Variable stores a map representation of Payment channels (key) and their fund sources (value) extracted from + * the passed in Jsoncommand **/ final Map inputPaymentChannelFundSourceMap = new HashMap<>(); /*** - * Variable stores all payment types which have already been mapped to - * Fund Sources in the system + * Variable stores all payment types which have already been mapped to Fund Sources in the system **/ final Set existingPaymentTypes = new HashSet<>(); if (paymentChannelMappingArray != null) { @@ -324,10 +319,9 @@ public class ProductToGLAccountMappingHelper { } /** * Else,
* update existing mappings OR
- * delete old mappings (which re already present, but not passed - * in as a part of Jsoncommand)
- * Create new mappings for payment types that are passed in as a - * part of the Jsoncommand but not already present + * delete old mappings (which re already present, but not passed in as a part of Jsoncommand)
+ * Create new mappings for payment types that are passed in as a part of the Jsoncommand but not already + * present * **/ else { @@ -388,8 +382,7 @@ public class ProductToGLAccountMappingHelper { GLAccount glAccount; /** - * Both CASH and Accrual placeholders have the same value for income - * from Interest and penalties + * Both CASH and Accrual placeholders have the same value for income from Interest and penalties **/ CashAccountsForLoan placeHolderAccountType; if (isPenalty) { @@ -415,8 +408,8 @@ public class ProductToGLAccountMappingHelper { } /** - * Fetches account with a particular Id and throws and Exception it is not - * of the expected Account Category ('ASSET','liability' etc) + * Fetches account with a particular Id and throws and Exception it is not of the expected Account Category + * ('ASSET','liability' etc) * * @param paramName * @param expectedAccountType diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java index 8d87f3f81..a745a280d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java @@ -288,16 +288,15 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc public Map updateLoanProductToGLAccountMapping(final Long loanProductId, final JsonCommand command, final boolean accountingRuleChanged, final int accountingRuleTypeId) { /*** - * Variable tracks all accounting mapping properties that have been - * updated + * Variable tracks all accounting mapping properties that have been updated ***/ Map changes = new HashMap<>(); final JsonElement element = this.fromApiJsonHelper.parse(command.json()); final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId); /*** - * If the accounting rule has been changed, delete all existing mapping - * for the product and recreate a new set of mappings + * If the accounting rule has been changed, delete all existing mapping for the product and recreate a new set + * of mappings ***/ if (accountingRuleChanged) { this.deserializer.validateForLoanProductCreate(command.json()); @@ -319,16 +318,15 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc public Map updateSavingsProductToGLAccountMapping(final Long savingsProductId, final JsonCommand command, final boolean accountingRuleChanged, final int accountingRuleTypeId, final DepositAccountType accountType) { /*** - * Variable tracks all accounting mapping properties that have been - * updated + * Variable tracks all accounting mapping properties that have been updated ***/ Map changes = new HashMap<>(); final JsonElement element = this.fromApiJsonHelper.parse(command.json()); final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId); /*** - * If the accounting rule has been changed, delete all existing mapping - * for the product and recreate a new set of mappings + * If the accounting rule has been changed, delete all existing mapping for the product and recreate a new set + * of mappings ***/ if (accountingRuleChanged) { this.deserializer.validateForSavingsProductCreate(command.json(), accountType); @@ -351,16 +349,15 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc public Map updateShareProductToGLAccountMapping(final Long shareProductId, final JsonCommand command, final boolean accountingRuleChanged, final int accountingRuleTypeId) { /*** - * Variable tracks all accounting mapping properties that have been - * updated + * Variable tracks all accounting mapping properties that have been updated ***/ Map changes = new HashMap<>(); final JsonElement element = this.fromApiJsonHelper.parse(command.json()); final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId); /*** - * If the accounting rule has been changed, delete all existing mapping - * for the product and recreate a new set of mappings + * If the accounting rule has been changed, delete all existing mapping for the product and recreate a new set + * of mappings ***/ if (accountingRuleChanged) { this.shareProductToGLAccountMappingHelper.deleteSharesProductToGLAccountMapping(shareProductId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java index 0fd9f9e28..37a4dc8f0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java @@ -177,8 +177,7 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa } /** - * Examines and updates each account mapping for given loan product with - * changes passed in from the Json element + * Examines and updates each account mapping for given loan product with changes passed in from the Json element * * @param savingsProductId * @param changes diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java index be609103c..0ec048330 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java @@ -154,8 +154,7 @@ public class ShareProductToGLAccountMappingHelper extends ProductToGLAccountMapp } /** - * Examines and updates each account mapping for given loan product with - * changes passed in from the Json element + * Examines and updates each account mapping for given loan product with changes passed in from the Json element * * @param sharesProductId * @param changes diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/data/AccountingRuleData.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/data/AccountingRuleData.java index 655e60888..70cc8e7f6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/data/AccountingRuleData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/data/AccountingRuleData.java @@ -29,8 +29,7 @@ import org.apache.fineract.organisation.office.data.OfficeData; /** * Immutable object representing a General Ledger Account * - * Note: no getter/setters required as google-gson will produce json from fields - * of object. + * Note: no getter/setters required as google-gson will produce json from fields of object. */ public class AccountingRuleData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleDuplicateException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleDuplicateException.java index 7cd76a28f..6bc678f07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleDuplicateException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleDuplicateException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.rule.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when an Accounting rule with a given name - * already exists + * A {@link RuntimeException} thrown when an Accounting rule with a given name already exists */ public class AccountingRuleDuplicateException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java index 293679931..0768b46a3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.accounting.rule.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when Accounting rule resources are not - * found. + * A {@link RuntimeException} thrown when Accounting rule resources are not found. */ public class AccountingRuleNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java index 4bf684207..5daf44e6c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java @@ -59,8 +59,7 @@ import org.springframework.stereotype.Component; public class AdHocApiResource { /** - * The set of parameters that are supported in response for - * {@link AdhocData} + * The set of parameters that are supported in response for {@link AdhocData} */ private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "query", "tableName", "tableField", "isActive", "createdBy", "createdOn", "createdById", "updatedById", "updatedOn", "email")); diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocDataValidator.java index bdf513e27..08930ea4d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocDataValidator.java @@ -139,12 +139,9 @@ public final class AdHocDataValidator { baseDataValidator.reset().parameter("reportRunEvery").value(reportRunEvery).integerGreaterThanZero(); } /* - * if (this.fromApiJsonHelper.parameterExists("isActive", element)) { - * final Integer isActive = - * this.fromApiJsonHelper.extractIntegerNamed("isActive", element, - * Locale.getDefault()); - * baseDataValidator.reset().parameter("isActive").value(isActive). - * notNull().inMinMaxRange(1, 2); } + * if (this.fromApiJsonHelper.parameterExists("isActive", element)) { final Integer isActive = + * this.fromApiJsonHelper.extractIntegerNamed("isActive", element, Locale.getDefault()); + * baseDataValidator.reset().parameter("isActive").value(isActive). notNull().inMinMaxRange(1, 2); } */ throwExceptionIfValidationWarningsExist(dataValidationErrors); diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java index beeefa9ee..cd5861276 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java @@ -73,8 +73,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final DataIntegrityViolationException dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java index 3a7ecd668..2cf855314 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java @@ -50,12 +50,10 @@ import org.springframework.stereotype.Component; /** * Provides a REST resource for Batch Requests. This class acts as a proxy to - * {@link org.apache.fineract.batch.service.BatchApiService} and de-serializes - * the incoming JSON string to a list of - * {@link org.apache.fineract.batch.domain .BatchRequest} type. This list is - * forwarded to BatchApiService which finally returns a list of - * {@link org.apache.fineract.batch.domain.BatchResponse} type which is then - * serialized into JSON response by this Resource class. + * {@link org.apache.fineract.batch.service.BatchApiService} and de-serializes the incoming JSON string to a list of + * {@link org.apache.fineract.batch.domain .BatchRequest} type. This list is forwarded to BatchApiService which finally + * returns a list of {@link org.apache.fineract.batch.domain.BatchResponse} type which is then serialized into JSON + * response by this Resource class. * * @author Rishabh Shukla * @@ -83,8 +81,7 @@ public class BatchApiResource { private final BatchRequestJsonHelper batchRequestJsonHelper; /** - * Constructs a 'BatchApiService' with context, toApiJsonSerializer, service - * and batchRequestJsonHelper. + * Constructs a 'BatchApiService' with context, toApiJsonSerializer, service and batchRequestJsonHelper. * * @param context * @param toApiJsonSerializer @@ -102,8 +99,7 @@ public class BatchApiResource { } /** - * Rest assured POST method to get {@link BatchRequest} and returns back the - * consolidated {@link BatchResponse} + * Rest assured POST method to get {@link BatchRequest} and returns back the consolidated {@link BatchResponse} * * @param jsonRequestString * @param enclosingTransaction diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandContext.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandContext.java index 5ee2dc361..010943a57 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandContext.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandContext.java @@ -19,10 +19,8 @@ package org.apache.fineract.batch.command; /** - * Provides an object to - * {@link org.apache.fineract.batch.service.BatchApiService} to get the proper - * commandStrategy for each request in BatchRequest. It uses Builder pattern to - * create object of this type. + * Provides an object to {@link org.apache.fineract.batch.service.BatchApiService} to get the proper commandStrategy for + * each request in BatchRequest. It uses Builder pattern to create object of this type. * * @author Rishabh Shukla * @@ -69,9 +67,8 @@ public final class CommandContext { } /** - * Returns a boolean value if the relativeUrl 'matches' one of the regex - * keys in the available commandStrategies. It take CommandContext object as - * parameter which contains a 'resource' member as a regex key for available + * Returns a boolean value if the relativeUrl 'matches' one of the regex keys in the available commandStrategies. It + * take CommandContext object as parameter which contains a 'resource' member as a regex key for available * commandStrategies. * * @param other diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategy.java index 01fa6edfc..62cf78903 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategy.java @@ -23,8 +23,8 @@ import org.apache.fineract.batch.domain.BatchRequest; import org.apache.fineract.batch.domain.BatchResponse; /** - * An interface for various Command Strategies. It contains a single function - * which returns appropriate response from a particular command strategy. + * An interface for various Command Strategies. It contains a single function which returns appropriate response from a + * particular command strategy. * * @author Rishabh Shukla * @@ -33,10 +33,8 @@ import org.apache.fineract.batch.domain.BatchResponse; public interface CommandStrategy { /** - * Returns an object of type - * {@link org.apache.fineract.batch.domain.BatchResponse}. This takes - * {@link org.apache.fineract.batch.domain.BatchRequest} as it's single - * argument and provides appropriate response. + * Returns an object of type {@link org.apache.fineract.batch.domain.BatchResponse}. This takes + * {@link org.apache.fineract.batch.domain.BatchRequest} as it's single argument and provides appropriate response. * * @param batchRequest * @param uriInfo diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java index 4aa4301cd..47877d7d1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java @@ -25,8 +25,8 @@ import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; /** - * Provides an appropriate CommandStrategy using the 'method' and 'resourceUrl'. - * CommandStrategy bean is created using Spring Application Context. + * Provides an appropriate CommandStrategy using the 'method' and 'resourceUrl'. CommandStrategy bean is created using + * Spring Application Context. * * @author Rishabh Shukla * @@ -39,9 +39,8 @@ public class CommandStrategyProvider { private final ConcurrentHashMap commandStrategies = new ConcurrentHashMap<>(); /** - * Constructs a CommandStrategyProvider with argument of ApplicationContext - * type. It also initialize commandStrategies using init() function by - * filling it with available CommandStrategies in + * Constructs a CommandStrategyProvider with argument of ApplicationContext type. It also initialize + * commandStrategies using init() function by filling it with available CommandStrategies in * {@link org.apache.fineract.batch.command.internal}. * * @param applicationContext @@ -56,9 +55,8 @@ public class CommandStrategyProvider { } /** - * Returns an appropriate commandStrategy after determining it using the - * CommandContext of the request. If no such Strategy is found then a - * default strategy is returned back. + * Returns an appropriate commandStrategy after determining it using the CommandContext of the request. If no such + * Strategy is found then a default strategy is returned back. * * @param commandContext * @return CommandStrategy @@ -80,10 +78,8 @@ public class CommandStrategyProvider { } /** - * Contains various available command strategies in - * {@link org.apache.fineract.batch.command.internal}. Any new command - * Strategy will have to be added within this function in order to initiate - * it within the constructor. + * Contains various available command strategies in {@link org.apache.fineract.batch.command.internal}. Any new + * command Strategy will have to be added within this function in order to initiate it within the constructor. */ private void init() { this.commandStrategies.put(CommandContext.resource("clients").method("POST").build(), "createClientCommandStrategy"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ActivateClientCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ActivateClientCommandStrategy.java index 1d8dadff2..934641ee8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ActivateClientCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ActivateClientCommandStrategy.java @@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to - * handle activation of a pending client. It passes the contents of the body - * from the BatchRequest to - * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets - * back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map - * those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle activation of a pending client. It + * passes the contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets back the response. This class will also + * catch any errors raised by {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map those errors + * to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplyLoanCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplyLoanCommandStrategy.java index 49142b2de..5d5b1b851 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplyLoanCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplyLoanCommandStrategy.java @@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and - * applies a new loan on an existing client. It passes the contents of the body - * from the BatchRequest to - * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and - * gets back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and - * map those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and applies a new loan on an existing client. It + * passes the contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and gets back the response. This class will + * also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and map those + * errors to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplySavingsCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplySavingsCommandStrategy.java index 042a5e9a1..e7a5df0ea 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplySavingsCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApplySavingsCommandStrategy.java @@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and - * applies a new savings on an existing client. It passes the contents of the - * body from the BatchRequest to - * {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource} - * and gets back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource} - * and map those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and applies a new savings on an existing client. + * It passes the contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource} and gets back the response. This class + * will also catch any errors raised by {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource} and + * map those errors to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApproveLoanCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApproveLoanCommandStrategy.java index 5b5ad34c3..111e1f720 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApproveLoanCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/ApproveLoanCommandStrategy.java @@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to - * handle approval of a pending loan. It passes the contents of the body from - * the BatchRequest to - * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and - * gets back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and - * map those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle approval of a pending loan. It passes + * the contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and gets back the response. This class will + * also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and map those + * errors to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CollectChargesCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CollectChargesCommandStrategy.java index 197d6dde2..4fdebcccd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CollectChargesCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CollectChargesCommandStrategy.java @@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and - * Collect Charges for a Loan. It passes the contents of the body from the - * BatchRequest to - * {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} - * and gets back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} - * and map those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and Collect Charges for a Loan. It passes the + * contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and gets back the response. This class + * will also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and + * map those errors to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateChargeCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateChargeCommandStrategy.java index 39b186750..479f02d63 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateChargeCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateChargeCommandStrategy.java @@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and - * Create Charge for a Loan. It passes the contents of the body from the - * BatchRequest to - * {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} - * and gets back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} - * and map those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and Create Charge for a Loan. It passes the + * contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and gets back the response. This class + * will also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and + * map those errors to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateClientCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateClientCommandStrategy.java index d599212d7..400258964 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateClientCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/CreateClientCommandStrategy.java @@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to - * handle creation of a new client. It passes the contents of the body from the - * BatchRequest to - * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets - * back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map - * those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle creation of a new client. It passes + * the contents of the body from the BatchRequest to {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} + * and gets back the response. This class will also catch any errors raised by + * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map those errors to appropriate status codes + * in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/DisburseLoanCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/DisburseLoanCommandStrategy.java index f9074c1ca..0ac7d829f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/DisburseLoanCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/DisburseLoanCommandStrategy.java @@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to - * handle disburse of a loan. It passes the contents of the body from the - * BatchRequest to - * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and - * gets back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and - * map those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle disburse of a loan. It passes the + * contents of the body from the BatchRequest to {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} + * and gets back the response. This class will also catch any errors raised by + * {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and map those errors to appropriate status + * codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/RepayLoanCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/RepayLoanCommandStrategy.java index f0b0194f6..65c88010f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/RepayLoanCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/RepayLoanCommandStrategy.java @@ -31,11 +31,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link CommandStrategy} and handles repayment for a Loan. It - * passes the contents of the body from the BatchRequest to - * {@link LoanTransactionsApiResource} and gets back the response. This class - * will also catch any errors raised by {@link LoanTransactionsApiResource} and - * map those errors to appropriate status codes in BatchResponse. + * Implements {@link CommandStrategy} and handles repayment for a Loan. It passes the contents of the body from the + * BatchRequest to {@link LoanTransactionsApiResource} and gets back the response. This class will also catch any errors + * raised by {@link LoanTransactionsApiResource} and map those errors to appropriate status codes in BatchResponse. * * @author Mohit Sinha * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UnknownCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UnknownCommandStrategy.java index d19dc5d25..e76857dcd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UnknownCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UnknownCommandStrategy.java @@ -25,9 +25,8 @@ import org.apache.fineract.batch.domain.BatchResponse; import org.springframework.stereotype.Component; /** - * Provides a default CommandStrategy by implementing - * {@link org.apache.fineract.batch.command.CommandStrategy} in case there is no - * appropriate command strategy with requested 'method' and 'resoureUrl'. + * Provides a default CommandStrategy by implementing {@link org.apache.fineract.batch.command.CommandStrategy} in case + * there is no appropriate command strategy with requested 'method' and 'resoureUrl'. * * @author Rishabh Shukla */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UpdateClientCommandStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UpdateClientCommandStrategy.java index 470a63e5c..e09ea4c4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UpdateClientCommandStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/internal/UpdateClientCommandStrategy.java @@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and - * updates the information of an existing client. It passes the contents of the - * body from the BatchRequest to - * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets - * back the response. This class will also catch any errors raised by - * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map - * those errors to appropriate status codes in BatchResponse. + * Implements {@link org.apache.fineract.batch.command.CommandStrategy} and updates the information of an existing + * client. It passes the contents of the body from the BatchRequest to + * {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets back the response. This class will also + * catch any errors raised by {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map those errors + * to appropriate status codes in BatchResponse. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchRequest.java b/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchRequest.java index b5a48ecc1..c172cd64a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchRequest.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchRequest.java @@ -21,10 +21,9 @@ package org.apache.fineract.batch.domain; import java.util.Set; /** - * Provides an object for separate HTTP requests in the Batch Request for Batch - * API. A requestId is also included as data field which takes care of - * dependency issues among various requests. This class also provides getter and - * setter functions to access Batch Request data fields. + * Provides an object for separate HTTP requests in the Batch Request for Batch API. A requestId is also included as + * data field which takes care of dependency issues among various requests. This class also provides getter and setter + * functions to access Batch Request data fields. * * @author Rishabh Shukla * @@ -41,8 +40,8 @@ public class BatchRequest { private String body; /** - * Constructs a 'BatchRequest' with requestId, relativeUrl, method, headers, - * reference and body of the incoming request. + * Constructs a 'BatchRequest' with requestId, relativeUrl, method, headers, reference and body of the incoming + * request. * * @param requestId * of HTTP request. @@ -131,8 +130,7 @@ public class BatchRequest { } /** - * Returns the values of 'headers' of {@link Header} type of an object of - * this class. + * Returns the values of 'headers' of {@link Header} type of an object of this class. * * @return headers of the HTTP request. * @see Header @@ -142,8 +140,7 @@ public class BatchRequest { } /** - * Sets the values of 'headers' of {@link Header} type of an object of this - * class. + * Sets the values of 'headers' of {@link Header} type of an object of this class. * * @param headers * @see Header diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchResponse.java b/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchResponse.java index faf83b649..73cbb8bf7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchResponse.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/domain/BatchResponse.java @@ -21,10 +21,9 @@ package org.apache.fineract.batch.domain; import java.util.Set; /** - * Provides an object for separate HTTP responses in the Batch Response for - * Batch API. It contains all the information about a particular HTTP response - * in the Batch Response. Getter and Setter functions are also included to - * access response data fields. + * Provides an object for separate HTTP responses in the Batch Response for Batch API. It contains all the information + * about a particular HTTP response in the Batch Response. Getter and Setter functions are also included to access + * response data fields. * * @author Rishabh Shukla * @@ -40,8 +39,7 @@ public class BatchResponse { private String body; /** - * Constructs a 'BatchResponse' with requestId, statusCode, headers and body - * of the HTTP requests. + * Constructs a 'BatchResponse' with requestId, statusCode, headers and body of the HTTP requests. * * @param requestId * @param statusCode @@ -110,8 +108,7 @@ public class BatchResponse { } /** - * Sets the value of 'headers' of {@link Header} type of an object of this - * class. + * Sets the value of 'headers' of {@link Header} type of an object of this class. * * @param headers * of {@link Header} Type diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/domain/Header.java b/fineract-provider/src/main/java/org/apache/fineract/batch/domain/Header.java index a3c029efe..48b61c6ba 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/domain/Header.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/domain/Header.java @@ -19,9 +19,8 @@ package org.apache.fineract.batch.domain; /** - * Provides an object to handle HTTP headers as name and value pairs for Batch - * API. It is used in {@link BatchRequest} and {@link BatchResponse} to store - * the information regarding the headers in incoming and outgoing JSON Strings. + * Provides an object to handle HTTP headers as name and value pairs for Batch API. It is used in {@link BatchRequest} + * and {@link BatchResponse} to store the information regarding the headers in incoming and outgoing JSON Strings. * * @author Rishabh Shukla * diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java b/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java index 9bf21ea61..df4d37b0c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java @@ -38,11 +38,9 @@ import org.springframework.dao.NonTransientDataAccessException; import org.springframework.transaction.TransactionException; /** - * Provides an Error Handler method that returns an object of type - * {@link ErrorInfo} to the CommandStrategy which raised the exception. This - * class uses various subclasses of RuntimeException to check the kind of - * exception raised and provide appropriate status and error codes for each one - * of the raised exception. + * Provides an Error Handler method that returns an object of type {@link ErrorInfo} to the CommandStrategy which raised + * the exception. This class uses various subclasses of RuntimeException to check the kind of exception raised and + * provide appropriate status and error codes for each one of the raised exception. * * @author Rishabh Shukla * @@ -61,8 +59,7 @@ public class ErrorHandler extends RuntimeException { } /** - * Returns an object of ErrorInfo type containing the information regarding - * the raised error. + * Returns an object of ErrorInfo type containing the information regarding the raised error. * * @param exception * @return ErrorInfo diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorInfo.java b/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorInfo.java index f1d34f003..f9d79913d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorInfo.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorInfo.java @@ -19,8 +19,7 @@ package org.apache.fineract.batch.exception; /** - * Provides members to hold the basic information about the exceptions raised in - * commandStrategy classes. + * Provides members to hold the basic information about the exceptions raised in commandStrategy classes. * * @author Rishabh Shukla * @@ -90,8 +89,7 @@ public final class ErrorInfo { } /** - * Getter method to provide the message of the error for an object of this - * type. + * Getter method to provide the message of the error for an object of this type. * * @return String */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/serialization/BatchRequestJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/batch/serialization/BatchRequestJsonHelper.java index d2067650b..42071bb0f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/serialization/BatchRequestJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/serialization/BatchRequestJsonHelper.java @@ -26,10 +26,8 @@ import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; import org.springframework.stereotype.Component; /** - * Extends - * {@link org.apache.fineract.infrastructure.core.serialization.FromJsonHelper} - * to de-serialize the incoming String into a JSON List of type - * {@link org.apache.fineract.batch.domain.BatchRequest} + * Extends {@link org.apache.fineract.infrastructure.core.serialization.FromJsonHelper} to de-serialize the incoming + * String into a JSON List of type {@link org.apache.fineract.batch.domain.BatchRequest} * * @author Rishabh Shukla * @@ -40,8 +38,7 @@ import org.springframework.stereotype.Component; public class BatchRequestJsonHelper extends FromJsonHelper { /** - * Returns a list of batchRequests after de-serializing it from the input - * JSON string. + * Returns a list of batchRequests after de-serializing it from the input JSON string. * * @param json * @return List<BatchRequest> diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiService.java b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiService.java index e9d83f88f..ea387f007 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiService.java @@ -24,8 +24,7 @@ import org.apache.fineract.batch.domain.BatchRequest; import org.apache.fineract.batch.domain.BatchResponse; /** - * Provides an interface for service class, that implements the method to handle - * separate Batch Requests. + * Provides an interface for service class, that implements the method to handle separate Batch Requests. * * @author Rishabh Shukla * @@ -36,10 +35,9 @@ import org.apache.fineract.batch.domain.BatchResponse; public interface BatchApiService { /** - * Returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s - * by getting the appropriate CommandStrategy for every - * {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used - * when the Query Parameter "enclosingTransaction "is set to 'false'. + * Returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s by getting the appropriate + * CommandStrategy for every {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used when the Query + * Parameter "enclosingTransaction "is set to 'false'. * * @param requestList * @param uriInfo @@ -48,12 +46,10 @@ public interface BatchApiService { List handleBatchRequestsWithoutEnclosingTransaction(List requestList, UriInfo uriInfo); /** - * returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s - * by getting the appropriate CommandStrategy for every - * {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used - * when the Query Parameter "enclosingTransaction "is set to 'true'. If one - * or more of the requests are not completed properly then whole of the - * transaction will be rolled back properly. + * returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s by getting the appropriate + * CommandStrategy for every {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used when the Query + * Parameter "enclosingTransaction "is set to 'true'. If one or more of the requests are not completed properly then + * whole of the transaction will be rolled back properly. * * @param requestList * @param uriInfo diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java index c6b0378af..b04d7397b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java @@ -44,9 +44,8 @@ import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; /** - * Implementation for {@link BatchApiService} to iterate through all the - * incoming requests and obtain the appropriate CommandStrategy from - * CommandStrategyProvider. + * Implementation for {@link BatchApiService} to iterate through all the incoming requests and obtain the appropriate + * CommandStrategy from CommandStrategyProvider. * * @author Rishabh Shukla * @@ -78,10 +77,8 @@ public class BatchApiServiceImpl implements BatchApiService { } /** - * Returns the response list by getting a proper - * {@link org.apache.fineract.batch.command.CommandStrategy}. execute() - * method of acquired commandStrategy is then provided with the separate - * Request. + * Returns the response list by getting a proper {@link org.apache.fineract.batch.command.CommandStrategy}. + * execute() method of acquired commandStrategy is then provided with the separate Request. * * @param requestList * @param uriInfo diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/service/ResolutionHelper.java b/fineract-provider/src/main/java/org/apache/fineract/batch/service/ResolutionHelper.java index ecd58b3f2..0ad028f8e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/service/ResolutionHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/service/ResolutionHelper.java @@ -34,9 +34,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Provides methods to create dependency map among the various batchRequests. It - * also provides method that takes care of dependency resolution among related - * requests. + * Provides methods to create dependency map among the various batchRequests. It also provides method that takes care of + * dependency resolution among related requests. * * @author Rishabh Shukla * @see BatchApiServiceImpl @@ -85,10 +84,9 @@ public class ResolutionHelper { } /** - * Returns a map containing requests that are divided in accordance of - * dependency relations among them. Each different list is identified with a - * "Key" which is the "requestId" of the request at topmost level in - * dependency hierarchy of that particular list. + * Returns a map containing requests that are divided in accordance of dependency relations among them. Each + * different list is identified with a "Key" which is the "requestId" of the request at topmost level in dependency + * hierarchy of that particular list. * * @param batchRequests * @return List<ArrayList<BatchRequestNode>> @@ -122,10 +120,8 @@ public class ResolutionHelper { } /** - * Returns a BatchRequest after dependency resolution. It takes a request - * and the response of the request it is dependent upon as its arguments and - * change the body or relativeUrl of the request according to parent - * Request. + * Returns a BatchRequest after dependency resolution. It takes a request and the response of the request it is + * dependent upon as its arguments and change the body or relativeUrl of the request according to parent Request. * * @param request * @param parentResponse diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/annotation/CommandType.java b/fineract-provider/src/main/java/org/apache/fineract/commands/annotation/CommandType.java index 351c07fb3..96a2919fb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/annotation/CommandType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/annotation/CommandType.java @@ -27,8 +27,7 @@ import java.lang.annotation.Target; /** * Specifies the command type for the annotated class.
*
- * The entity name (e.g. CLIENT, SAVINGSACCOUNT, LOANPRODUCT) and the action - * (e.g. CREATE, DELETE) must be given. + * The entity name (e.g. CLIENT, SAVINGSACCOUNT, LOANPRODUCT) and the action (e.g. CREATE, DELETE) must be given. * * @author Markus Geiss * @version 1.0 diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/exception/RollbackTransactionAsCommandIsNotApprovedByCheckerException.java b/fineract-provider/src/main/java/org/apache/fineract/commands/exception/RollbackTransactionAsCommandIsNotApprovedByCheckerException.java index 71fea23fb..b7172efee 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/exception/RollbackTransactionAsCommandIsNotApprovedByCheckerException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/exception/RollbackTransactionAsCommandIsNotApprovedByCheckerException.java @@ -23,15 +23,12 @@ import org.apache.fineract.commands.domain.CommandSource; public class RollbackTransactionAsCommandIsNotApprovedByCheckerException extends RuntimeException { /** - * When maker-checker is configured globally and also for the current - * transaction. + * When maker-checker is configured globally and also for the current transaction. * - * An initial save determines if there are any integrity rule or data - * problems. + * An initial save determines if there are any integrity rule or data problems. * - * If there isn't... and the transaction is from a maker... then this roll - * back is issued and the commandSourceResult is used to write the audit - * entry. + * If there isn't... and the transaction is from a maker... then this roll back is issued and the + * commandSourceResult is used to write the audit entry. */ private final CommandSource commandSourceResult; diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/exception/UnsupportedCommandException.java b/fineract-provider/src/main/java/org/apache/fineract/commands/exception/UnsupportedCommandException.java index 67e8c8cbd..e4b3d4972 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/exception/UnsupportedCommandException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/exception/UnsupportedCommandException.java @@ -19,8 +19,8 @@ package org.apache.fineract.commands.exception; /** - * A {@link RuntimeException} that is thrown in the case where an invalid or - * unknown command is attempted to be processed by platform. + * A {@link RuntimeException} that is thrown in the case where an invalid or unknown command is attempted to be + * processed by platform. */ public class UnsupportedCommandException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java b/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java index 1f9404847..260bd5eed 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java @@ -34,12 +34,10 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * {@link CommandHandlerProvider} provides {@link NewCommandSourceHandler}s for - * a given entity and action.
+ * {@link CommandHandlerProvider} provides {@link NewCommandSourceHandler}s for a given entity and action.
*
- * A {@link NewCommandSourceHandler} can be registered and the annotation - * {@link CommandType} is used to determine the entity and the action the - * handler is capable to process. + * A {@link NewCommandSourceHandler} can be registered and the annotation {@link CommandType} is used to determine the + * entity and the action the handler is capable to process. * * @author Markus Geiss * @version 1.0 @@ -63,8 +61,8 @@ public class CommandHandlerProvider implements ApplicationContextAware { /** * Returns a handler for the given entity and action.
*
- * Throws an {@link UnsupportedCommandException} if no handler for the given - * entity, action combination can be found. + * Throws an {@link UnsupportedCommandException} if no handler for the given entity, action combination can be + * found. * * @param entity * the entity to lookup the handler, must be given. diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java index b9804f494..aea732f6e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java @@ -99,8 +99,7 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio } catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) { LOG.info("The following command {} has been retried {} time(s)", command.json(), numberOfRetries); /*** - * Fail if the transaction has been retired for - * maxNumberOfRetries + * Fail if the transaction has been retired for maxNumberOfRetries **/ if (numberOfRetries >= maxNumberOfRetries) { LOG.warn("The following command {} has been retried for the max allowed attempts of {} and will be rolled back", @@ -108,8 +107,7 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio throw (exception); } /*** - * Else sleep for a random time (between 1 to 10 seconds) and - * continue + * Else sleep for a random time (between 1 to 10 seconds) and continue **/ try { Random random = new Random(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java index f0334107a..d519ae7ad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java @@ -111,15 +111,13 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer if ((rollbackTransaction || result.isRollbackTransaction()) && !isApprovedByChecker) { /* - * JournalEntry will generate a new transactionId every time. - * Updating the transactionId with old transactionId, because as - * there are no entries are created with new transactionId, will - * throw an error when checker approves the transaction + * JournalEntry will generate a new transactionId every time. Updating the transactionId with old + * transactionId, because as there are no entries are created with new transactionId, will throw an error + * when checker approves the transaction */ commandSourceResult.updateTransaction(command.getTransactionId()); /* - * Update CommandSource json data with JsonCommand json data, line - * 77 and 81 may update the json data + * Update CommandSource json data with JsonCommand json data, line 77 and 81 may update the json data */ commandSourceResult.updateJsonTo(command.json()); throw new RollbackTransactionAsCommandIsNotApprovedByCheckerException(commandSourceResult); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java index d17a6f948..6be6da94b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java @@ -80,10 +80,8 @@ public class AccountNumberFormatDataValidator { .parameter(AccountNumberFormatConstants.prefixTypeParamName).value(prefixType).notNull().integerGreaterThanZero(); /** - * Permitted values for prefix type vary based on the actual - * selected accountType, carry out this validation only if data - * validation errors do not exist for both entity type and prefix - * type + * Permitted values for prefix type vary based on the actual selected accountType, carry out this validation + * only if data validation errors do not exist for both entity type and prefix type **/ boolean areAccountTypeAndPrefixTypeValid = true; for (ApiParameterError apiParameterError : dataValidationErrors) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java index 2eb9fa6c3..9054a2564 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java @@ -46,9 +46,8 @@ public class AccountNumberFormatConstants { public static final String prefixTypeOptionsParamName = "prefixTypeOptions"; /** - * These parameters will match the class level parameters of - * {@link AccountNumberFormatData}. Where possible, we try to get response - * parameters to match those of request parameters. + * These parameters will match the class level parameters of {@link AccountNumberFormatData}. Where possible, we try + * to get response parameters to match those of request parameters. */ // Error messages codes diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java index b2310b5f9..d79fe7c8a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java @@ -111,9 +111,8 @@ public class AccountNumberFormatReadPlatformServiceImpl implements AccountNumber Map> accountNumberPrefixTypeOptions = new HashMap<>(); /*** - * If an Account type is passed in, return prefixes only for the passed - * in account type, else return all allowed prefixes keyed by all - * possible entity type + * If an Account type is passed in, return prefixes only for the passed in account type, else return all allowed + * prefixes keyed by all possible entity type **/ if (entityAccountTypeForTemplate != null) { determinePrefixTypesForAccounts(accountNumberPrefixTypeOptions, entityAccountTypeForTemplate); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java index 84fcfe65d..1cea111a2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java @@ -136,8 +136,7 @@ public class AccountNumberFormatWritePlatformServiceJpaRepositoryImpl implements } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { if (realCause.getMessage().contains(AccountNumberFormatConstants.ACCOUNT_TYPE_UNIQUE_CONSTRAINT_NAME)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/PersonnelSheetPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/PersonnelSheetPopulator.java index 8b0c48d60..96b0f3f07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/PersonnelSheetPopulator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/PersonnelSheetPopulator.java @@ -40,9 +40,8 @@ public class PersonnelSheetPopulator extends AbstractWorkbookPopulator { private Map> officeToPersonnel; /* - * Guava Multimap would make this more readable. The value Integer[] - * contains the beginIndex and endIndex for the staff list of each office. - * Required for applying names in excel. + * Guava Multimap would make this more readable. The value Integer[] contains the beginIndex and endIndex for the + * staff list of each office. Required for applying names in excel. */ private Map officeNameToBeginEndIndexesOfStaff; @@ -61,9 +60,8 @@ public class PersonnelSheetPopulator extends AbstractWorkbookPopulator { setLayout(staffSheet); /* - * This piece of code could have been avoided by making multiple trips - * to the database for the staff of each office but this is more - * performance efficient + * This piece of code could have been avoided by making multiple trips to the database for the staff of each + * office but this is more performance efficient */ setOfficeToPersonnelMap(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java index 5fabf79b7..5ab511d5d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java @@ -35,12 +35,10 @@ import org.springframework.cache.support.NoOpCacheManager; import org.springframework.stereotype.Component; /** - * At present this implementation of {@link CacheManager} just delegates to the - * real {@link CacheManager} to use. + * At present this implementation of {@link CacheManager} just delegates to the real {@link CacheManager} to use. * - * By default it is {@link NoOpCacheManager} but we can change that by checking - * some persisted configuration in the database on startup and allow user to - * switch implementation through UI/API + * By default it is {@link NoOpCacheManager} but we can change that by checking some persisted configuration in the + * database on startup and allow user to switch implementation through UI/API */ @Component(value = "runtimeDelegatingCacheManager") public class RuntimeDelegatingCacheManager implements CacheManager { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailCampaignApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailCampaignApiResource.java index 7591b67db..b0c8bda62 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailCampaignApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailCampaignApiResource.java @@ -54,8 +54,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * Created with IntelliJ IDEA. User: andrew Date: 19-5-14 Time: 15:17 To change - * this template use File | Settings | File Templates. + * Created with IntelliJ IDEA. User: andrew Date: 19-5-14 Time: 15:17 To change this template use File | Settings | File + * Templates. */ @Path("/email/campaign") @Consumes({ MediaType.APPLICATION_JSON }) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java index 46a4ac07a..e56d988e0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java @@ -132,9 +132,8 @@ public class EmailCampaignReadPlatformServiceImpl implements EmailCampaignReadPl final boolean useReport = rs.getBoolean("useReport"); /* - * final ReportData stretchyReport = new ReportData(reportId, - * reportName, reportType, reportSubType, reportCategory, - * reportDescription, reportSql, coreReport, useReport, null); + * final ReportData stretchyReport = new ReportData(reportId, reportName, reportType, reportSubType, + * reportCategory, reportDescription, reportSql, coreReport, useReport, null); */ final Integer statusId = JdbcSupport.getInteger(rs, "statusEnum"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java index 0f8c3db30..4165aaea2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java @@ -313,8 +313,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai // calculate new trigger date and insert into next trigger date /** - * next run time has to be in the future if not calculate a new future - * date + * next run time has to be in the future if not calculate a new future date */ LocalDate nextRuntime = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(), emailCampaign.getNextTriggerDate().toLocalDate(), nextTriggerDate.toLocalDate()); @@ -366,9 +365,8 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai if (emailCampaign.isSchedule()) { /** - * if recurrence start date is in the future calculate next - * trigger date if not use recurrence start date us next trigger - * date when activating + * if recurrence start date is in the future calculate next trigger date if not use recurrence start + * date us next trigger date when activating */ LocalDate nextTriggerDate = null; if (emailCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())) { @@ -391,8 +389,8 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai } /* - * if campaign is direct insert campaign message into email outbound - * table else if its a schedule create a job process for it + * if campaign is direct insert campaign message into email outbound table else if its a schedule create a job + * process for it */ return new CommandProcessingResultBuilder() // .withCommandId(command.commandId()) // @@ -515,9 +513,8 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai if (emailCampaign.isSchedule()) { /** - * if recurrence start date is in the future calculate next trigger - * date if not use recurrence start date us next trigger date when - * activating + * if recurrence start date is in the future calculate next trigger date if not use recurrence start date us + * next trigger date when activating */ LocalDate nextTriggerDate = null; if (emailCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())) { @@ -718,8 +715,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai } /** - * This generates the the report and converts it to a file by passing the - * parameters below + * This generates the the report and converts it to a file by passing the parameters below * * @param emailCampaign * @param emailAttachmentFileFormat @@ -763,8 +759,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai } /** - * This matches the the actual values to the key in the report stretchy - * parameters map + * This matches the the actual values to the key in the report stretchy parameters map * * @param stretchyParams * @param client diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java index 44700da2d..9d8353a59 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java @@ -117,8 +117,7 @@ public class EmailWritePlatformServiceJpaRepositoryImpl implements EmailWritePla } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(@SuppressWarnings("unused") final JsonCommand command, final DataIntegrityViolationException dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java index 7199ba8f7..55b43b049 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java @@ -500,8 +500,7 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService { * * private final Object entity ; * - * public Task(final FineractPlatformTenant tenant, final String reportName, - * final Object entity) { this.tenant = tenant; this.reportName = reportName - * ; this.entity = entity ; } } + * public Task(final FineractPlatformTenant tenant, final String reportName, final Object entity) { this.tenant = + * tenant; this.reportName = reportName ; this.entity = entity ; } } */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java index 9378cca87..b243e6c29 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java @@ -409,8 +409,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP // calculate new trigger date and insert into next trigger date /** - * next run time has to be in the future if not calculate a new future - * date + * next run time has to be in the future if not calculate a new future date */ LocalDate nextRuntime = CalendarUtils.getNextRecurringDate(smsCampaign.getRecurrence(), smsCampaign.getNextTriggerDate().toLocalDate(), nextTriggerDate.toLocalDate()); @@ -460,9 +459,8 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP } else if (smsCampaign.isSchedule()) { /** - * if recurrence start date is in the future calculate next trigger - * date if not use recurrence start date us next trigger date when - * activating + * if recurrence start date is in the future calculate next trigger date if not use recurrence start date us + * next trigger date when activating */ LocalDate nextTriggerDate = null; if (smsCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())) { @@ -484,8 +482,8 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP } /* - * if campaign is direct insert campaign message into sms outbound table - * else if its a schedule create a job process for it + * if campaign is direct insert campaign message into sms outbound table else if its a schedule create a job + * process for it */ return new CommandProcessingResultBuilder() // .withCommandId(command.commandId()) // @@ -621,9 +619,8 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP } else if (smsCampaign.isSchedule()) { /** - * if recurrence start date is in the future calculate next trigger - * date if not use recurrence start date us next trigger date when - * activating + * if recurrence start date is in the future calculate next trigger date if not use recurrence start date us + * next trigger date when activating */ LocalDate nextTriggerDate = null; if (smsCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java index 307b269bb..5b833ead5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java @@ -24,8 +24,7 @@ import java.util.Set; public class CodeConstants { /*** - * Enum of all parameters passed in while creating/updating a code and code - * value + * Enum of all parameters passed in while creating/updating a code and code value ***/ public static enum CodevalueJSONinputParams { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValueRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValueRepositoryWrapper.java index 47c285445..5f363c25a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValueRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValueRepositoryWrapper.java @@ -24,15 +24,14 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link CodeValueRepository} that is responsible for checking if - * {@link CodeValue} is returned when using findOne and - * findByCodeNameAndId repository methods and throwing an - * appropriate not found exception. + * Wrapper for {@link CodeValueRepository} that is responsible for checking if {@link CodeValue} is returned when using + * findOne and findByCodeNameAndId repository methods and throwing an appropriate not found + * exception. *

* *

- * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link CodeValueRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where {@link CodeValueRepository} is + * required. *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/SystemDefinedCodeCannotBeChangedException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/SystemDefinedCodeCannotBeChangedException.java index da17e5e37..95f815e67 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/SystemDefinedCodeCannotBeChangedException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/SystemDefinedCodeCannotBeChangedException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.codes.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link AbstractPlatformDomainRuleException} thrown when someone attempts to - * update or delete a system defined code. + * A {@link AbstractPlatformDomainRuleException} thrown when someone attempts to update or delete a system defined code. */ public class SystemDefinedCodeCannotBeChangedException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformService.java index d6674fc0f..cfbd528a7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformService.java @@ -31,13 +31,11 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData; * * *

- * System defined codes cannot be altered or removed but their code values may - * be allowed to be added to or removed. + * System defined codes cannot be altered or removed but their code values may be allowed to be added to or removed. *

* *

- * User defined codes can be changed in any way by application users with system - * permissions. + * User defined codes can be changed in any way by application users with system permissions. *

*/ public interface CodeValueReadPlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java index 3538a8127..e06e52a28 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java @@ -90,8 +90,7 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleCodeValueDataIntegrityIssues(final JsonCommand command, final DataIntegrityViolationException dve) { final Throwable realCause = dve.getMostSpecificCause(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java index ead12a043..f0b860dd1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java @@ -139,8 +139,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleCodeDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { if (realCause.getMessage().contains("code_name")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java index 61c14e18e..efa1efa1c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java @@ -82,8 +82,7 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService /* * (non-Javadoc) * - * @see org.apache.fineract.infrastructure.configuration.domain. - * ConfigurationDomainService#isHolidaysEnabled() + * @see org.apache.fineract.infrastructure.configuration.domain. ConfigurationDomainService#isHolidaysEnabled() */ @Override public boolean isRescheduleRepaymentsOnHolidaysEnabled() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationRepositoryWrapper.java index 5b2b280ab..7276bcd22 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationRepositoryWrapper.java @@ -24,8 +24,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link GlobalConfigurationRepository} that adds NULL checking and - * Error handling capabilities + * Wrapper for {@link GlobalConfigurationRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/exception/GlobalConfigurationPropertyNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/exception/GlobalConfigurationPropertyNotFoundException.java index b92926f16..f725e5c36 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/exception/GlobalConfigurationPropertyNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/exception/GlobalConfigurationPropertyNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.configuration.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when global configuration properties are - * not found. + * A {@link RuntimeException} thrown when global configuration properties are not found. */ public class GlobalConfigurationPropertyNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/GlobalConfigurationCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/GlobalConfigurationCommandFromApiJsonDeserializer.java index 94970f6c3..67ac28555 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/GlobalConfigurationCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/GlobalConfigurationCommandFromApiJsonDeserializer.java @@ -34,8 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link UpdateGlobalConfigurationCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link UpdateGlobalConfigurationCommand}'s. */ @Component public final class GlobalConfigurationCommandFromApiJsonDeserializer diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java index 328e6fead..b63203c5a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java @@ -96,8 +96,7 @@ public class GlobalConfigurationWritePlatformServiceJpaRepositoryImpl implements } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/ApiRequestParameterHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/ApiRequestParameterHelper.java index 88fb3ec90..f6ddae008 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/ApiRequestParameterHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/ApiRequestParameterHelper.java @@ -25,13 +25,12 @@ import org.springframework.stereotype.Component; /** *

- * Used to process the query parameters provided in a API request to see - * features of the RESTful API are being asked for such as: + * Used to process the query parameters provided in a API request to see features of the RESTful API are being asked for + * such as: *

*
    *
  • Pretty printing through pretty=true, defaults to false
  • - *
  • Partial response through fields=id, name etc, when empty, the full data - * is returned by default.
  • + *
  • Partial response through fields=id, name etc, when empty, the full data is returned by default.
  • *
*/ @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/DateAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/DateAdapter.java index 9a9163ba6..95a9c158b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/DateAdapter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/DateAdapter.java @@ -27,8 +27,8 @@ import java.time.format.DateTimeFormatter; import java.util.Date; /** - * GSON Serializer for JUL Dates (java.util.Date) in ISO-8601 format using - * {@link DateTimeFormatter#ISO_INSTANT} (see FINERACT-926). + * GSON Serializer for JUL Dates (java.util.Date) in ISO-8601 format using {@link DateTimeFormatter#ISO_INSTANT} (see + * FINERACT-926). * * @author Michael Vorburger.ch */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaDateTimeAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaDateTimeAdapter.java index d9d611b10..128c2e19d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaDateTimeAdapter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaDateTimeAdapter.java @@ -26,8 +26,7 @@ import java.lang.reflect.Type; import org.joda.time.DateTime; /** - * Serializer for Joda Time {@link DateTime} that returns the date as long to - * match previous (Jackson) functionality. + * Serializer for Joda Time {@link DateTime} that returns the date as long to match previous (Jackson) functionality. */ public class JodaDateTimeAdapter implements JsonSerializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java index 0e9381eb5..6004e6315 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java @@ -27,8 +27,8 @@ import java.lang.reflect.Type; import org.joda.time.LocalDate; /** - * Serializer for Joda Time {@link LocalDate} that returns the date in array - * format to match previous Jackson functionality. + * Serializer for Joda Time {@link LocalDate} that returns the date in array format to match previous Jackson + * functionality. */ public class JodaLocalDateAdapter implements JsonSerializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaMonthDayAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaMonthDayAdapter.java index f8d9724a9..659c70e2f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaMonthDayAdapter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaMonthDayAdapter.java @@ -27,8 +27,8 @@ import java.lang.reflect.Type; import org.joda.time.MonthDay; /** - * Serializer for Joda Time {@link MonthDay} that returns the date in array - * format to match previous Jackson functionality. + * Serializer for Joda Time {@link MonthDay} that returns the date in array format to match previous Jackson + * functionality. */ public class JodaMonthDayAdapter implements JsonSerializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonCommand.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonCommand.java index 94df4deab..72616401a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonCommand.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonCommand.java @@ -43,8 +43,8 @@ import org.joda.time.format.DateTimeFormatter; /** * Immutable representation of a command. * - * Wraps the provided JSON with convenience functions for extracting parameter - * values and checking for changes against an existing value. + * Wraps the provided JSON with convenience functions for extracting parameter values and checking for changes against + * an existing value. */ public final class JsonCommand { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonQuery.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonQuery.java index 9fc5deaa5..9a5af6279 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonQuery.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JsonQuery.java @@ -35,8 +35,7 @@ import org.joda.time.LocalDate; /** * Immutable representation of a query. * - * Wraps the provided JSON with convenience functions for extracting parameter - * values. + * Wraps the provided JSON with convenience functions for extracting parameter values. */ public final class JsonQuery { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/AbstractApplicationConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/AbstractApplicationConfiguration.java index c9eef4fc0..42a93667b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/AbstractApplicationConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/AbstractApplicationConfiguration.java @@ -36,13 +36,12 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; /** * Base Spring Configuration with what's common to all Configuration subclasses. * - * Notably the EnableAutoConfiguration excludes relevant for (and often adjusted - * when upgrading versions of) Spring Boot, the "old" (pre. Spring Boot & - * MariaDB4j) fineract appContext.xml which all configurations need, and the + * Notably the EnableAutoConfiguration excludes relevant for (and often adjusted when upgrading versions of) Spring + * Boot, the "old" (pre. Spring Boot & MariaDB4j) fineract appContext.xml which all configurations need, and the * web.xml successor WebXmlConfiguration. * - * Should NOT include Configuration related to embedded Tomcat, data sources, - * and MariaDB4j (because those differ in the subclasses). + * Should NOT include Configuration related to embedded Tomcat, data sources, and MariaDB4j (because those differ in the + * subclasses). */ @Configuration @Import({ WebXmlConfiguration.class, WebXmlOauthConfiguration.class, WebFrontEndConfiguration.class, MessagingConfiguration.class, diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/EmbeddedTomcatWithSSLConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/EmbeddedTomcatWithSSLConfiguration.java index ccd58c89c..8f5d26c05 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/EmbeddedTomcatWithSSLConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/EmbeddedTomcatWithSSLConfiguration.java @@ -88,13 +88,10 @@ public class EmbeddedTomcatWithSSLConfiguration { try { URL url = resource.getURL(); /** - * // If this creates filenames that are too long on Win, // then - * could just use resource.getFilename(), // even though not unique, - * real risk prob. min.bon String tempDir = - * System.getProperty("java.io.tmpdir"); tempDir = tempDir + "/" + - * getClass().getSimpleName() + "/"; String path = url.getPath(); - * String uniqName = path.replace("file:/", "").replace('!', '_'); - * String tempFullPath = tempDir + uniqName; + * // If this creates filenames that are too long on Win, // then could just use resource.getFilename(), // + * even though not unique, real risk prob. min.bon String tempDir = System.getProperty("java.io.tmpdir"); + * tempDir = tempDir + "/" + getClass().getSimpleName() + "/"; String path = url.getPath(); String uniqName + * = path.replace("file:/", "").replace('!', '_'); String tempFullPath = tempDir + uniqName; **/ // instead of File.createTempFile(prefix?, suffix?); File targetFile = new File(resource.getFilename()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebXmlOauthConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebXmlOauthConfiguration.java index 6338789ed..6e558e867 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebXmlOauthConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebXmlOauthConfiguration.java @@ -26,8 +26,7 @@ import org.springframework.context.annotation.Profile; import org.springframework.web.servlet.DispatcherServlet; /** - * This Configuration replaces what formerly was in web.xml. Beans are loaded - * only when "oauth" Profile is enabled. + * This Configuration replaces what formerly was in web.xml. Beans are loaded only when "oauth" Profile is enabled. * * @see #howto-convert-an-existing-application-to-spring-boot diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiGlobalErrorResponse.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiGlobalErrorResponse.java index 15b972037..8c648e4e6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiGlobalErrorResponse.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiGlobalErrorResponse.java @@ -29,8 +29,7 @@ import javax.xml.bind.annotation.XmlElementWrapper; public class ApiGlobalErrorResponse { /** - * A developer friendly plain English description of why the HTTP error - * response was returned from the API. + * A developer friendly plain English description of why the HTTP error response was returned from the API. */ private String developerMessage; @@ -40,21 +39,19 @@ public class ApiGlobalErrorResponse { private String httpStatusCode; /** - * A user friendly plain English description of why the HTTP error response - * was returned from the API that can be presented to end users. + * A user friendly plain English description of why the HTTP error response was returned from the API that can be + * presented to end users. */ private String defaultUserMessage; /** - * A code that can be used for globalisation support by client applications - * of the API. + * A code that can be used for globalisation support by client applications of the API. */ private String userMessageGlobalisationCode; /** - * A list of zero or more of the actual reasons for the HTTP error should - * they be needed. Typically used to express data validation errors with - * parameters passed to API. + * A list of zero or more of the actual reasons for the HTTP error should they be needed. Typically used to express + * data validation errors with parameters passed to API. */ private List errors = new ArrayList<>(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java index 5535c0e2a..b34217e6d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java @@ -26,26 +26,23 @@ import java.util.List; public class ApiParameterError { /** - * A developer friendly plain English description of why the HTTP error - * response was returned from the API. + * A developer friendly plain English description of why the HTTP error response was returned from the API. */ private String developerMessage; /** - * A user friendly plain English description of why the HTTP error response - * was returned from the API that can be presented to end users. + * A user friendly plain English description of why the HTTP error response was returned from the API that can be + * presented to end users. */ private String defaultUserMessage; /** - * A code that can be used for globalisation support by client applications - * of the API. + * A code that can be used for globalisation support by client applications of the API. */ private String userMessageGlobalisationCode; /** - * The name of the field or parameter passed to the API that this error - * relates to. + * The name of the field or parameter passed to the API that this error relates to. */ private String parameterName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResult.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResult.java index f45690284..fefae0e5b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResult.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResult.java @@ -23,8 +23,7 @@ import java.util.HashMap; import java.util.Map; /** - * Represents the successful result of an REST API call that results in - * processing a command. + * Represents the successful result of an REST API call that results in processing a command. */ public class CommandProcessingResult implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResultBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResultBuilder.java index 606a6d2e6..1fdd91f00 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResultBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/CommandProcessingResultBuilder.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.core.data; import java.util.Map; /** - * Represents the successful result of an REST API call that results in - * processing a command. + * Represents the successful result of an REST API call that results in processing a command. */ public class CommandProcessingResultBuilder { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java index 4c071b82c..f48d3275e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java @@ -160,9 +160,8 @@ public class DataValidatorBuilder { /*** FIXME: Vishwas, why does this method have a parameter? Seems wrong ***/ /* - * This method is not meant for validation, if you have mandatory boolean - * param and if it has invalid value or value not passed then call this - * method, this method is always used with input as false + * This method is not meant for validation, if you have mandatory boolean param and if it has invalid value or value + * not passed then call this method, this method is always used with input as false */ public DataValidatorBuilder trueOrFalseRequired1(final boolean trueOfFalseFieldProvided) { if (!trueOfFalseFieldProvided && !this.ignoreNullValue) { @@ -982,9 +981,8 @@ public class DataValidatorBuilder { } boolean validationErr = true; /* - * supports numbers, parentheses(), hyphens and may contain + sign in - * the beginning and can contain whitespaces in between and length - * allowed is 0-25 chars. + * supports numbers, parentheses(), hyphens and may contain + sign in the beginning and can contain whitespaces + * in between and length allowed is 0-25 chars. */ final String regex = "^\\+?[0-9. ()-]{0,25}$"; final Pattern pattern = Pattern.compile(regex); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/debug/EchoHeadersResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/debug/EchoHeadersResource.java index 97c94f38d..f2cd0dc7f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/debug/EchoHeadersResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/debug/EchoHeadersResource.java @@ -29,15 +29,12 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * Returns HTTP Request headers. Useful for debugging (e.g. for FINERACT-914. Could - * later be replaced with FINERACT-914. Could later be replaced with Spring - * Boot's Actuator HTTP Tracing (see also - * related tutorial - * on Baeldung.com), but that exposes a lot more than just the current - * request out of the box, and would to be properly authenticated for a - * dedicated new debug role. + * Boot's Actuator HTTP Tracing (see also related + * tutorial on Baeldung.com), but that exposes a lot more than just the current request out of the box, and would to + * be properly authenticated for a dedicated new debug role. * * @author Michael Vorburger.ch */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java index c674e9cf0..4bb109765 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java @@ -33,12 +33,10 @@ import org.springframework.data.domain.Auditable; import org.springframework.data.jpa.domain.AbstractAuditable; /** - * A custom copy of {@link AbstractAuditable} to override the column names used - * on database. It also uses Instant instead of LocalDateTime for created and - * modified. + * A custom copy of {@link AbstractAuditable} to override the column names used on database. It also uses Instant + * instead of LocalDateTime for created and modified. * - * Abstract base class for auditable entities. Stores the audit values in - * persistent fields. + * Abstract base class for auditable entities. Stores the audit values in persistent fields. * * @param * the auditing type. Typically some kind of user. diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java index 3b7976df7..be134dcc0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java @@ -29,14 +29,12 @@ import org.springframework.data.domain.Persistable; /** * Abstract base class for entities. * - * Inspired by {@link org.springframework.data.jpa.domain.AbstractPersistable}, - * but Id is always Long (and this class thus does not require generic - * parameterization), and auto-generation is of strategy + * Inspired by {@link org.springframework.data.jpa.domain.AbstractPersistable}, but Id is always Long (and this class + * thus does not require generic parameterization), and auto-generation is of strategy * {@link javax.persistence.GenerationType#IDENTITY}. * - * The {@link #equals(Object)} and {@link #hashCode()} methods are NOT - * implemented here, which is untypical for JPA (it's usually implemented based - * on the Id), because "we end up with issues on OpenJPA" (TODO clarify this). + * The {@link #equals(Object)} and {@link #hashCode()} methods are NOT implemented here, which is untypical for JPA + * (it's usually implemented based on the Id), because "we end up with issues on OpenJPA" (TODO clarify this). */ @MappedSuperclass public abstract class AbstractPersistableCustom implements Persistable, Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/JdbcSupport.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/JdbcSupport.java index cbb3bfae3..3b2d7276d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/JdbcSupport.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/JdbcSupport.java @@ -31,8 +31,8 @@ import org.joda.time.LocalTime; import org.springframework.jdbc.support.JdbcUtils; /** - * Support for retrieving possibly null values from jdbc recordset delegating to - * springs {@link JdbcUtils} where possible. + * Support for retrieving possibly null values from jdbc recordset delegating to springs {@link JdbcUtils} where + * possible. */ public class JdbcSupport { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java index bb57263da..5d830ef29 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when valid api request end up violating - * some domain rule. + * A {@link RuntimeException} thrown when valid api request end up violating some domain rule. */ public abstract class AbstractPlatformDomainRuleException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java index 7f66684cf..1f0d7c7cb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when resources that are queried for are not - * found. + * A {@link RuntimeException} thrown when resources that are queried for are not found. */ public abstract class AbstractPlatformResourceNotFoundException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java index e718b9c73..cf905ec20 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when resources that are queried for are not - * found. + * A {@link RuntimeException} thrown when resources that are queried for are not found. */ public abstract class AbstractPlatformServiceUnavailableException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java index b5b9139eb..be6574eae 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when valid api request end up violating - * some domain rule. + * A {@link RuntimeException} thrown when valid api request end up violating some domain rule. */ public final class GeneralPlatformDomainRuleException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java index 2be934884..56cc5defb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java @@ -19,8 +19,8 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} that is thrown in the case where invalid JSON is - * sent in the body of the request to the platform api. + * A {@link RuntimeException} that is thrown in the case where invalid JSON is sent in the body of the request to the + * platform api. */ public class InvalidJsonException extends RuntimeException { // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java index 1e51d74d0..7f8e175bb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java @@ -31,14 +31,12 @@ import org.slf4j.LoggerFactory; /** * Exception with multiple root causes. * - * Intended to be used in places where N operations are performed in a loop over - * something, each of which could fail, but where we don't want to fail - * immediately but continue, and then fail at end. + * Intended to be used in places where N operations are performed in a loop over something, each of which could fail, + * but where we don't want to fail immediately but continue, and then fail at end. * *

- * The failures should typically also each be logged within the loop, as they - * occur; this exception is only thrown to propagate the failure, and the caller - * may or may not log this with the details. + * The failures should typically also each be logged within the loop, as they occur; this exception is only thrown to + * propagate the failure, and the caller may or may not log this with the details. * *

* Originally inspired by org.junit.runners.model.MultipleFailureException diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java index 0b58ae94e..d2a0c4a09 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when data integrity problems happen due to - * state modifying actions. + * A {@link RuntimeException} thrown when data integrity problems happen due to state modifying actions. */ public class PlatformDataIntegrityException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/UnsupportedParameterException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/UnsupportedParameterException.java index cb0fa114a..64d2c4d9c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/UnsupportedParameterException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/UnsupportedParameterException.java @@ -21,8 +21,8 @@ package org.apache.fineract.infrastructure.core.exception; import java.util.List; /** - * A {@link RuntimeException} that is thrown in the case where invalid - * parameters are sent in the body of the request to the platform api. + * A {@link RuntimeException} that is thrown in the case where invalid parameters are sent in the body of the request to + * the platform api. */ public class UnsupportedParameterException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/AccessDeniedExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/AccessDeniedExceptionMapper.java index 41b8af829..a4f78d637 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/AccessDeniedExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/AccessDeniedExceptionMapper.java @@ -29,12 +29,10 @@ import org.springframework.security.access.AccessDeniedException; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link AccessDeniedException} thrown by - * platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link AccessDeniedException} thrown by platform into a HTTP API friendly format. * - * The {@link AccessDeniedException} is thrown by spring security on platform - * when an attempt is made to use functionality for which the user does have - * sufficient privileges. + * The {@link AccessDeniedException} is thrown by spring security on platform when an attempt is made to use + * functionality for which the user does have sufficient privileges. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/BadCredentialsExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/BadCredentialsExceptionMapper.java index 58a0da706..f458ea86f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/BadCredentialsExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/BadCredentialsExceptionMapper.java @@ -29,12 +29,11 @@ import org.springframework.security.authentication.BadCredentialsException; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link BadCredentialsException} thrown by - * platform during authentication into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link BadCredentialsException} thrown by platform during authentication into a + * HTTP API friendly format. * - * The {@link BadCredentialsException} is thrown by spring security on platform - * when an attempt is made to authenticate using invalid username/password - * credentials. + * The {@link BadCredentialsException} is thrown by spring security on platform when an attempt is made to authenticate + * using invalid username/password credentials. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidJsonExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidJsonExceptionMapper.java index ed4e5422a..a1799ca25 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidJsonExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidJsonExceptionMapper.java @@ -29,8 +29,7 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link InvalidJsonException} thrown by - * platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link InvalidJsonException} thrown by platform into a HTTP API friendly format. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidTenantIdentifierExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidTenantIdentifierExceptionMapper.java index b59e2ab57..e17fb365c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidTenantIdentifierExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/InvalidTenantIdentifierExceptionMapper.java @@ -29,11 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link InvalidTenantIdentiferException} - * thrown by platform during authentication into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link InvalidTenantIdentiferException} thrown by platform during authentication + * into a HTTP API friendly format. * - * The {@link InvalidTenantIdentiferException} is thrown by spring security on - * platform when a request contains an invalid tenant identifier. + * The {@link InvalidTenantIdentiferException} is thrown by spring security on platform when a request contains an + * invalid tenant identifier. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/JsonSyntaxExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/JsonSyntaxExceptionMapper.java index 5c4a7baed..dd3664a12 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/JsonSyntaxExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/JsonSyntaxExceptionMapper.java @@ -29,8 +29,7 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link JsonSyntaxException} thrown by - * platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link JsonSyntaxException} thrown by platform into a HTTP API friendly format. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/MalformedJsonExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/MalformedJsonExceptionMapper.java index ceff4a7e9..92ac18f0d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/MalformedJsonExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/MalformedJsonExceptionMapper.java @@ -29,8 +29,7 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link MalformedJsonException} thrown by - * platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link MalformedJsonException} thrown by platform into a HTTP API friendly format. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/NoAuthorizationExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/NoAuthorizationExceptionMapper.java index 81da8233f..7fc2b3424 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/NoAuthorizationExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/NoAuthorizationExceptionMapper.java @@ -29,11 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link NoAuthorizationException} thrown by - * platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link NoAuthorizationException} thrown by platform into a HTTP API friendly + * format. * - * The {@link NoAuthorizationException} is thrown on platform when an attempt is - * made to use functionality for which the user does have sufficient privileges. + * The {@link NoAuthorizationException} is thrown on platform when an attempt is made to use functionality for which the + * user does have sufficient privileges. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformApiDataValidationExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformApiDataValidationExceptionMapper.java index 5568d7067..14a004540 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformApiDataValidationExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformApiDataValidationExceptionMapper.java @@ -29,11 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link PlatformApiDataValidationException} - * thrown by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link PlatformApiDataValidationException} thrown by platform into a HTTP API + * friendly format. * - * The {@link PlatformApiDataValidationException} is typically thrown in data - * validation of the parameters passed in with an api request. + * The {@link PlatformApiDataValidationException} is typically thrown in data validation of the parameters passed in + * with an api request. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDataIntegrityExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDataIntegrityExceptionMapper.java index b58b80b8a..304ec2a5c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDataIntegrityExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDataIntegrityExceptionMapper.java @@ -29,11 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link PlatformDataIntegrityException} - * thrown by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link PlatformDataIntegrityException} thrown by platform into a HTTP API friendly + * format. * - * The {@link PlatformDataIntegrityException} is thrown when modifying api call - * result in data integrity checks to be fired. + * The {@link PlatformDataIntegrityException} is thrown when modifying api call result in data integrity checks to be + * fired. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDomainRuleExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDomainRuleExceptionMapper.java index 4d4dc2fce..6ca3fd06f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDomainRuleExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformDomainRuleExceptionMapper.java @@ -29,11 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link AbstractPlatformDomainRuleException} - * thrown by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link AbstractPlatformDomainRuleException} thrown by platform into a HTTP API + * friendly format. * - * The {@link AbstractPlatformDomainRuleException} is thrown when an api call - * results is some internal business/domain logic been violated. + * The {@link AbstractPlatformDomainRuleException} is thrown when an api call results is some internal business/domain + * logic been violated. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformInternalServerExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformInternalServerExceptionMapper.java index 77d4d8574..d10a0af43 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformInternalServerExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformInternalServerExceptionMapper.java @@ -29,11 +29,10 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link PlatformInternalServerException} - * thrown by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link PlatformInternalServerException} thrown by platform into a HTTP API friendly + * format. * - * The {@link PlatformInternalServerException} is thrown when an api call - * results in unexpected server side exceptions. + * The {@link PlatformInternalServerException} is thrown when an api call results in unexpected server side exceptions. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformResourceNotFoundExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformResourceNotFoundExceptionMapper.java index 1a61b22c6..6cd9835f2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformResourceNotFoundExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformResourceNotFoundExceptionMapper.java @@ -29,12 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map - * {@link AbstractPlatformResourceNotFoundException} thrown by platform into a - * HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link AbstractPlatformResourceNotFoundException} thrown by platform into a HTTP + * API friendly format. * - * The {@link AbstractPlatformResourceNotFoundException} is thrown when an api - * call for a resource that is expected to exist does not. + * The {@link AbstractPlatformResourceNotFoundException} is thrown when an api call for a resource that is expected to + * exist does not. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformServiceUnavailableExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformServiceUnavailableExceptionMapper.java old mode 100755 new mode 100644 index 2d64ae735..b9c216c14 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformServiceUnavailableExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/PlatformServiceUnavailableExceptionMapper.java @@ -29,12 +29,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map - * {@link AbstractPlatformServiceUnavailableException} thrown by platform into a - * HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link AbstractPlatformServiceUnavailableException} thrown by platform into a HTTP + * API friendly format. * - * The {@link AbstractPlatformServiceUnavailableException} is thrown when an api - * call for a resource that is expected to exist does not. + * The {@link AbstractPlatformServiceUnavailableException} is thrown when an api call for a resource that is expected to + * exist does not. */ @Provider diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnAuthenticatedUserExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnAuthenticatedUserExceptionMapper.java index beb2c902f..aa8092de1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnAuthenticatedUserExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnAuthenticatedUserExceptionMapper.java @@ -29,8 +29,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link UnAuthenticatedUserException} thrown - * by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link UnAuthenticatedUserException} thrown by platform into a HTTP API friendly + * format. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnrecognizedQueryParamExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnrecognizedQueryParamExceptionMapper.java index 7e9760f1d..b441a2c80 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnrecognizedQueryParamExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnrecognizedQueryParamExceptionMapper.java @@ -32,11 +32,11 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link UnrecognizedQueryParamException} - * thrown by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link UnrecognizedQueryParamException} thrown by platform into a HTTP API friendly + * format. * - * The {@link UnrecognizedQueryParamException} is typically thrown when a - * parameter is passed during and post or put that is not expected. + * The {@link UnrecognizedQueryParamException} is typically thrown when a parameter is passed during and post or put + * that is not expected. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedCommandExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedCommandExceptionMapper.java index 1d1f2a7ce..2358e446a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedCommandExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedCommandExceptionMapper.java @@ -32,8 +32,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link UnsupportedCommandException} thrown - * by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link UnsupportedCommandException} thrown by platform into a HTTP API friendly + * format. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedParameterExceptionMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedParameterExceptionMapper.java index 21cb4fdbd..9f3b40f40 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedParameterExceptionMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exceptionmapper/UnsupportedParameterExceptionMapper.java @@ -32,8 +32,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * An {@link ExceptionMapper} to map {@link UnsupportedParameterException} - * thrown by platform into a HTTP API friendly format. + * An {@link ExceptionMapper} to map {@link UnsupportedParameterException} thrown by platform into a HTTP API friendly + * format. */ @Provider @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/filters/ResponseCorsFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/filters/ResponseCorsFilter.java index 1ad64e6fb..a3fad864d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/filters/ResponseCorsFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/filters/ResponseCorsFilter.java @@ -25,8 +25,8 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; /** - * Filter that returns a response with headers that allows for Cross-Origin - * Requests (CORs) to be performed against the platform API. + * Filter that returns a response with headers that allows for Cross-Origin Requests (CORs) to be performed against the + * platform API. */ public class ResponseCorsFilter implements ContainerResponseFilter { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromApiJsonDeserializer.java index 5b2db9fa5..643c4caef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromApiJsonDeserializer.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.serialization; /** - * Abstract implementation of {@link FromApiJsonDeserializer} that can be - * extended for specific commands. + * Abstract implementation of {@link FromApiJsonDeserializer} that can be extended for specific commands. */ public abstract class AbstractFromApiJsonDeserializer implements FromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromCommandJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromCommandJsonDeserializer.java index 63ff3c65b..c74abbf07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromCommandJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/AbstractFromCommandJsonDeserializer.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.core.serialization; /** - * Abstract implementation of {@link FromCommandJsonDeserializer} that can be - * extended for specific commands. + * Abstract implementation of {@link FromCommandJsonDeserializer} that can be extended for specific commands. */ public abstract class AbstractFromCommandJsonDeserializer implements FromCommandJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/ApiRequestJsonSerializationSettings.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/ApiRequestJsonSerializationSettings.java index 7f1b501e7..2104a63e3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/ApiRequestJsonSerializationSettings.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/ApiRequestJsonSerializationSettings.java @@ -21,8 +21,8 @@ package org.apache.fineract.infrastructure.core.serialization; import java.util.Set; /** - * A class to encapsulate settings we allow on API that affect how JSON is to be - * serialized for the response to api call. + * A class to encapsulate settings we allow on API that affect how JSON is to be serialized for the response to api + * call. */ public class ApiRequestJsonSerializationSettings { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/CommandSerializerDefaultToJson.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/CommandSerializerDefaultToJson.java index 301f9d824..8d9f5dbb9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/CommandSerializerDefaultToJson.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/CommandSerializerDefaultToJson.java @@ -22,8 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link CommandSerializer} that serializes the commands into - * JSON using google-gson. + * Implementation of {@link CommandSerializer} that serializes the commands into JSON using google-gson. */ @Component public class CommandSerializerDefaultToJson implements CommandSerializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/DefaultToApiJsonSerializer.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/DefaultToApiJsonSerializer.java index df21a88d0..12251ce43 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/DefaultToApiJsonSerializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/DefaultToApiJsonSerializer.java @@ -26,8 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * An abstract helper implementation of {@link ToApiJsonSerializer} for - * resources to serialize their Java data objects into JSON. + * An abstract helper implementation of {@link ToApiJsonSerializer} for resources to serialize their Java data objects + * into JSON. */ @Component public final class DefaultToApiJsonSerializer implements ToApiJsonSerializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java index 26d66c219..b990439a3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java @@ -118,10 +118,9 @@ public class FromJsonHelper { /** * @param parentPropertyName - * The full json path to this property,the value is appended to - * the parameter name while generating an error message
- * Ex: property "name" in Object "person" would be named as - * "person.name" + * The full json path to this property,the value is appended to the parameter name while generating an + * error message
+ * Ex: property "name" in Object "person" would be named as "person.name" * @param object * @param supportedParams */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java index 7286244c6..a1f827880 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java @@ -157,11 +157,10 @@ public class JsonParserHelper { } /** - * Method used to extract integers from unformatted strings. Ex: "1" , - * "100002" etc + * Method used to extract integers from unformatted strings. Ex: "1" , "100002" etc * - * Please note that this method does not support extracting Integers from - * locale specific formatted strings Ex "1,000" etc + * Please note that this method does not support extracting Integers from locale specific formatted strings Ex + * "1,000" etc * * @param parameterName * @param element diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/AbandonedConnectionCleanupShutdownListener.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/AbandonedConnectionCleanupShutdownListener.java index cad8f5c7b..f7d297534 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/AbandonedConnectionCleanupShutdownListener.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/AbandonedConnectionCleanupShutdownListener.java @@ -34,8 +34,8 @@ public class AbandonedConnectionCleanupShutdownListener implements ApplicationLi private static final Logger LOG = LoggerFactory.getLogger(AbandonedConnectionCleanupShutdownListener.class); /** - * @see JobRegisterServiceImpl#onApplicationEvent(ContextClosedEvent) doc - * re. why we use ContextClosedEvent instead of ContextStoppedEvent + * @see JobRegisterServiceImpl#onApplicationEvent(ContextClosedEvent) doc re. why we use ContextClosedEvent instead + * of ContextStoppedEvent */ @Override public void onApplicationEvent(@SuppressWarnings("unused") ContextClosedEvent event) { @@ -46,12 +46,9 @@ public class AbandonedConnectionCleanupShutdownListener implements ApplicationLi /* * try { * - * AbandonedConnectionCleanupThread.shutdown(); tomcat memoroy leak with - * mysql connector. With Drizzle not required - * LOG.info("Shut-down of AbandonedConnectionCleanupThread successful"); - * } catch (Throwable t) { LOG. - * error("Exception occurred while shut-down of AbandonedConnectionCleanupThread" - * , t); } + * AbandonedConnectionCleanupThread.shutdown(); tomcat memoroy leak with mysql connector. With Drizzle not + * required LOG.info("Shut-down of AbandonedConnectionCleanupThread successful"); } catch (Throwable t) { LOG. + * error("Exception occurred while shut-down of AbandonedConnectionCleanupThread" , t); } */ // This manually deregisters JDBC driver, which prevents Tomcat 7 from diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSource.java index fb2117cb9..0a63c7752 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSource.java @@ -27,14 +27,13 @@ import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; import org.springframework.stereotype.Service; /** - * Based on springs {@link AbstractRoutingDataSource} idea, this is a - * {@link DataSource} that routes or delegates to another data source depending - * on the tenant details passed in the request. + * Based on springs {@link AbstractRoutingDataSource} idea, this is a {@link DataSource} that routes or delegates to + * another data source depending on the tenant details passed in the request. * * The tenant details are process earlier and stored in a {@link ThreadLocal}. * - * The {@link RoutingDataSourceService} is responsible for returning the - * appropriate {@link DataSource} for the tenant of this request. + * The {@link RoutingDataSourceService} is responsible for returning the appropriate {@link DataSource} for the tenant + * of this request. */ @Service(value = "routingDataSource") public class RoutingDataSource extends AbstractDataSource { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceService.java index dff9b53a7..343ef1c81 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceService.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.core.service; import javax.sql.DataSource; /** - * A service for getting hold of the appropriate {@link DataSource} connection - * pool. + * A service for getting hold of the appropriate {@link DataSource} connection pool. */ public interface RoutingDataSourceService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceServiceFactory.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceServiceFactory.java old mode 100755 new mode 100644 index f16a5a4d4..112cd44e6 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceServiceFactory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/RoutingDataSourceServiceFactory.java @@ -23,8 +23,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; /** - * Factory class to get data source service based on the details stored in - * {@link ThreadLocal} variable for this request + * Factory class to get data source service based on the details stored in {@link ThreadLocal} variable for this request * * {@link ThreadLocalContextUtil} is used to retrieve the Context * diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/SearchParameters.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/SearchParameters.java index 0d4250559..f51efd684 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/SearchParameters.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/SearchParameters.java @@ -478,8 +478,7 @@ public final class SearchParameters { } /** - * creates an instance of the SearchParameters from a request for the report - * mailing job run history + * creates an instance of the SearchParameters from a request for the report mailing job run history * * @return SearchParameters object **/ @@ -492,8 +491,7 @@ public final class SearchParameters { } /** - * creates an instance of the {@link SearchParameters} from a request for - * the report mailing job + * creates an instance of the {@link SearchParameters} from a request for the report mailing job * * @return {@link SearchParameters} object */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java index b4ac1e5ae..c6a0aa63b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java @@ -38,8 +38,7 @@ import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.stereotype.Service; /** - * A service that picks up on tenants that are configured to auto-update their - * specific schema on application startup. + * A service that picks up on tenants that are configured to auto-update their specific schema on application startup. */ @Service public class TenantDatabaseUpgradeService { @@ -94,8 +93,7 @@ public class TenantDatabaseUpgradeService { } /** - * Initializes, and if required upgrades (using Flyway) the Tenant DB - * itself. + * Initializes, and if required upgrades (using Flyway) the Tenant DB itself. */ private void upgradeTenantDB() { String dbHostname = getEnvVar("FINERACT_DEFAULT_TENANTDB_HOSTNAME", "localhost"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java index c363ceb29..d9e941b07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java @@ -31,12 +31,10 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; /** - * Implementation that returns a new or existing connection pool datasource - * based on the tenant details stored in a {@link ThreadLocal} variable for this - * request. + * Implementation that returns a new or existing connection pool datasource based on the tenant details stored in a + * {@link ThreadLocal} variable for this request. * - * {@link ThreadLocalContextUtil} is used to retrieve the - * {@link FineractPlatformTenant} for the request. + * {@link ThreadLocalContextUtil} is used to retrieve the {@link FineractPlatformTenant} for the request. */ @Service public class TomcatJdbcDataSourcePerTenantService implements RoutingDataSourceService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/ResultsetColumnValueData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/ResultsetColumnValueData.java index 7f561fc0f..9a9e8a100 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/ResultsetColumnValueData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/ResultsetColumnValueData.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.dataqueries.data; import java.io.Serializable; /** - * Immutable data object representing a possible value for a given resultset - * column. + * Immutable data object representing a possible value for a given resultset column. */ public class ResultsetColumnValueData implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java index 6665154dc..2cdc460a9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java @@ -51,19 +51,14 @@ public final class ReportParameterUsage extends AbstractPersistableCustom { } /* - * @Override public boolean equals(final Object obj) { if (obj == null) { - * return false; } if (obj == this) { return true; } if (obj.getClass() != - * getClass()) { return false; } final ReportParameterUsage rhs = - * (ReportParameterUsage) obj; return new - * EqualsBuilder().appendSuper(super.equals(obj)) // .append(getId(), - * rhs.getId()) // .append(this.report.getId(), rhs.report.getId()) // - * .append(this.parameter.getId(), rhs.parameter.getId()) // - * .append(this.reportParameterName, rhs.reportParameterName) // - * .isEquals(); } + * @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return + * true; } if (obj.getClass() != getClass()) { return false; } final ReportParameterUsage rhs = + * (ReportParameterUsage) obj; return new EqualsBuilder().appendSuper(super.equals(obj)) // .append(getId(), + * rhs.getId()) // .append(this.report.getId(), rhs.report.getId()) // .append(this.parameter.getId(), + * rhs.parameter.getId()) // .append(this.reportParameterName, rhs.reportParameterName) // .isEquals(); } * - * @Override public int hashCode() { return new HashCodeBuilder(3, 5) // - * .append(getId()) // .append(this.report.getId()) // - * .append(this.parameter.getId()) // .append(this.reportParameterName) // + * @Override public int hashCode() { return new HashCodeBuilder(3, 5) // .append(getId()) // + * .append(this.report.getId()) // .append(this.parameter.getId()) // .append(this.reportParameterName) // * .toHashCode(); } */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportRepositoryWrapper.java index 3772c0487..ef22cb23c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportRepositoryWrapper.java @@ -23,9 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** - * A wrapper class for the ReportRepository that provides a method that returns - * a Report entity if it exists, else throws "ReportNotFoundException" exception - * if the Report does not exist + * A wrapper class for the ReportRepository that provides a method that returns a Report entity if it exists, else + * throws "ReportNotFoundException" exception if the Report does not exist **/ @Service public class ReportRepositoryWrapper { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/exception/DatatableEntryRequiredException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/exception/DatatableEntryRequiredException.java index 90a540e7e..5f78ead74 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/exception/DatatableEntryRequiredException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/exception/DatatableEntryRequiredException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.dataqueries.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link AbstractPlatformDomainRuleException} thrown when datatable resources - * are not found. + * A {@link AbstractPlatformDomainRuleException} thrown when datatable resources are not found. */ public class DatatableEntryRequiredException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java index e28e5b5b4..6fdebe74a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java @@ -263,8 +263,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleReportDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dae) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java index 288ffacf7..824fe444b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java @@ -254,8 +254,7 @@ public class GenericDataServiceImpl implements GenericDataService { } /* - * Candidate for using caching there to get allowed 'column values' from - * code/codevalue tables + * Candidate for using caching there to get allowed 'column values' from code/codevalue tables */ private List retreiveColumnValues(final String codeName) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java index c39d2810b..b0e72b130 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java @@ -449,16 +449,12 @@ public class ReadReportingServiceImpl implements ReadReportingService { return sql; /* - * used to only return reports that the use can run as done in - * report UI but not necessary as there is a read_report permission - * which should give user access to look all reports + - * " where exists" + " (select 'f'" + " from m_appuser_role ur " + - * " join m_role r on r.id = ur.role_id" + + * used to only return reports that the use can run as done in report UI but not necessary as there is a + * read_report permission which should give user access to look all reports + " where exists" + + * " (select 'f'" + " from m_appuser_role ur " + " join m_role r on r.id = ur.role_id" + * " left join m_role_permission rp on rp.role_id = r.id" + - * " left join m_permission p on p.id = rp.permission_id" + - * " where ur.appuser_id = " + userId + - * " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', r.report_name))) " - * ; + * " left join m_permission p on p.id = rp.permission_id" + " where ur.appuser_id = " + userId + + * " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', r.report_name))) " ; */ } @@ -547,73 +543,56 @@ public class ReadReportingServiceImpl implements ReadReportingService { // This complete implementation should be moved to Pentaho Report // Service /* - * String outputType = "HTML"; if - * (StringUtils.isNotBlank(outputTypeParam)) { outputType = - * outputTypeParam; } + * String outputType = "HTML"; if (StringUtils.isNotBlank(outputTypeParam)) { outputType = outputTypeParam; } * - * if (!(outputType.equalsIgnoreCase("HTML") || - * outputType.equalsIgnoreCase("PDF") || - * outputType.equalsIgnoreCase("XLS") || outputType - * .equalsIgnoreCase("CSV"))) { throw new - * PlatformDataIntegrityException("error.msg.invalid.outputType", - * "No matching Output Type: " + outputType); } + * if (!(outputType.equalsIgnoreCase("HTML") || outputType.equalsIgnoreCase("PDF") || + * outputType.equalsIgnoreCase("XLS") || outputType .equalsIgnoreCase("CSV"))) { throw new + * PlatformDataIntegrityException("error.msg.invalid.outputType", "No matching Output Type: " + outputType); } * - * if (this.noPentaho) { throw new - * PlatformDataIntegrityException("error.msg.no.pentaho", + * if (this.noPentaho) { throw new PlatformDataIntegrityException("error.msg.no.pentaho", * "Pentaho is not enabled", "Pentaho is not enabled"); } * - * final String reportPath = - * FileSystemContentRepository.FINERACT_BASE_DIR + File.separator + - * "pentahoReports" + File.separator + reportName + ".prpt"; - * LOG.info("Report path: {}", reportPath); + * final String reportPath = FileSystemContentRepository.FINERACT_BASE_DIR + File.separator + "pentahoReports" + + * File.separator + reportName + ".prpt"; LOG.info("Report path: {}", reportPath); * - * // load report definition final ResourceManager manager = new - * ResourceManager(); manager.registerDefaults(); Resource res; + * // load report definition final ResourceManager manager = new ResourceManager(); manager.registerDefaults(); + * Resource res; * - * try { res = manager.createDirectly(reportPath, MasterReport.class); - * final MasterReport masterReport = (MasterReport) res.getResource(); - * final DefaultReportEnvironment reportEnvironment = + * try { res = manager.createDirectly(reportPath, MasterReport.class); final MasterReport masterReport = + * (MasterReport) res.getResource(); final DefaultReportEnvironment reportEnvironment = * (DefaultReportEnvironment) masterReport.getReportEnvironment(); * - * if (locale != null) { reportEnvironment.setLocale(locale); } - * addParametersToReport(masterReport, queryParams, runReportAsUser, - * errorLog); + * if (locale != null) { reportEnvironment.setLocale(locale); } addParametersToReport(masterReport, queryParams, + * runReportAsUser, errorLog); * * final ByteArrayOutputStream baos = new ByteArrayOutputStream(); * - * if ("PDF".equalsIgnoreCase(outputType)) { - * PdfReportUtil.createPDF(masterReport, baos); return baos; } + * if ("PDF".equalsIgnoreCase(outputType)) { PdfReportUtil.createPDF(masterReport, baos); return baos; } * - * if ("XLS".equalsIgnoreCase(outputType)) { - * ExcelReportUtil.createXLS(masterReport, baos); return baos; } + * if ("XLS".equalsIgnoreCase(outputType)) { ExcelReportUtil.createXLS(masterReport, baos); return baos; } * - * if ("CSV".equalsIgnoreCase(outputType)) { - * CSVReportUtil.createCSV(masterReport, baos, "UTF-8"); return baos; } + * if ("CSV".equalsIgnoreCase(outputType)) { CSVReportUtil.createCSV(masterReport, baos, "UTF-8"); return baos; + * } * - * if ("HTML".equalsIgnoreCase(outputType)) { - * HtmlReportUtil.createStreamHTML(masterReport, baos); return baos; } + * if ("HTML".equalsIgnoreCase(outputType)) { HtmlReportUtil.createStreamHTML(masterReport, baos); return baos; + * } * * } catch (final ResourceException e) { errorLog. * append("ReadReportingServiceImpl.generatePentahoReportAsOutputStream method threw a Pentaho ResourceException " * + "exception: " + e.getMessage() + " ---------- "); throw new - * PlatformDataIntegrityException("error.msg.reporting.error", - * e.getMessage()); } catch (final ReportProcessingException e) { - * errorLog. + * PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); } catch (final + * ReportProcessingException e) { errorLog. * append("ReadReportingServiceImpl.generatePentahoReportAsOutputStream method threw a Pentaho ReportProcessingException " * + "exception: " + e.getMessage() + " ---------- "); throw new - * PlatformDataIntegrityException("error.msg.reporting.error", - * e.getMessage()); } catch (final IOException e) { errorLog. - * append("ReadReportingServiceImpl.generatePentahoReportAsOutputStream method threw an IOException " + * PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); } catch (final IOException e) { + * errorLog. append("ReadReportingServiceImpl.generatePentahoReportAsOutputStream method threw an IOException " * + "exception: " + e.getMessage() + " ---------- "); throw new - * PlatformDataIntegrityException("error.msg.reporting.error", - * e.getMessage()); } + * PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); } * * errorLog. * append("ReadReportingServiceImpl.generatePentahoReportAsOutputStream method threw a PlatformDataIntegrityException " - * + "exception: No matching Output Type: " + outputType + - * " ---------- "); throw new - * PlatformDataIntegrityException("error.msg.invalid.outputType", - * "No matching Output Type: " + outputType); + * + "exception: No matching Output Type: " + outputType + " ---------- "); throw new + * PlatformDataIntegrityException("error.msg.invalid.outputType", "No matching Output Type: " + outputType); * */ return null; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java index 4d52941c6..69a18f97c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java @@ -571,11 +571,10 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ Boolean multiRow = this.fromJsonHelper.extractBooleanNamed("multiRow", element); /*** - * In cases of tables storing hierarchical entities (like m_group), - * different entities would end up being stored in the same table. + * In cases of tables storing hierarchical entities (like m_group), different entities would end up being + * stored in the same table. * - * Ex: Centers are a specific type of group, add abstractions for - * the same + * Ex: Centers are a specific type of group, add abstractions for the same ***/ final String actualAppTableName = mapToActualAppTable(apptableName); @@ -850,8 +849,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ } /** - * Update data table, set column value to empty string where current value - * is NULL. Run update SQL only if the "mandatory" property is set to true + * Update data table, set column value to empty string where current value is NULL. Run update SQL only if the + * "mandatory" property is set to true * * @param datatableName * Name of data table @@ -1303,18 +1302,15 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ private String dataScopedSQL(final String appTable, final Long appTableId) { /* - * unfortunately have to, one way or another, be able to restrict data - * to the users office hierarchy. Here, a few key tables are done. But - * if additional fields are needed on other tables the same pattern - * applies + * unfortunately have to, one way or another, be able to restrict data to the users office hierarchy. Here, a + * few key tables are done. But if additional fields are needed on other tables the same pattern applies */ final AppUser currentUser = this.context.authenticatedUser(); String scopedSQL = null; /* - * m_loan and m_savings_account are connected to an m_office thru either - * an m_client or an m_group If both it means it relates to an m_client - * that is in a group (still an m_client account) + * m_loan and m_savings_account are connected to an m_office thru either an m_client or an m_group If both it + * means it relates to an m_client that is in a group (still an m_client account) */ if (appTable.equalsIgnoreCase("m_loan")) { scopedSQL = "select distinctrow x.* from (" @@ -1488,8 +1484,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ } /** - * This method is used special for ppi cases Where the score need to be - * computed + * This method is used special for ppi cases Where the score need to be computed * * @param columnHeaders * @param datatable diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java index 1e507a594..61f7e8d9e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java @@ -174,8 +174,7 @@ public class ReportWritePlatformServiceImpl implements ReportWritePlatformServic } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleReportDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java index d5b8a8b03..2aa88d349 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java @@ -132,13 +132,12 @@ public class DocumentManagementApiResource { @FormDataParam("description") @ApiParam(value = "description") final String description) { /** - * TODO: also need to have a backup and stop reading from stream after - * max size is reached to protect against malicious clients + * TODO: also need to have a backup and stop reading from stream after max size is reached to protect against + * malicious clients **/ /** - * TODO: need to extract the actual file type and determine if they are - * permissable + * TODO: need to extract the actual file type and determine if they are permissable **/ final DocumentCommand documentCommand = new DocumentCommand(null, null, entityType, entityId, name, fileDetails.getFileName(), fileSize, bodyPart.getMediaType().toString(), description, null); @@ -172,8 +171,7 @@ public class DocumentManagementApiResource { modifiedParams.add("description"); /*** - * Populate Document command based on whether a file has also been - * passed in as a part of the update + * Populate Document command based on whether a file has also been passed in as a part of the update ***/ DocumentCommand documentCommand = null; if (inputStream != null && fileDetails.getFileName() != null) { @@ -188,8 +186,7 @@ public class DocumentManagementApiResource { null); } /*** - * TODO: does not return list of changes, should be done for consistency - * with rest of API + * TODO: does not return list of changes, should be done for consistency with rest of API **/ final CommandProcessingResult identifier = this.documentWritePlatformService.updateDocument(documentCommand, inputStream); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java index f042b16a9..d587b7b95 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java @@ -173,8 +173,8 @@ public class ImagesApiResource { } /** - * This method is added only for consistency with other URL patterns and for - * maintaining consistency of usage of the HTTP "verb" at the client side + * This method is added only for consistency with other URL patterns and for maintaining consistency of usage of the + * HTTP "verb" at the client side */ @PUT @Consumes({ MediaType.MULTIPART_FORM_DATA }) @@ -186,8 +186,8 @@ public class ImagesApiResource { } /** - * This method is added only for consistency with other URL patterns and for - * maintaining consistency of usage of the HTTP "verb" at the client side + * This method is added only for consistency with other URL patterns and for maintaining consistency of usage of the + * HTTP "verb" at the client side * * Upload image as a Data URL (essentially a base64 encoded stream) */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java index 449438ad3..62ff738c0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java @@ -150,10 +150,9 @@ public class ContentRepositoryUtils { public static void validateFileSizeWithinPermissibleRange(final Long fileSize, final String name) { /** - * Using Content-Length gives me size of the entire request, which is - * good enough for now for a fast fail as the length of the rest of the - * content i.e name and description while compared to the uploaded file - * size is negligible + * Using Content-Length gives me size of the entire request, which is good enough for now for a fast fail as the + * length of the rest of the content i.e name and description while compared to the uploaded file size is + * negligible **/ if (fileSize != null && ((fileSize / (1024 * 1024)) > ContentRepository.MAX_FILE_UPLOAD_SIZE_IN_MB)) { throw new ContentManagementException(name, fileSize, ContentRepository.MAX_FILE_UPLOAD_SIZE_IN_MB); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java index ae9b4263c..655f77106 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/InvalidEntityTypeForDocumentManagementException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.documentmanagement.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when document management functionality is - * invoked for invalid Entity Types + * A {@link RuntimeException} thrown when document management functionality is invoked for invalid Entity Types */ public class InvalidEntityTypeForDocumentManagementException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java index 540f685e7..f0010ef07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java @@ -24,8 +24,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link FineractEntityAccessRepository} that adds NULL checking - * and Error handling capabilities + * Wrapper for {@link FineractEntityAccessRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java index faa96d234..2f2d4e4da 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java @@ -44,10 +44,8 @@ public class FineractEntityRelation extends AbstractPersistableCustom { private String codeName; /* - * private FineractEntityRelation(final String fromEntityType, final String - * toEntityType, final String codeName) { this.fromEntityType = - * fromEntityType; this.toEntityType = toEntityType; this.codeName = - * codeName; } + * private FineractEntityRelation(final String fromEntityType, final String toEntityType, final String codeName) { + * this.fromEntityType = fromEntityType; this.toEntityType = toEntityType; this.codeName = codeName; } */ public FineractEntityRelation() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java index 40f869e6e..396fbf008 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java @@ -125,14 +125,12 @@ public class FineractEntityToEntityMapping extends AbstractPersistableCustom { } /* - * public Date getStartDate() { Date startDate = null; if (this.startDate != - * null) { startDate = Date.fromDateFields(this.startDate); } return - * startDate; } + * public Date getStartDate() { Date startDate = null; if (this.startDate != null) { startDate = + * Date.fromDateFields(this.startDate); } return startDate; } */ /* - * public Date getStartDate() { return (Date) ObjectUtils.defaultIfNull(new - * Date(this.startDate), null); } + * public Date getStartDate() { return (Date) ObjectUtils.defaultIfNull(new Date(this.startDate), null); } */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/NotOfficeSpecificProductException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/NotOfficeSpecificProductException.java index d5a636d50..164eecfd8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/NotOfficeSpecificProductException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/NotOfficeSpecificProductException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.entityaccess.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when valid api request end up violating - * some domain rule. + * A {@link RuntimeException} thrown when valid api request end up violating some domain rule. */ public class NotOfficeSpecificProductException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java index 15e62924c..72052ac92 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java @@ -59,16 +59,13 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess * (non-Javadoc) * * @see org.apache.fineract.infrastructure.entityaccess.service. - * FineractEntityAccessReadService#getSQLQueryWithListOfIDsForEntityAccess - * (Long, org.apache.fineract.infrastructure.entityaccess.domain. - * FineractEntityType, - * org.apache.fineract.infrastructure.entityaccess.domain. - * FineractEntityAccessType, - * org.apache.fineract.infrastructure.entityaccess.domain. - * FineractEntityType, boolean) + * FineractEntityAccessReadService#getSQLQueryWithListOfIDsForEntityAccess (Long, + * org.apache.fineract.infrastructure.entityaccess.domain. FineractEntityType, + * org.apache.fineract.infrastructure.entityaccess.domain. FineractEntityAccessType, + * org.apache.fineract.infrastructure.entityaccess.domain. FineractEntityType, boolean) * - * This method returns the list of entity IDs as a comma separated list Or - * null if there is no entity restrictions or if there + * This method returns the list of entity IDs as a comma separated list Or null if there is no entity restrictions + * or if there */ @Override public String getSQLQueryInClause_WithListOfIDsForEntityAccess(FineractEntityType firstEntityType, final Long relId, diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java index 27cd7e5ad..fbd8f53f3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java @@ -36,11 +36,9 @@ public interface FineractEntityAccessWriteService { final Long secondEntityId); /* - * CommandProcessingResult updateEntityAccess ( final Long entityAccessId, - * final JsonCommand command); + * CommandProcessingResult updateEntityAccess ( final Long entityAccessId, final JsonCommand command); * - * CommandProcessingResult removeEntityAccess ( final String entityType, - * final Long entityId, final Long accessType, final String - * secondEntityType, final Long secondEntityId); + * CommandProcessingResult removeEntityAccess ( final String entityType, final Long entityId, final Long accessType, + * final String secondEntityType, final Long secondEntityId); */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java index 8deabfb8f..849c4ce7d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java @@ -184,13 +184,11 @@ public class FineractEntityAccessWriteServiceImpl implements FineractEntityAcces } /* - * @Override public CommandProcessingResult updateEntityAccess(Long - * entityAccessId, JsonCommand command) { // TODO Auto-generated method stub - * return null; } + * @Override public CommandProcessingResult updateEntityAccess(Long entityAccessId, JsonCommand command) { // TODO + * Auto-generated method stub return null; } * - * @Override public CommandProcessingResult removeEntityAccess(String - * entityType, Long entityId, Long accessType, String secondEntityType, Long - * secondEntityId) { // TODO Auto-generated method stub return null; } + * @Override public CommandProcessingResult removeEntityAccess(String entityType, Long entityId, Long accessType, + * String secondEntityType, Long secondEntityId) { // TODO Auto-generated method stub return null; } */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/GcmConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/GcmConstants.java index c5c2470d4..3b37ea6fb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/GcmConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/GcmConstants.java @@ -59,15 +59,13 @@ public final class GcmConstants { public static final String PARAM_DELAY_WHILE_IDLE = "delay_while_idle"; /** - * HTTP parameter for telling gcm to validate the message without actually - * sending it. + * HTTP parameter for telling gcm to validate the message without actually sending it. */ public static final String PARAM_DRY_RUN = "dry_run"; /** - * HTTP parameter for package name that can be used to restrict message - * delivery by matching against the package name used to generate the - * registration id. + * HTTP parameter for package name that can be used to restrict message delivery by matching against the package + * name used to generate the registration id. */ public static final String PARAM_RESTRICTED_PACKAGE_NAME = "restricted_package_name"; @@ -97,22 +95,19 @@ public final class GcmConstants { public static final String MESSAGE_PRIORITY_HIGH = "high"; /** - * A particular message could not be sent because the GCM servers were not - * available. Used only on JSON requests, as in plain text requests - * unavailability is indicated by a 503 response. + * A particular message could not be sent because the GCM servers were not available. Used only on JSON requests, as + * in plain text requests unavailability is indicated by a 503 response. */ public static final String ERROR_UNAVAILABLE = "Unavailable"; /** - * A particular message could not be sent because the GCM servers - * encountered an error. Used only on JSON requests, as in plain text - * requests internal errors are indicated by a 500 response. + * A particular message could not be sent because the GCM servers encountered an error. Used only on JSON requests, + * as in plain text requests internal errors are indicated by a 500 response. */ public static final String ERROR_INTERNAL_SERVER_ERROR = "InternalServerError"; /** - * Token returned by GCM when the requested registration id has a canonical - * value. + * Token returned by GCM when the requested registration id has a canonical value. */ public static final String TOKEN_CANONICAL_REG_ID = "registration_id"; @@ -207,8 +202,7 @@ public final class GcmConstants { public static final String JSON_FAILURE = "failure"; /** - * JSON-only field representing the number of messages with a canonical - * registration id. + * JSON-only field representing the number of messages with a canonical registration id. */ public static final String JSON_CANONICAL_IDS = "canonical_ids"; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Message.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Message.java index 7da0771f6..fdfd53609 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Message.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Message.java @@ -28,8 +28,7 @@ import org.apache.fineract.infrastructure.gcm.GcmConstants; * GCM message. * *

- * Instances of this class are immutable and should be created using a - * {@link Builder}. Examples: + * Instances of this class are immutable and should be created using a {@link Builder}. Examples: * * Simplest message: * diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/MulticastResult.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/MulticastResult.java index 4980bd17b..67ee75122 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/MulticastResult.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/MulticastResult.java @@ -112,8 +112,7 @@ public final class MulticastResult implements Serializable { } /** - * Gets the number of successful messages that also returned a canonical - * registration id. + * Gets the number of successful messages that also returned a canonical registration id. */ public int getCanonicalIds() { return canonicalIds; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Notification.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Notification.java index 0183b24b3..cc6213c29 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Notification.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Notification.java @@ -26,8 +26,7 @@ import java.util.List; * GCM message notification part. * *

- * Instances of this class are immutable and should be created using a - * {@link Builder}. Examples: + * Instances of this class are immutable and should be created using a {@link Builder}. Examples: * * Simplest notification: * diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Result.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Result.java index 782502745..54b679c89 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Result.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Result.java @@ -25,16 +25,14 @@ import java.util.List; * Result of a GCM message request that returned HTTP status code 200. * *

- * If the message is successfully created, the {@link #getMessageId()} returns - * the message id and {@link #getErrorCodeName()} returns {@literal null}; - * otherwise, {@link #getMessageId()} returns {@literal null} and + * If the message is successfully created, the {@link #getMessageId()} returns the message id and + * {@link #getErrorCodeName()} returns {@literal null}; otherwise, {@link #getMessageId()} returns {@literal null} and * {@link #getErrorCodeName()} returns the code of the error. * *

- * There are cases when a request is accept and the message successfully - * created, but GCM has a canonical registration id for that device. In this - * case, the server should update the registration id to avoid rejected requests - * in the future. + * There are cases when a request is accept and the message successfully created, but GCM has a canonical registration + * id for that device. In this case, the server should update the registration id to avoid rejected requests in the + * future. * *

* In a nutshell, the workflow to handle a result is: diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java index 3beeff11a..312a59ef0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java @@ -116,8 +116,8 @@ public class Sender { } /** - * Set the underlying URLConnection's connect timeout (in milliseconds). A - * timeout value of 0 specifies an infinite timeout. + * Set the underlying URLConnection's connect timeout (in milliseconds). A timeout value of 0 specifies an infinite + * timeout. *

* Default is the system's default timeout. * @@ -131,8 +131,8 @@ public class Sender { } /** - * Set the underlying URLConnection's read timeout (in milliseconds). A - * timeout value of 0 specifies an infinite timeout. + * Set the underlying URLConnection's read timeout (in milliseconds). A timeout value of 0 specifies an infinite + * timeout. *

* Default is the system's default timeout. * @@ -149,15 +149,13 @@ public class Sender { * Sends a message to one device, retrying in case of unavailability. * *

- * Note: this method uses exponential back-off to retry in - * case of service unavailability and hence could block the calling thread - * for many seconds. + * Note: this method uses exponential back-off to retry in case of service unavailability and + * hence could block the calling thread for many seconds. * * @param message * message to be sent, including the device's registration id. * @param to - * registration token, notification key, or topic where the - * message will be sent. + * registration token, notification key, or topic where the message will be sent. * @param retries * number of retries in case of service unavailability errors. * @@ -197,12 +195,11 @@ public class Sender { } /** - * Sends a message without retrying in case of service unavailability. See - * {@link #send(Message, String, int)} for more info. + * Sends a message without retrying in case of service unavailability. See {@link #send(Message, String, int)} for + * more info. * - * @return result of the post, or {@literal null} if the GCM service was - * unavailable or any network exception caused the request to fail, - * or if the response contains more than one result. + * @return result of the post, or {@literal null} if the GCM service was unavailable or any network exception caused + * the request to fail, or if the response contains more than one result. * * @throws InvalidRequestException * if GCM didn't returned a 200 status. @@ -300,9 +297,8 @@ public class Sender { * Sends a message to many devices, retrying in case of unavailability. * *

- * Note: this method uses exponential back-off to retry in - * case of service unavailability and hence could block the calling thread - * for many seconds. + * Note: this method uses exponential back-off to retry in case of service unavailability and + * hence could block the calling thread for many seconds. * * @param message * message to be sent. @@ -391,8 +387,7 @@ public class Sender { } /** - * Updates the status of the messages sent to devices and the list of - * devices that should be retried. + * Updates the status of the messages sent to devices and the list of devices that should be retried. * * @param unsentRegIds * list of devices that are still pending an update. @@ -424,11 +419,11 @@ public class Sender { } /** - * Sends a message without retrying in case of service unavailability. See - * {@link #send(Message, List, int)} for more info. + * Sends a message without retrying in case of service unavailability. See {@link #send(Message, List, int)} for + * more info. * - * @return multicast results if the message was sent successfully, - * {@literal null} if it failed but could be retried. + * @return multicast results if the message was sent successfully, {@literal null} if it failed but could be + * retried. * * @throws IllegalArgumentException * if registrationIds is {@literal null} or empty. @@ -623,9 +618,8 @@ public class Sender { * Makes an HTTP POST request to a given endpoint. * *

- * Note: the returned connected should not be - * disconnected, otherwise it would kill persistent connections made using - * Keep-Alive. + * Note: the returned connected should not be disconnected, otherwise it would kill persistent + * connections made using Keep-Alive. * * @param url * endpoint to post the request. diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronMethodParser.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronMethodParser.java index 69e5900f9..cff50fbc1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronMethodParser.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronMethodParser.java @@ -65,8 +65,7 @@ public class CronMethodParser { } /** - * method adds all the method names to map with annotation attribute value - * as key + * method adds all the method names to map with annotation attribute value as key */ private static void findAnnotationMethods(final Class annotationClass, final String attributeName) throws IOException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java index 169532be4..bbbab50d2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java @@ -59,9 +59,8 @@ import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.stereotype.Service; /** - * Service class to create and load batch jobs to Scheduler using - * {@link SchedulerFactoryBean} ,{@link MethodInvokingJobDetailFactoryBean} and - * {@link CronTriggerFactoryBean} + * Service class to create and load batch jobs to Scheduler using {@link SchedulerFactoryBean} + * ,{@link MethodInvokingJobDetailFactoryBean} and {@link CronTriggerFactoryBean} */ @Service public class JobRegisterServiceImpl implements JobRegisterService, ApplicationListener { @@ -255,10 +254,9 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi } /** - * Need to use ContextClosedEvent instead of ContextStoppedEvent because in - * case Spring Boot fails to start-up (e.g. because Tomcat port is already - * in use) then org.springframework.boot.SpringApplication.run(String...) - * does a context.close(); and not a context.stop(); + * Need to use ContextClosedEvent instead of ContextStoppedEvent because in case Spring Boot fails to start-up (e.g. + * because Tomcat port is already in use) then org.springframework.boot.SpringApplication.run(String...) does a + * context.close(); and not a context.stop(); */ @Override public void onApplicationEvent(@SuppressWarnings("unused") ContextClosedEvent event) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java index 1ef28dfb9..257cf02b9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobListener.java @@ -37,9 +37,8 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; /** - * Global job Listener class to set Tenant details to - * {@link ThreadLocalContextUtil} for batch Job and stores the batch job status - * to database after the execution + * Global job Listener class to set Tenant details to {@link ThreadLocalContextUtil} for batch Job and stores the batch + * job status to database after the execution * */ @Component diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerStopListener.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerStopListener.java old mode 100755 new mode 100644 index 8103eaf6d..eb8c9612e --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerStopListener.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerStopListener.java @@ -25,8 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Global job Listener class to Stop the temporary scheduler once job execution - * completes + * Global job Listener class to Stop the temporary scheduler once job execution completes */ @Component public class SchedulerStopListener implements JobListener { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaDialect.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaDialect.java index db5a4328d..744b37430 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaDialect.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaDialect.java @@ -37,8 +37,8 @@ import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionException; /** - * {@link org.springframework.orm.jpa.JpaDialect} implementation for Apache - * OpenJPA. Developed and tested against OpenJPA 2.2. + * {@link org.springframework.orm.jpa.JpaDialect} implementation for Apache OpenJPA. Developed and tested against + * OpenJPA 2.2. * * @author Costin Leau * @author Juergen Hoeller @@ -94,8 +94,8 @@ public class OpenJpaDialect extends DefaultJpaDialect { } /** - * Transaction data Object exposed from {@code beginTransaction}, - * implementing the {@link SavepointManager} interface. + * Transaction data Object exposed from {@code beginTransaction}, implementing the {@link SavepointManager} + * interface. */ private static class OpenJpaTransactionData implements SavepointManager { @@ -131,11 +131,9 @@ public class OpenJpaDialect extends DefaultJpaDialect { } /** - * {@link ConnectionHandle} implementation that fetches a new - * OpenJPA-provided Connection for every {@code getConnection} call and - * closes the Connection on {@code releaseConnection}. This is necessary - * because OpenJPA requires the fetched Connection to be closed before - * continuing EntityManager work. + * {@link ConnectionHandle} implementation that fetches a new OpenJPA-provided Connection for every + * {@code getConnection} call and closes the Connection on {@code releaseConnection}. This is necessary because + * OpenJPA requires the fetched Connection to be closed before continuing EntityManager work. * * @see org.apache.openjpa.persistence.OpenJPAEntityManager#getConnection() */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaVendorAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaVendorAdapter.java index 02d4f9b7d..37b5c29c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaVendorAdapter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openjpa/OpenJpaVendorAdapter.java @@ -30,13 +30,12 @@ import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter; import org.springframework.orm.jpa.vendor.Database; /** - * {@link org.springframework.orm.jpa.JpaVendorAdapter} implementation for - * Apache OpenJPA. Developed and tested against OpenJPA 2.2. + * {@link org.springframework.orm.jpa.JpaVendorAdapter} implementation for Apache OpenJPA. Developed and tested against + * OpenJPA 2.2. * *

- * Exposes OpenJPA's persistence provider and EntityManager extension interface, - * and supports {@link AbstractJpaVendorAdapter}'s common configuration - * settings. + * Exposes OpenJPA's persistence provider and EntityManager extension interface, and supports + * {@link AbstractJpaVendorAdapter}'s common configuration settings. * * @author Costin Leau * @author Juergen Hoeller @@ -90,8 +89,7 @@ public class OpenJpaVendorAdapter extends AbstractJpaVendorAdapter { * * @param database * the specified database - * @return the OpenJPA database dictionary name, or {@code null} if none - * found + * @return the OpenJPA database dictionary name, or {@code null} if none found */ protected String determineDatabaseDictionary(Database database) { switch (database) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobEmailAttachmentFileFormat.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobEmailAttachmentFileFormat.java index 2360b8748..50a27e14c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobEmailAttachmentFileFormat.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobEmailAttachmentFileFormat.java @@ -147,8 +147,7 @@ public enum ReportMailingJobEmailAttachmentFileFormat { } /** - * get a {@link EnumOptionData} representation of the - * {@link ReportMailingJobEmailAttachmentFileFormat} object + * get a {@link EnumOptionData} representation of the {@link ReportMailingJobEmailAttachmentFileFormat} object * * @return {@link EnumOptionData} object */ @@ -160,8 +159,8 @@ public enum ReportMailingJobEmailAttachmentFileFormat { } /** - * get the {@link EnumOptionData} representation of all valid - * {@link ReportMailingJobEmailAttachmentFileFormat} objects + * get the {@link EnumOptionData} representation of all valid {@link ReportMailingJobEmailAttachmentFileFormat} + * objects * * @return List of {@link EnumOptionData} objects */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobStretchyReportParamDateOption.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobStretchyReportParamDateOption.java index 6cf84a8de..1894e1763 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobStretchyReportParamDateOption.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobStretchyReportParamDateOption.java @@ -46,8 +46,7 @@ public enum ReportMailingJobStretchyReportParamDateOption { } /** - * Creates a new {@link ReportMailingJobStretchyReportParamDateOption} - * object + * Creates a new {@link ReportMailingJobStretchyReportParamDateOption} object * * @param value * value of the enum constant @@ -68,8 +67,7 @@ public enum ReportMailingJobStretchyReportParamDateOption { } /** - * Creates a new {@link ReportMailingJobStretchyReportParamDateOption} - * object + * Creates a new {@link ReportMailingJobStretchyReportParamDateOption} object * * @param id * id of the enum constant @@ -125,8 +123,7 @@ public enum ReportMailingJobStretchyReportParamDateOption { } /** - * @return list of valid ReportMailingJobStretchyReportParamDateOption - * values + * @return list of valid ReportMailingJobStretchyReportParamDateOption values **/ public static Object[] validValues() { List validValues = new ArrayList<>(); @@ -141,8 +138,7 @@ public enum ReportMailingJobStretchyReportParamDateOption { } /** - * get a {@link EnumOptionData} representation of the - * {@link ReportMailingJobStretchyReportParamDateOption} object + * get a {@link EnumOptionData} representation of the {@link ReportMailingJobStretchyReportParamDateOption} object * * @return {@link EnumOptionData} object */ @@ -154,8 +150,8 @@ public enum ReportMailingJobStretchyReportParamDateOption { } /** - * get the {@link EnumOptionData} representation of all valid - * {@link ReportMailingJobStretchyReportParamDateOption} objects + * get the {@link EnumOptionData} representation of all valid {@link ReportMailingJobStretchyReportParamDateOption} + * objects * * @return List of {@link EnumOptionData} objects */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobTimelineData.java index e2ca6473e..4abc53ab4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/data/ReportMailingJobTimelineData.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.reportmailingjob.data; import org.joda.time.LocalDate; /** - * Immutable data object represent the timeline events of a report mailing job - * (creation) + * Immutable data object represent the timeline events of a report mailing job (creation) **/ @SuppressWarnings("unused") public class ReportMailingJobTimelineData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java index 70f535d98..ad5501c46 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java @@ -345,8 +345,7 @@ public class ReportMailingJob extends AbstractAuditableCustom { } /** - * delete the report mailing job, set the isDeleted property to 1 and alter - * the name + * delete the report mailing job, set the isDeleted property to 1 and alter the name * * **/ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepository.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepository.java index 39f1de8b2..42aabb8d1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepository.java @@ -25,8 +25,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; public interface ReportMailingJobRepository extends JpaRepository, JpaSpecificationExecutor { /** - * Returns all instances of {@link ReportMailingJob} where isActive is true - * and isDeleted is false + * Returns all instances of {@link ReportMailingJob} where isActive is true and isDeleted is false * * @return instances of {@link ReportMailingJob} */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepositoryWrapper.java index 068223fe9..2a4077a25 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepositoryWrapper.java @@ -33,8 +33,7 @@ public class ReportMailingJobRepositoryWrapper { } /** - * find report mailing job by ID, throw a "entity not found" exception if - * the job does not exist + * find report mailing job by ID, throw a "entity not found" exception if the job does not exist * * @param id * -- the identifier of the report mailing job to be found diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java index a0588f004..a1e27e1f6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.reportmailingjob.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when report mailing job configuration - * resources are not found. + * A {@link RuntimeException} thrown when report mailing job configuration resources are not found. **/ @SuppressWarnings("serial") public class ReportMailingJobConfigurationNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java index 0fe74ddb0..bdd86bc24 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.reportmailingjob.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when report mailing job resources are not - * found. + * A {@link RuntimeException} thrown when report mailing job resources are not found. **/ @SuppressWarnings("serial") public class ReportMailingJobNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobRunHistoryNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobRunHistoryNotFoundException.java index 9f7d57514..b413e1096 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobRunHistoryNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobRunHistoryNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.infrastructure.reportmailingjob.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when report mailing job run history - * resources are not found. + * A {@link RuntimeException} thrown when report mailing job run history resources are not found. **/ @SuppressWarnings("serial") public class ReportMailingJobRunHistoryNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/helper/IPv4Helper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/helper/IPv4Helper.java index 65f5543ff..89ee6b82e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/helper/IPv4Helper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/helper/IPv4Helper.java @@ -26,8 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * This utility provides methods to either convert an IPv4 address to its long - * format or a 32bit dotted format. + * This utility provides methods to either convert an IPv4 address to its long format or a 32bit dotted format. * * @see http://hawkee.com/snippet/9731/ */ @@ -151,8 +150,7 @@ public class IPv4Helper { /** * check if the java application is not running on a local machine * - * @return true if the application is not running on a local machine else - * false + * @return true if the application is not running on a local machine else false **/ public static boolean applicationIsNotRunningOnLocalMachine() { return !applicationIsRunningOnLocalMachine(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobEmailServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobEmailServiceImpl.java index 0c976db45..97c3b8611 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobEmailServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobEmailServiceImpl.java @@ -101,8 +101,7 @@ public class ReportMailingJobEmailServiceImpl implements ReportMailingJobEmailSe } /** - * get a report mailing job configuration object by name from collection of - * objects + * get a report mailing job configuration object by name from collection of objects * * @param name * -- the value of the name property diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformService.java index 1553fa59d..3285ece2a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformService.java @@ -26,8 +26,7 @@ import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJob public interface ReportMailingJobReadPlatformService { /** - * Retrieve all report mailing jobs that have the isDeleted property set to - * 0 + * Retrieve all report mailing jobs that have the isDeleted property set to 0 **/ Page retrieveAllReportMailingJobs(SearchParameters searchParameters); @@ -42,8 +41,7 @@ public interface ReportMailingJobReadPlatformService { ReportMailingJobData retrieveReportMailingJobEnumOptions(); /** - * Retrieve all active report mailing jobs that have their isDeleted - * property set to 0 + * Retrieve all active report mailing jobs that have their isDeleted property set to 0 **/ Collection retrieveAllActiveReportMailingJobs(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobRunHistoryReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobRunHistoryReadPlatformService.java index d4bcd83e9..081da7871 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobRunHistoryReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobRunHistoryReadPlatformService.java @@ -25,8 +25,7 @@ import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJob public interface ReportMailingJobRunHistoryReadPlatformService { /** - * Retrieve all report mailing run history with similar job id to the one - * passed + * Retrieve all report mailing run history with similar job id to the one passed * * @param reportMailingJobId * ReportMailingJob identifier diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java index 415b8d26b..7a343edc4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java @@ -351,8 +351,7 @@ public class ReportMailingJobWritePlatformServiceImpl implements ReportMailingJo } /** - * create the next recurring DateTime from recurrence pattern, start - * DateTime and current DateTime + * create the next recurring DateTime from recurrence pattern, start DateTime and current DateTime * * @param recurrencePattern * @param startDateTime diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/util/ReportMailingJobDateUtil.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/util/ReportMailingJobDateUtil.java index 18e6c539a..7357234e2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/util/ReportMailingJobDateUtil.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/util/ReportMailingJobDateUtil.java @@ -88,8 +88,7 @@ public class ReportMailingJobDateUtil { } /** - * get date as string based on the value of the - * {@link ReportMailingJobStretchyReportParamDateOption} object + * get date as string based on the value of the {@link ReportMailingJobStretchyReportParamDateOption} object * * @param reportMailingJobStretchyReportParamDateOption * {@link ReportMailingJobStretchyReportParamDateOption} Enum diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/validation/ReportMailingJobValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/validation/ReportMailingJobValidator.java index 9a7900a91..c65be8906 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/validation/ReportMailingJobValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/validation/ReportMailingJobValidator.java @@ -318,8 +318,7 @@ public class ReportMailingJobValidator { } /** - * throw a PlatformApiDataValidationException exception if there are - * validation errors + * throw a PlatformApiDataValidationException exception if there are validation errors * * @param dataValidationErrors * -- list of ApiParameterError objects diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/data/PlatformRequestLog.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/data/PlatformRequestLog.java index 923f03475..1ea75068a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/data/PlatformRequestLog.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/data/PlatformRequestLog.java @@ -25,8 +25,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.time.StopWatch; /** - * Immutable data object representing platform API request used for - * logging/debugging. + * Immutable data object representing platform API request used for logging/debugging. */ public final class PlatformRequestLog { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java index c5fbcba2f..5cc1901ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.security.exception; /** - * {@link RuntimeException} thrown when an invalid tenant identifier is used in - * request to platform. + * {@link RuntimeException} thrown when an invalid tenant identifier is used in request to platform. * * */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/NoAuthorizationException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/NoAuthorizationException.java index 29b759c0a..53b3d2126 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/NoAuthorizationException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/NoAuthorizationException.java @@ -19,8 +19,8 @@ package org.apache.fineract.infrastructure.security.exception; /** - * A {@link RuntimeException} that is thrown in the case where a user does not - * have sufficient authorization to execute operation on platform. + * A {@link RuntimeException} that is thrown in the case where a user does not have sufficient authorization to execute + * operation on platform. */ public class NoAuthorizationException extends RuntimeException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/ResetPasswordException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/ResetPasswordException.java index db2a26aa9..ae95341f6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/ResetPasswordException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/ResetPasswordException.java @@ -24,8 +24,8 @@ import org.apache.fineract.infrastructure.core.data.ApiParameterError; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; /** - * A {@link RuntimeException} that is thrown in the case where a user does not - * have sufficient authorization to execute operation on platform. + * A {@link RuntimeException} that is thrown in the case where a user does not have sufficient authorization to execute + * operation on platform. */ public class ResetPasswordException extends PlatformApiDataValidationException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/InsecureTwoFactorAuthenticationFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/InsecureTwoFactorAuthenticationFilter.java index d54927dc6..8ca71541b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/InsecureTwoFactorAuthenticationFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/InsecureTwoFactorAuthenticationFilter.java @@ -36,11 +36,9 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; /** - * A dummy {@link TwoFactorAuthenticationFilter} filter used when 'twofactor' - * environment profile is not active. + * A dummy {@link TwoFactorAuthenticationFilter} filter used when 'twofactor' environment profile is not active. * - * This filter adds 'TWOFACTOR_AUTHENTICATED' authority to every authenticated - * platform user. + * This filter adds 'TWOFACTOR_AUTHENTICATED' authority to every authenticated platform user. */ @Service(value = "twoFactorAuthFilter") @Profile("!twofactor") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java index 83f55a988..d7b2c3303 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java @@ -50,17 +50,14 @@ import org.springframework.stereotype.Service; /** * A customised version of spring security's {@link BasicAuthenticationFilter}. * - * This filter is responsible for extracting multi-tenant and basic auth - * credentials from the request and checking that the details provided are - * valid. + * This filter is responsible for extracting multi-tenant and basic auth credentials from the request and checking that + * the details provided are valid. * - * If multi-tenant and basic auth credentials are valid, the details of the - * tenant are stored in {@link FineractPlatformTenant} and stored in a - * {@link ThreadLocal} variable for this request using + * If multi-tenant and basic auth credentials are valid, the details of the tenant are stored in + * {@link FineractPlatformTenant} and stored in a {@link ThreadLocal} variable for this request using * {@link ThreadLocalContextUtil}. * - * If multi-tenant and basic auth credentials are invalid, a http error response - * is returned. + * If multi-tenant and basic auth credentials are invalid, a http error response is returned. */ @Service(value = "basicAuthenticationProcessingFilter") @Profile("basicauth") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java index 4680b655b..42a26fc1e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java @@ -45,17 +45,14 @@ import org.springframework.web.filter.GenericFilterBean; /** * - * This filter is responsible for extracting multi-tenant from the request and - * setting Cross-Origin details to response. + * This filter is responsible for extracting multi-tenant from the request and setting Cross-Origin details to response. * - * If multi-tenant are valid, the details of the tenant are stored in - * {@link FineractPlatformTenant} and stored in a {@link ThreadLocal} variable - * for this request using {@link ThreadLocalContextUtil}. + * If multi-tenant are valid, the details of the tenant are stored in {@link FineractPlatformTenant} and stored in a + * {@link ThreadLocal} variable for this request using {@link ThreadLocalContextUtil}. * * If multi-tenant are invalid, a http error response is returned. * - * Used to support Oauth2 authentication and the service is loaded only when - * "oauth" profile is active. + * Used to support Oauth2 authentication and the service is loaded only when "oauth" profile is active. */ @Service(value = "tenantIdentifierProcessingFilter") @Profile("oauth") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TwoFactorAuthenticationFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TwoFactorAuthenticationFilter.java index bedf16302..6758c552b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TwoFactorAuthenticationFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TwoFactorAuthenticationFilter.java @@ -44,19 +44,15 @@ import org.springframework.stereotype.Service; import org.springframework.web.filter.GenericFilterBean; /** - * This filter is responsible for handling two-factor authentication. The filter - * is enabled when 'twofactor' environment profile is active, otherwise - * {@link InsecureTwoFactorAuthenticationFilter} is used. + * This filter is responsible for handling two-factor authentication. The filter is enabled when 'twofactor' environment + * profile is active, otherwise {@link InsecureTwoFactorAuthenticationFilter} is used. * - * This filter validates an access-token provided as a header - * 'Fineract-Platform-TFA-Token'. If a valid token is provided, a - * 'TWOFACTOR_AUTHENTICATED' authority is added to the current authentication. - * If an invalid(non-existent or invalid) token is provided, 403 response is - * returned. + * This filter validates an access-token provided as a header 'Fineract-Platform-TFA-Token'. If a valid token is + * provided, a 'TWOFACTOR_AUTHENTICATED' authority is added to the current authentication. If an invalid(non-existent or + * invalid) token is provided, 403 response is returned. * - * An authenticated platform user with permission 'BYPASS_TWOFACTOR' will always - * be granted 'TWOFACTOR_AUTHENTICATED' authority regardless of the value of the - * 'Fineract-Platform-TFA-Token' header. + * An authenticated platform user with permission 'BYPASS_TWOFACTOR' will always be granted 'TWOFACTOR_AUTHENTICATED' + * authority regardless of the value of the 'Fineract-Platform-TFA-Token' header. */ @Service(value = "twoFactorAuthFilter") @Profile("twofactor") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java index 0baa31849..2269c5b6c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java @@ -33,8 +33,8 @@ import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Service; /** - * A JDBC implementation of {@link BasicAuthTenantDetailsService} for loading a - * tenants details by a tenantIdentifier. + * A JDBC implementation of {@link BasicAuthTenantDetailsService} for loading a tenants details by a + * tenantIdentifier. */ @Service public class BasicAuthTenantDetailsServiceJdbc implements BasicAuthTenantDetailsService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java index 0edc6bd35..2dda645d0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java @@ -45,11 +45,10 @@ public class CustomAuthenticationFailureHandler implements AuthenticationFailure public CustomAuthenticationFailureHandler() {} /** - * Performs the redirect or forward to the {@code defaultFailureUrl} if set, - * otherwise returns a 401 error code. + * Performs the redirect or forward to the {@code defaultFailureUrl} if set, otherwise returns a 401 error code. *

- * If redirecting or forwarding, {@code saveException} will be called to - * cache the exception for use in the target view. + * If redirecting or forwarding, {@code saveException} will be called to cache the exception for use in the target + * view. */ @Override public void onAuthenticationFailure(final HttpServletRequest request, final HttpServletResponse response, @@ -80,10 +79,9 @@ public class CustomAuthenticationFailureHandler implements AuthenticationFailure /** * Caches the {@code AuthenticationException} for use in view rendering. *

- * If {@code forwardToDestination} is set to true, request scope will be - * used, otherwise it will attempt to store the exception in the session. If - * there is no session and {@code allowSessionCreation} is {@code true} a - * session will be created. Otherwise the exception will not be stored. + * If {@code forwardToDestination} is set to true, request scope will be used, otherwise it will attempt to store + * the exception in the session. If there is no session and {@code allowSessionCreation} is {@code true} a session + * will be created. Otherwise the exception will not be stored. */ protected final void saveException(final HttpServletRequest request, final AuthenticationException exception) { if (this.forwardToDestination) { @@ -113,8 +111,8 @@ public class CustomAuthenticationFailureHandler implements AuthenticationFailure } /** - * If set to true, performs a forward to the failure destination - * URL instead of a redirect. Defaults to false. + * If set to true, performs a forward to the failure destination URL instead of a redirect. Defaults to + * false. */ public void setUseForward(final boolean forwardToDestination) { this.forwardToDestination = forwardToDestination; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java index 81c0a02af..701abdc0d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java @@ -34,8 +34,8 @@ import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Service; /** - * A JDBC implementation of {@link TenantDetailsService} for loading a tenants - * details by a tenantIdentifier. + * A JDBC implementation of {@link TenantDetailsService} for loading a tenants details by a + * tenantIdentifier. */ @Service public class JdbcTenantDetailsService implements TenantDetailsService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/PlatformSecurityContext.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/PlatformSecurityContext.java index 33f64b0fa..55831ce21 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/PlatformSecurityContext.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/PlatformSecurityContext.java @@ -26,11 +26,10 @@ public interface PlatformSecurityContext { AppUser authenticatedUser(); /** - * Convenience method returns null (does not throw an exception) if an - * authenticated user is not present + * Convenience method returns null (does not throw an exception) if an authenticated user is not present * - * To be used only in service layer methods that can be triggered via both - * the API and batch Jobs (which do not have an authenticated user) + * To be used only in service layer methods that can be triggered via both the API and batch Jobs (which do not have + * an authenticated user) * * @return */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/SpringSecurityPlatformSecurityContext.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/SpringSecurityPlatformSecurityContext.java index 7bf411a1e..c48490fd8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/SpringSecurityPlatformSecurityContext.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/SpringSecurityPlatformSecurityContext.java @@ -37,8 +37,7 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; /** - * Wrapper around spring security's {@link SecurityContext} for extracted the - * current authenticated {@link AppUser}. + * Wrapper around spring security's {@link SecurityContext} for extracted the current authenticated {@link AppUser}. */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TenantAwareJpaPlatformUserDetailsService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TenantAwareJpaPlatformUserDetailsService.java index 7bdeac92c..07bf8fd8c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TenantAwareJpaPlatformUserDetailsService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TenantAwareJpaPlatformUserDetailsService.java @@ -29,8 +29,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; /** - * Used in securityContext.xml as implementation of spring security's - * {@link UserDetailsService}. + * Used in securityContext.xml as implementation of spring security's {@link UserDetailsService}. */ @Service(value = "userDetailsService") public class TenantAwareJpaPlatformUserDetailsService implements PlatformUserDetailsService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java index 9bdf08de3..bc4a1382b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java @@ -25,13 +25,11 @@ import java.util.Locale; import java.util.regex.Pattern; /** - * Utility to assemble the WHERE clause of an SQL query without the risk of SQL - * injection. + * Utility to assemble the WHERE clause of an SQL query without the risk of SQL injection. * *

- * When using this utility instead of manually assembling SQL queries, then - * {@link SQLInjectionValidator} should not be required anymore. (Correctly - * using this means only ever passing completely fixed String literals to .) + * When using this utility instead of manually assembling SQL queries, then {@link SQLInjectionValidator} should not be + * required anymore. (Correctly using this means only ever passing completely fixed String literals to .) * * @author Michael Vorburger */ @@ -51,15 +49,14 @@ public class SQLBuilder { private final ArrayList crts = new ArrayList(); /** - * Adds a criteria for a SQL WHERE clause. All criteria are appended by AND - * (support for OR, or nesting, can be added when needed). + * Adds a criteria for a SQL WHERE clause. All criteria are appended by AND (support for OR, or nesting, can be + * added when needed). * * @param criteria - * The name of the column to be filtered, and an operator; e.g. - * "name =" or "age >" (but without '?' placeholder) + * The name of the column to be filtered, and an operator; e.g. "name =" or "age >" (but without '?' + * placeholder) * @param argument - * The argument to be filtered on (e.g. "Michael" or 123). The - * null value is explicitly permitted. + * The argument to be filtered on (e.g. "Michael" or 123). The null value is explicitly permitted. */ public void addCriteria(String criteria, Object argument) { if (criteria == null || criteria.trim().isEmpty()) { @@ -104,8 +101,7 @@ public class SQLBuilder { } /** - * Delegates to {@link #addCriteria(String, Object)} if argument is not - * null, otherwise does nothing. + * Delegates to {@link #addCriteria(String, Object)} if argument is not null, otherwise does nothing. */ public void addNonNullCriteria(String criteria, Object argument) { if (argument != null) { @@ -114,11 +110,9 @@ public class SQLBuilder { } /** - * Returns a SQL WHERE clause, created from the - * {@link #addCriteria(String, Object)}, with '?' placeholders. + * Returns a SQL WHERE clause, created from the {@link #addCriteria(String, Object)}, with '?' placeholders. * - * @return SQL WHERE clause, almost always starting with " WHERE ..." - * (unless no criteria, then empty) + * @return SQL WHERE clause, almost always starting with " WHERE ..." (unless no criteria, then empty) */ public String getSQLTemplate() { if (sb.length() > 0) { @@ -130,17 +124,16 @@ public class SQLBuilder { /** * Returns the arguments for the WHERE clause. * - * @return Object array suitable for use with Spring Framework JdbcTemplate - * (or plain JDBC {@link PreparedStatement}) + * @return Object array suitable for use with Spring Framework JdbcTemplate (or plain JDBC + * {@link PreparedStatement}) */ public Object[] getArguments() { return args.toArray(); } /* - * Returns a String representation suitable for debugging and log output. - * This is ONLY intended for debugging in logs, and NEVER for passing to a - * JDBC database. + * Returns a String representation suitable for debugging and log output. This is ONLY intended for debugging in + * logs, and NEVER for passing to a JDBC database. */ @Override public String toString() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiQueueResourceData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiQueueResourceData.java index 36ff198d3..0ed957b15 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiQueueResourceData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiQueueResourceData.java @@ -22,8 +22,7 @@ import com.google.gson.Gson; import java.util.Collection; /** - * Immutable data object representing the API request body sent in the POST - * request to the "/queue" resource + * Immutable data object representing the API request body sent in the POST request to the "/queue" resource **/ public class SmsMessageApiQueueResourceData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiReportResourceData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiReportResourceData.java index 9f1fd322d..f2b24f631 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiReportResourceData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageApiReportResourceData.java @@ -22,8 +22,7 @@ import com.google.gson.Gson; import java.util.List; /** - * Immutable data object representing the API request body sent in the POST - * request to the "/report" resource + * Immutable data object representing the API request body sent in the POST request to the "/report" resource **/ public class SmsMessageApiReportResourceData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageDeliveryReportData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageDeliveryReportData.java index 3e0f51bbb..d59320230 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageDeliveryReportData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/data/SmsMessageDeliveryReportData.java @@ -19,8 +19,7 @@ package org.apache.fineract.infrastructure.sms.data; /** - * Immutable data object representing an outbound SMS message delivery report - * data + * Immutable data object representing an outbound SMS message delivery report data **/ public class SmsMessageDeliveryReportData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobService.java index e12ca82d2..fb3564957 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobService.java @@ -41,8 +41,7 @@ public interface SmsMessageScheduledJobService { public void sendTriggeredMessages(Map> smsDataMap); /** - * Sends a triggered batch of SMS messages to SMS gateway using specified - * provider. + * Sends a triggered batch of SMS messages to SMS gateway using specified provider. * * @param smsMessage * the SMS messages to queue for sending. diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java index 42d6e430d..b15f3f02b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java @@ -60,8 +60,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; /** - * Scheduled job services that send SMS messages and get delivery reports for - * the sent SMS messages + * Scheduled job services that send SMS messages and get delivery reports for the sent SMS messages **/ @Service public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJobService { @@ -248,8 +247,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob } /** - * get SMS message delivery reports from the SMS gateway (or intermediate - * gateway) + * get SMS message delivery reports from the SMS gateway (or intermediate gateway) **/ @Override @Transactional diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java index e3c27344b..28feed30c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java @@ -117,8 +117,7 @@ public class SmsWritePlatformServiceJpaRepositoryImpl implements SmsWritePlatfor } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(@SuppressWarnings("unused") final JsonCommand command, final DataIntegrityViolationException dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java index 1b21573b8..92bf879fe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java @@ -89,8 +89,7 @@ public class WriteLikelihoodServiceImpl implements WriteLikelihoodService { } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/MathUtil.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/MathUtil.java index 2f9dac8ab..5cf94b6c4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/MathUtil.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/MathUtil.java @@ -308,8 +308,7 @@ public class MathUtil { } /** - * @return BigDecimal with scale set to the 'digitsAfterDecimal' of the - * parameter currency + * @return BigDecimal with scale set to the 'digitsAfterDecimal' of the parameter currency */ public static BigDecimal normalizeAmount(BigDecimal amount, @NotNull MonetaryCurrency currency) { return amount == null ? null : amount.setScale(currency.getDigitsAfterDecimal(), MoneyHelper.getRoundingMode()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/HolidayRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/HolidayRepositoryWrapper.java index 479336ca5..47fe79b0f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/HolidayRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/HolidayRepositoryWrapper.java @@ -28,8 +28,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link HolidayRepository} that adds NULL checking and Error - * handling capabilities + * Wrapper for {@link HolidayRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrencyRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrencyRepositoryWrapper.java index c355a0342..43c4a2768 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrencyRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrencyRepositoryWrapper.java @@ -24,15 +24,13 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link ApplicationCurrencyRepository} that is responsible for - * checking if {@link ApplicationCurrency} is returned when using - * findOne repository method and throwing an appropriate not found - * exception. + * Wrapper for {@link ApplicationCurrencyRepository} that is responsible for checking if {@link ApplicationCurrency} is + * returned when using findOne repository method and throwing an appropriate not found exception. *

* *

- * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link ApplicationCurrencyRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where + * {@link ApplicationCurrencyRepository} is required. *

*/ @Service @@ -59,8 +57,7 @@ public class ApplicationCurrencyRepositoryWrapper { } /** - * Used when its not needed for {@link ApplicationCurrency} to inherit - * decimal place settings of existing currency. + * Used when its not needed for {@link ApplicationCurrency} to inherit decimal place settings of existing currency. */ public ApplicationCurrency findOneWithNotFoundDetection(final String currencyCode) { final ApplicationCurrency applicationCurrency = this.repository.findOneByCode(currencyCode); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/CurrencyInUseException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/CurrencyInUseException.java index 30ac3ca13..580fdc2ae 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/CurrencyInUseException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/CurrencyInUseException.java @@ -21,8 +21,7 @@ package org.apache.fineract.organisation.monetary.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when trying to delete a currency that is - * still in use. + * A {@link RuntimeException} thrown when trying to delete a currency that is still in use. */ public class CurrencyInUseException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/OrganizationalCurrencyNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/OrganizationalCurrencyNotFoundException.java index dfaf2b885..923fe396a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/OrganizationalCurrencyNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/exception/OrganizationalCurrencyNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.organisation.monetary.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when urrency is not supported by an - * Organization. + * A {@link RuntimeException} thrown when urrency is not supported by an Organization. */ public class OrganizationalCurrencyNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java index d3a8f9baf..12c412fc4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java @@ -74,8 +74,7 @@ import org.springframework.stereotype.Component; public class OfficesApiResource { /** - * The set of parameters that are supported in response for - * {@link OfficeData}. + * The set of parameters that are supported in response for {@link OfficeData}. */ private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "nameDecorated", "externalId", "openingDate", "hierarchy", "parentId", "parentName", "allowedParents")); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeRepositoryWrapper.java index 376cdf603..325cc5cd2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeRepositoryWrapper.java @@ -25,8 +25,7 @@ import org.springframework.transaction.annotation.Transactional; /** *

- * Wrapper for {@link OfficeRepository} that adds NULL checking and Error - * handling capabilities + * Wrapper for {@link OfficeRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrencyRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrencyRepositoryWrapper.java index 10c1f0ff6..5e964fcfc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrencyRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrencyRepositoryWrapper.java @@ -24,14 +24,13 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link OrganisationCurrency} that is responsible for checking if - * {@link OrganisationCurrency} is returned when using findOne - * repository method and throwing an appropriate not found exception. + * Wrapper for {@link OrganisationCurrency} that is responsible for checking if {@link OrganisationCurrency} is returned + * when using findOne repository method and throwing an appropriate not found exception. *

* *

- * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link OrganisationCurrency} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where {@link OrganisationCurrency} is + * required. *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/InvalidOfficeException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/InvalidOfficeException.java index 21298bd60..4a4c989d0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/InvalidOfficeException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/InvalidOfficeException.java @@ -21,8 +21,7 @@ package org.apache.fineract.organisation.office.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when office mismatch - * occurs + * {@link AbstractPlatformDomainRuleException} thrown when office mismatch occurs */ public class InvalidOfficeException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeTransactionNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeTransactionNotFoundException.java index ad6cdd265..85d4941f5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeTransactionNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeTransactionNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.organisation.office.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when office transaction resources are not - * found. + * A {@link RuntimeException} thrown when office transaction resources are not found. */ public class OfficeTransactionNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java index b2663b637..c0642a6dc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java @@ -224,8 +224,7 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleOfficeDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { @@ -245,8 +244,8 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP } /* - * used to restrict modifying operations to office that are either the users - * office or lower (child) in the office hierarchy + * used to restrict modifying operations to office that are either the users office or lower (child) in the office + * hierarchy */ private Office validateUserPriviledgeOnOfficeAndRetrieve(final AppUser currentUser, final Long officeId) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java index f4ecdd4a3..3f5b791b7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java @@ -116,8 +116,7 @@ public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implement } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java index c91ace105..64e7db189 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java @@ -160,8 +160,7 @@ public class ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl implement } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { if (realCause.getMessage().contains("criteria_name")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java index c0390f5f5..59e19cd9a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java @@ -75,8 +75,7 @@ import org.springframework.stereotype.Component; public class StaffApiResource { /** - * The set of parameters that are supported in response for - * {@link StaffData}. + * The set of parameters that are supported in response for {@link StaffData}. */ private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "firstname", "lastname", "displayName", "officeId", "officeName", "isLoanOfficer", "externalId", "mobileNo", "allowedOffices", "isActive", "joiningDate")); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/StaffRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/StaffRepositoryWrapper.java index ae4a6598e..6eee59afb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/StaffRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/StaffRepositoryWrapper.java @@ -24,8 +24,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link StaffRepository} that adds NULL checking and Error - * handling capabilities + * Wrapper for {@link StaffRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformService.java index 29008405b..d6af2bf07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformService.java @@ -30,8 +30,7 @@ public interface StaffReadPlatformService { Collection retrieveAllLoanOfficersInOfficeById(final Long officeId); /** - * returns all staff in offices that are above the provided - * officeId. + * returns all staff in offices that are above the provided officeId. */ Collection retrieveAllStaffInOfficeAndItsParentOfficeHierarchy(Long officeId, boolean loanOfficersOnly); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java index 97c7f3e21..9c973b9bd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java @@ -117,8 +117,7 @@ public class StaffWritePlatformServiceJpaRepositoryImpl implements StaffWritePla } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleStaffDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/CashierData.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/CashierData.java index 7bd815cff..c9913d44f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/CashierData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/CashierData.java @@ -24,8 +24,7 @@ import java.util.Date; import org.apache.fineract.organisation.staff.data.StaffData; /** - * Represents a cashier, providing access to the cashier's office, staff - * information, teller, and more. + * Represents a cashier, providing access to the cashier's office, staff information, teller, and more. * * @author Markus Geiss * @@ -80,13 +79,11 @@ public final class CashierData implements Serializable { * Creates a new cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @param id @@ -180,8 +177,7 @@ public final class CashierData implements Serializable { * Returns the valid from date of this cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* * @return the valid from date of this cashier @@ -194,8 +190,7 @@ public final class CashierData implements Serializable { * Returns the valid to date of this cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* * @return the valid to date of this cashier @@ -207,8 +202,7 @@ public final class CashierData implements Serializable { /** * Returns whether this cashier works part time or not. * - * @return {@code true} if this cashier works part time; {@code false} - * otherwise + * @return {@code true} if this cashier works part time; {@code false} otherwise */ public Boolean isFullDay() { return isFullDay; @@ -218,8 +212,7 @@ public final class CashierData implements Serializable { * Returns the start time of this cashier. * *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @return the start time of this cashier @@ -232,8 +225,7 @@ public final class CashierData implements Serializable { * Returns the end time of this cashier. * *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @return the start time of this cashier diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java index 414bb53c6..15c3b92e6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java @@ -98,11 +98,9 @@ public final class TellerData implements Serializable { * @param status * - current state of the teller, eg. active, inactive, pending * @param hasTransactions - * - indicates that this teller already is used to perform - * postings + * - indicates that this teller already is used to perform postings * @param hasMappedCashiers - * - indicates that the teller already has @code Cashier}s - * assigned to it + * - indicates that the teller already has @code Cashier}s assigned to it * @return the new created {@code TellerData} */ public static TellerData instance(final Long id, final Long officeId, final Long debitAccountId, final Long creditAccountId, diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java index 201cf70c0..834b288e8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java @@ -23,8 +23,7 @@ import java.util.Date; import org.apache.fineract.infrastructure.core.data.EnumOptionData; /** - * {@code TellerTransactionData} represents an immutable data object for a - * transction. + * {@code TellerTransactionData} represents an immutable data object for a transction. * * @version 1.0.0 * @@ -72,8 +71,7 @@ public final class TellerTransactionData implements Serializable { * @param clientId * - id of the client * @param type - * - type of transaction (eg receipt, payment, open, close, - * settle) + * - type of transaction (eg receipt, payment, open, close, settle) * @param amount * - amount of the transaction * @param postingDate diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java index 44636cbe4..a78acc595 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java @@ -40,9 +40,8 @@ import org.apache.fineract.organisation.staff.domain.Staff; import org.joda.time.LocalDate; /** - * Provides the base model for a cashier. Represents a row in the - * "m_cashiers" database table, with each column mapped to a property - * of this class. + * Provides the base model for a cashier. Represents a row in the "m_cashiers" database table, with each + * column mapped to a property of this class. * * @author Markus Geiss * @since 2.0.0 @@ -101,9 +100,8 @@ public class Cashier extends AbstractPersistableCustom { final LocalDate endDate = command.localDateValueOfParameterNamed("endDate"); final Boolean isFullDay = command.booleanObjectValueOfParameterNamed("isFullDay"); /* - * final String startTime = - * command.stringValueOfParameterNamed("startTime"); final String - * endTime = command.stringValueOfParameterNamed("endTime"); + * final String startTime = command.stringValueOfParameterNamed("startTime"); final String endTime = + * command.stringValueOfParameterNamed("endTime"); */ return new Cashier(cashierOffice, teller, staff, description, startDate, endDate, isFullDay, startTime, endTime); @@ -336,8 +334,7 @@ public class Cashier extends AbstractPersistableCustom { * Returns the valid from date of this cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* * @return the valid from date of this cashier @@ -358,8 +355,7 @@ public class Cashier extends AbstractPersistableCustom { * Sets the valid from date of this cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* * @param startDate @@ -373,8 +369,7 @@ public class Cashier extends AbstractPersistableCustom { * Returns the valid to date of this cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* * @return the valid to date of this cashier @@ -395,8 +390,7 @@ public class Cashier extends AbstractPersistableCustom { * Sets the valid to date of this cashier. * *

- * The valid from/to dates may be used to define a time period in which the - * cashier is assignable to a teller. + * The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller. *

* * @param endDate @@ -409,8 +403,7 @@ public class Cashier extends AbstractPersistableCustom { /** * Returns whether this cashier works part time or not. * - * @return {@code true} if this cashier works part time; {@code false} - * otherwise + * @return {@code true} if this cashier works part time; {@code false} otherwise */ public Boolean isFullDay() { return isFullDay; @@ -430,8 +423,7 @@ public class Cashier extends AbstractPersistableCustom { * Returns the start time of this cashier. * *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @return the start time of this cashier @@ -444,8 +436,7 @@ public class Cashier extends AbstractPersistableCustom { * Set the start time of this cashier. * *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @param startTime @@ -459,8 +450,7 @@ public class Cashier extends AbstractPersistableCustom { * Returns the end time of this cashier. * *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @return the end time of this cashier @@ -473,8 +463,7 @@ public class Cashier extends AbstractPersistableCustom { * Sets the end time of this cashier. * *

- * The start/end times may be used to define a time period in which the - * cashier works part time. + * The start/end times may be used to define a time period in which the cashier works part time. *

* * @param endTime diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierRepository.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierRepository.java index 1cd2fd31e..dce7f1fb2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierRepository.java @@ -22,8 +22,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; /** - * Provides the domain repository for accessing, adding, modifying or deleting - * cashiers. + * Provides the domain repository for accessing, adding, modifying or deleting cashiers. * * @author Markus Geiss * @see org.apache.fineract.organisation.teller.domain.Cashier diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java index 43b56bbde..56defe32e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java @@ -206,8 +206,7 @@ public class CashierTransaction extends AbstractPersistableCustom { /** * Returns the transaction type of this cashier transaction. . * - * @return the transaction type of this cashier transaction or {@code null} - * if not present. + * @return the transaction type of this cashier transaction or {@code null} if not present. */ public Integer getTxnType() { return txnType; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java index 137ea9bde..c5f48a25a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java @@ -96,11 +96,10 @@ public class Teller extends AbstractPersistableCustom { this.office = staffOffice; /* - * if (StringUtils.isNotBlank(name)) { this.name = name.trim(); } else { - * this.name = null; } + * if (StringUtils.isNotBlank(name)) { this.name = name.trim(); } else { this.name = null; } * - * if (StringUtils.isNotBlank(description)) { this.description = - * description.trim(); } else { this.description = null; } + * if (StringUtils.isNotBlank(description)) { this.description = description.trim(); } else { this.description = + * null; } */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java index 9dd7caad6..2fdea2a68 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java @@ -23,8 +23,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; /** - * Provides the domain repository for accessing, adding, modifying or deleting - * tellers. + * Provides the domain repository for accessing, adding, modifying or deleting tellers. * * @see org.apache.fineract.organisation.teller.domain.Teller * @since 2.0.0 diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransactionRepository.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransactionRepository.java index ca95fad2f..1fa4e9167 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransactionRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransactionRepository.java @@ -22,8 +22,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; /** - * Provides the domain repository for accessing, adding, modifying or deleting - * teller transactions. + * Provides the domain repository for accessing, adding, modifying or deleting teller transactions. * * @see org.apache.fineract.organisation.teller.domain.TellerTransaction * @since 2.0.0 diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashToCashierCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashToCashierCommandHandler.java index 865da7b9d..6a36ebd19 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashToCashierCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashToCashierCommandHandler.java @@ -36,8 +36,7 @@ public class AllocateCashToCashierCommandHandler implements NewCommandSourceHand * Creates a new instance. * * @param writePlatformService - * the {@code CashierWritePlatformService} used to access the - * backend + * the {@code CashierWritePlatformService} used to access the backend */ @Autowired public AllocateCashToCashierCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashierToTellerCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashierToTellerCommandHandler.java index 77f2515b7..1386731f0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashierToTellerCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/AllocateCashierToTellerCommandHandler.java @@ -36,8 +36,7 @@ public class AllocateCashierToTellerCommandHandler implements NewCommandSourceHa * Creates a new instance. * * @param writePlatformService - * the {@code CashierWritePlatformService} used to access the - * backend + * the {@code CashierWritePlatformService} used to access the backend */ @Autowired public AllocateCashierToTellerCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerCommandHandler.java index 4731ace57..40dfb63bf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerCommandHandler.java @@ -43,8 +43,7 @@ public class CreateTellerCommandHandler implements NewCommandSourceHandler { * Creates a new instance * * @param writePlatformService - * the {@code TellerWritePlatformService} used to access the - * backend + * the {@code TellerWritePlatformService} used to access the backend */ @Autowired public CreateTellerCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteCashierAllocationCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteCashierAllocationCommandHandler.java index 4772cab06..b77bc0ac3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteCashierAllocationCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteCashierAllocationCommandHandler.java @@ -43,8 +43,7 @@ public class DeleteCashierAllocationCommandHandler implements NewCommandSourceHa * Creates a new instance. * * @param writePlatformService - * the {@code CashierWritePlatformService} used to access the - * backend + * the {@code CashierWritePlatformService} used to access the backend */ @Autowired public DeleteCashierAllocationCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteTellerCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteTellerCommandHandler.java index eb03283f5..5aae7bc54 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteTellerCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/DeleteTellerCommandHandler.java @@ -43,8 +43,7 @@ public class DeleteTellerCommandHandler implements NewCommandSourceHandler { * Creates a new instance * * @param writePlatformService - * the {@code TellerWritePlatformService} used to access the - * backend + * the {@code TellerWritePlatformService} used to access the backend */ @Autowired public DeleteTellerCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/ModifyCashierCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/ModifyCashierCommandHandler.java index 902918461..c4c9eaf26 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/ModifyCashierCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/ModifyCashierCommandHandler.java @@ -39,8 +39,7 @@ public class ModifyCashierCommandHandler implements NewCommandSourceHandler { * Creates a new instance. * * @param writePlatformService - * the {@code CashierWritePlatformService} used to access the - * backend + * the {@code CashierWritePlatformService} used to access the backend */ @Autowired public ModifyCashierCommandHandler(final CashierWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/SettleCashFromCashierCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/SettleCashFromCashierCommandHandler.java index d721bc2af..04ac7fb7f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/SettleCashFromCashierCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/SettleCashFromCashierCommandHandler.java @@ -36,8 +36,7 @@ public class SettleCashFromCashierCommandHandler implements NewCommandSourceHand * Creates a new instance. * * @param writePlatformService - * the {@code CashierWritePlatformService} used to access the - * backend + * the {@code CashierWritePlatformService} used to access the backend */ @Autowired public SettleCashFromCashierCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateCashierAllocationCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateCashierAllocationCommandHandler.java index b92fefafb..bc8c778a8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateCashierAllocationCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateCashierAllocationCommandHandler.java @@ -43,8 +43,7 @@ public class UpdateCashierAllocationCommandHandler implements NewCommandSourceHa * Creates a new instance * * @param writePlatformService - * the {@code TellerWritePlatformService} used to access the - * backend + * the {@code TellerWritePlatformService} used to access the backend */ @Autowired public UpdateCashierAllocationCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateTellerCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateTellerCommandHandler.java index fbf8e6bbe..ce91f5d0b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateTellerCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/handler/UpdateTellerCommandHandler.java @@ -43,8 +43,7 @@ public class UpdateTellerCommandHandler implements NewCommandSourceHandler { * Creates a new instance * * @param writePlatformService - * the {@code TellerWritePlatformService} used to access the - * backend + * the {@code TellerWritePlatformService} used to access the backend */ @Autowired public UpdateTellerCommandHandler(final TellerWritePlatformService writePlatformService) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformService.java index 2bf52cf8d..943b4c511 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformService.java @@ -67,8 +67,8 @@ public interface TellerWritePlatformService { public CommandProcessingResult deleteTeller(Long tellerId); /** - * Allocates a cashier to an existing teller. The allocation can be for a - * duration from a date to a date from a certain start time to an end time. + * Allocates a cashier to an existing teller. The allocation can be for a duration from a date to a date from a + * certain start time to an end time. * * @param command * the command to allocate a cashier for a specific teller diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java index 59a44d0bf..2f0a08236 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java @@ -165,8 +165,8 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer } /* - * used to restrict modifying operations to office that are either the users - * office or lower (child) in the office hierarchy + * used to restrict modifying operations to office that are either the users office or lower (child) in the office + * hierarchy */ private Teller validateUserPriviledgeOnTellerAndRetrieve(final AppUser currentUser, final Long tellerId) { @@ -202,8 +202,7 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleTellerDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { @@ -345,9 +344,8 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer } /* - * @Override public CommandProcessingResult inwardCashToCashier (final Long - * cashierId, final CashierTransaction cashierTxn) { CashierTxnType txnType - * = CashierTxnType.INWARD_CASH_TXN; // pre save to generate id for use in + * @Override public CommandProcessingResult inwardCashToCashier (final Long cashierId, final CashierTransaction + * cashierTxn) { CashierTxnType txnType = CashierTxnType.INWARD_CASH_TXN; // pre save to generate id for use in * office hierarchy this.cashierTxnRepository.save(cashierTxn); } */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/AdjustedDateDetailsDTO.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/AdjustedDateDetailsDTO.java index 19ce000bc..f1230fd7e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/AdjustedDateDetailsDTO.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/AdjustedDateDetailsDTO.java @@ -27,8 +27,8 @@ public class AdjustedDateDetailsDTO { */ LocalDate changedScheduleDate; /** - * Variable tracks If the meeting has been changed , i.e future schedule - * also changes along with the current repayments date. + * Variable tracks If the meeting has been changed , i.e future schedule also changes along with the current + * repayments date. */ LocalDate changedActualRepaymentDate; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysRepositoryWrapper.java index bf32f9d25..b9af97f82 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysRepositoryWrapper.java @@ -27,8 +27,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link WorkingDaysRepository} that adds NULL checking and Error - * handling capabilities + * Wrapper for {@link WorkingDaysRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java index e3134c816..0a874b101 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java @@ -35,9 +35,8 @@ public class AccountTransfersApiConstants { public static final String currencyParamName = "currency"; /** - * These parameters will match the class level parameters of - * {@link AccountTransferData}. Where possible, we try to get response - * parameters to match those of request parameters. + * These parameters will match the class level parameters of {@link AccountTransferData}. Where possible, we try to + * get response parameters to match those of request parameters. */ protected static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( Arrays.asList(AccountDetailConstants.idParamName, transferDescriptionParamName, currencyParamName)); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java index fe40ab29f..66d4b0717 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java @@ -296,8 +296,7 @@ public class AccountTransferStandingInstruction extends AbstractPersistableCusto } /** - * delete the standing instruction by setting the status to 3 and appending - * "_deleted_" and the id to the name + * delete the standing instruction by setting the status to 3 and appending "_deleted_" and the id to the name **/ public void delete() { this.status = StandingInstructionStatus.DELETED.getValue(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountAssociationsReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountAssociationsReadPlatformServiceImpl.java index ab9306d80..69ff14b83 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountAssociationsReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountAssociationsReadPlatformServiceImpl.java @@ -171,9 +171,8 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci final String loanAccountNo = rs.getString("loanAccountNo"); final PortfolioAccountData account = PortfolioAccountData.lookup(loanAccountId, loanAccountNo); /* - * if (savingsAccountId != null) { account = - * PortfolioAccountData.lookup(savingsAccountId, savingsAccountNo); - * } else if (loanAccountId != null) { account = + * if (savingsAccountId != null) { account = PortfolioAccountData.lookup(savingsAccountId, + * savingsAccountNo); } else if (loanAccountId != null) { account = * PortfolioAccountData.lookup(loanAccountId, loanAccountNo); } */ final Long linkSavingsAccountId = JdbcSupport.getLong(rs, "linkSavingsAccountId"); @@ -184,11 +183,9 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci // rs.getString("linkLoanAccountNo"); final PortfolioAccountData linkedAccount = PortfolioAccountData.lookup(linkSavingsAccountId, linkSavingsAccountNo); /* - * if (linkSavingsAccountId != null) { linkedAccount = - * PortfolioAccountData.lookup(linkSavingsAccountId, - * linkSavingsAccountNo); } else if (linkLoanAccountId != null) { - * linkedAccount = PortfolioAccountData.lookup(linkLoanAccountId, - * linkLoanAccountNo); } + * if (linkSavingsAccountId != null) { linkedAccount = PortfolioAccountData.lookup(linkSavingsAccountId, + * linkSavingsAccountNo); } else if (linkLoanAccountId != null) { linkedAccount = + * PortfolioAccountData.lookup(linkLoanAccountId, linkLoanAccountNo); } */ return new AccountAssociationsData(id, account, linkedAccount); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java index 2d1cfb389..5e41306b2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java @@ -382,8 +382,8 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount sql = "select " + this.accountRefundByTransferMapper.schema() + " where la.id = ?"; /* - * if (currencyCode != null) { sql += " and la.currency_code = ?"; - * sqlParams = new Object[] {accountId , accountId,currencyCode }; } + * if (currencyCode != null) { sql += " and la.currency_code = ?"; sqlParams = new Object[] {accountId , + * accountId,currencyCode }; } */ accountData = this.jdbcTemplate.queryForObject(sql, this.accountRefundByTransferMapper, sqlParams); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java index 42110322d..1fec51f66 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java @@ -216,9 +216,7 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr final Collection transferTypeOptions = Arrays.asList(transferType(AccountTransferType.ACCOUNT_TRANSFER), transferType( AccountTransferType.LOAN_REPAYMENT)/* - * , transferType( - * AccountTransferType - * . CHARGE_PAYMENT ) + * , transferType( AccountTransferType . CHARGE_PAYMENT ) */); final Collection statusOptions = Arrays.asList(standingInstructionStatus(StandingInstructionStatus.ACTIVE), standingInstructionStatus(StandingInstructionStatus.DISABLED)); @@ -445,16 +443,12 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr EnumOptionData transferTypeEnum = AccountTransferEnumerations.transferType(transferType); /* - * final String currencyCode = rs.getString("currencyCode"); final - * String currencyName = rs.getString("currencyName"); final String - * currencyNameCode = rs.getString("currencyNameCode"); final String - * currencyDisplaySymbol = rs.getString("currencyDisplaySymbol"); - * final Integer currencyDigits = JdbcSupport.getInteger(rs, - * "currencyDigits"); final Integer inMultiplesOf = - * JdbcSupport.getInteger(rs, "inMultiplesOf"); final CurrencyData - * currency = new CurrencyData(currencyCode, currencyName, - * currencyDigits, inMultiplesOf, currencyDisplaySymbol, - * currencyNameCode); + * final String currencyCode = rs.getString("currencyCode"); final String currencyName = + * rs.getString("currencyName"); final String currencyNameCode = rs.getString("currencyNameCode"); final + * String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol"); final Integer currencyDigits = + * JdbcSupport.getInteger(rs, "currencyDigits"); final Integer inMultiplesOf = JdbcSupport.getInteger(rs, + * "inMultiplesOf"); final CurrencyData currency = new CurrencyData(currencyCode, currencyName, + * currencyDigits, inMultiplesOf, currencyDisplaySymbol, currencyNameCode); */ final Long fromOfficeId = JdbcSupport.getLong(rs, "fromOfficeId"); final String fromOfficeName = rs.getString("fromOfficeName"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/AccountSummaryCollectionData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/AccountSummaryCollectionData.java index f7fd9f899..430de30fa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/AccountSummaryCollectionData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/AccountSummaryCollectionData.java @@ -37,8 +37,7 @@ public class AccountSummaryCollectionData { private final Collection memberGuarantorAccounts; /* - * METHOD SIGNATURE CHANGE NOTICE: Method's signature was changed for GLIM & - * GSIM implementation + * METHOD SIGNATURE CHANGE NOTICE: Method's signature was changed for GLIM & GSIM implementation */ public AccountSummaryCollectionData(final Collection loanAccounts, final Collection groupLoanIndividualMonitoringAccounts, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java index 651da01a4..e2e27aee4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java @@ -43,8 +43,8 @@ import org.joda.time.format.DateTimeFormatter; public class Address extends AbstractPersistableCustom { /* - * @OneToMany(mappedBy = "address", cascade = CascadeType.ALL) private - * List clientaddress = new ArrayList<>(); + * @OneToMany(mappedBy = "address", cascade = CascadeType.ALL) private List clientaddress = new + * ArrayList<>(); */ @OneToMany(mappedBy = "address", cascade = CascadeType.ALL) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java index c3721053c..55be219ff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java @@ -218,10 +218,9 @@ public class Calendar extends AbstractAuditableCustom { this.startDate = newMeetingStartDate.toDate(); /* - * If meeting start date is changed then there is possibilities of - * recurring day may change, so derive the recurring day and update - * it if it is changed. For weekly type is weekday and for monthly - * type it is day of the month + * If meeting start date is changed then there is possibilities of recurring day may change, so derive the + * recurring day and update it if it is changed. For weekly type is weekday and for monthly type it is day + * of the month */ CalendarFrequencyType calendarFrequencyType = CalendarUtils.getFrequency(this.recurrence); @@ -326,10 +325,8 @@ public class Calendar extends AbstractAuditableCustom { throw new CalendarParameterUpdateNotSupportedException("meeting.type", defaultUserMessage, newMeetingType, oldMeeingType); /* - * final Integer newValue = - * command.integerValueSansLocaleOfParameterNamed(typeParamName); - * actualChanges.put(typeParamName, newValue); this.typeId = - * newValue; + * final Integer newValue = command.integerValueSansLocaleOfParameterNamed(typeParamName); + * actualChanges.put(typeParamName, newValue); this.typeId = newValue; */ } @@ -360,8 +357,8 @@ public class Calendar extends AbstractAuditableCustom { final String newRecurrence = Calendar.constructRecurrence(command, this); if (!StringUtils.isBlank(this.recurrence) && !newRecurrence.equalsIgnoreCase(this.recurrence)) { /* - * If active entities like JLG loan or RD accounts are synced to the - * calendar then do not allow to change meeting frequency + * If active entities like JLG loan or RD accounts are synced to the calendar then do not allow to change + * meeting frequency */ if (areActiveEntitiesSynced && !CalendarUtils.isFrequencySame(this.recurrence, newRecurrence)) { @@ -370,8 +367,8 @@ public class Calendar extends AbstractAuditableCustom { } /* - * If active entities like JLG loan or RD accounts are synced to the - * calendar then do not allow to change meeting interval + * If active entities like JLG loan or RD accounts are synced to the calendar then do not allow to change + * meeting interval */ if (areActiveEntitiesSynced && !CalendarUtils.isIntervalSame(this.recurrence, newRecurrence)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarFrequencyType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarFrequencyType.java index 10b7f919d..05e3eedc8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarFrequencyType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarFrequencyType.java @@ -105,8 +105,7 @@ public enum CalendarFrequencyType { } /** - * To convert from period frequency type tp calendar frequency type. This - * method requires code refactoring. + * To convert from period frequency type tp calendar frequency type. This method requires code refactoring. * * @param periodFrequencyType * periodFrequencyType @@ -128,8 +127,7 @@ public enum CalendarFrequencyType { } /** - * To convert from period frequency type tp calendar frequency type. This - * method requires code refactoring. + * To convert from period frequency type tp calendar frequency type. This method requires code refactoring. * * @param frequencyType * @return diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstanceRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstanceRepository.java index 4ecb09bf5..037b70243 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstanceRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstanceRepository.java @@ -37,8 +37,7 @@ public interface CalendarInstanceRepository extends JpaRepository - * Wrapper for {@link CalendarInstanceRepository} that is responsible for - * checking if {@link CalendarInstance} is returned when using - * findOne repository method and throwing an appropriate not found - * exception. + * Wrapper for {@link CalendarInstanceRepository} that is responsible for checking if {@link CalendarInstance} is + * returned when using findOne repository method and throwing an appropriate not found exception. *

* *

- * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link CalendarInstanceRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where + * {@link CalendarInstanceRepository} is required. *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarRepositoryWrapper.java index f86e4bc9c..d49d8dd5c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarRepositoryWrapper.java @@ -24,14 +24,13 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link CalendarRepository} that is responsible for checking if - * {@link Calendar} is returned when using findOne repository - * method and throwing an appropriate not found exception. + * Wrapper for {@link CalendarRepository} that is responsible for checking if {@link Calendar} is returned when using + * findOne repository method and throwing an appropriate not found exception. *

* *

- * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link CalendarRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where {@link CalendarRepository} is + * required. *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarInstanceNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarInstanceNotFoundException.java index 072e99b0c..dc380d917 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarInstanceNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarInstanceNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.calendar.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when CalendarInstance resources are not - * found. + * A {@link RuntimeException} thrown when CalendarInstance resources are not found. */ public class CalendarInstanceNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java index 5b43571e2..004896428 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java @@ -324,16 +324,13 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ CalendarData applicableCalendarData = calendarData; LocalDate nextEligibleMeetingDate = null; /** - * The next available meeting date for collection should be taken from - * application calendar for that time period. e.g. If the previous - * calendar details has weekly meeting starting from 1st of Oct 2013 on - * every Tuesday, then meeting dates for collection are 1,8,15,22,29.. + * The next available meeting date for collection should be taken from application calendar for that time + * period. e.g. If the previous calendar details has weekly meeting starting from 1st of Oct 2013 on every + * Tuesday, then meeting dates for collection are 1,8,15,22,29.. * - * If meeting schedule has changed from Tuesday to Friday with effective - * from 15th of Oct (calendar update has made on 2nd of Oct) , then - * application should allow to generate collection sheet on 8th of Oct - * which is still on Tuesday and next collection sheet date should be on - * 18th of Oct as per current calendar + * If meeting schedule has changed from Tuesday to Friday with effective from 15th of Oct (calendar update has + * made on 2nd of Oct) , then application should allow to generate collection sheet on 8th of Oct which is still + * on Tuesday and next collection sheet date should be on 18th of Oct as per current calendar */ Integer numberOfDays = 0; @@ -350,8 +347,8 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ } /** - * If nextEligibleMeetingDate is on or after current calendar startdate - * then regenerate the nextEligible meeting date based on + * If nextEligibleMeetingDate is on or after current calendar startdate then regenerate the nextEligible meeting + * date based on */ if (nextEligibleMeetingDate == null) { final LocalDate seedDate = (lastMeetingDate != null) ? lastMeetingDate : calendarData.getStartDate(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java index 94fb7e029..98df42287 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java @@ -588,9 +588,8 @@ public class CalendarUtils { /* * Recurring dates should follow loanRepaymentInterval. * - * e.g. The weekly meeting will have interval of 1, if the loan product - * with fortnightly frequency will have interval of 2, to generate right - * set of meeting dates reset interval same as loan repayment interval. + * e.g. The weekly meeting will have interval of 1, if the loan product with fortnightly frequency will have + * interval of 2, to generate right set of meeting dates reset interval same as loan repayment interval. */ Recur.Builder recurBuilder = getRecurBuilder(recur); @@ -598,10 +597,9 @@ public class CalendarUtils { recurBuilder = recurBuilder.interval(loanRepaymentInterval); /* - * Recurring dates should follow loanRepayment frequency. //e.g. daily - * meeting frequency should support all loan products with any type of - * frequency. to generate right set of meeting dates reset frequency - * same as loan repayment frequency. + * Recurring dates should follow loanRepayment frequency. //e.g. daily meeting frequency should support all loan + * products with any type of frequency. to generate right set of meeting dates reset frequency same as loan + * repayment frequency. */ if (recur.getFrequency().equals(Recur.Frequency.DAILY)) { @@ -676,8 +674,7 @@ public class CalendarUtils { } /** - * function returns a comma separated list of calendar_type_enum values ex. - * 1,2,3,4 + * function returns a comma separated list of calendar_type_enum values ex. 1,2,3,4 * * @param calendarTypeOptions * @return @@ -725,8 +722,7 @@ public class CalendarUtils { LocalDate date = startDate; final LocalDate seedDate = calendar.getStartDateLocalDate(); /** - * if (isValidRedurringDate(calendar.getRecurrence(), seedDate, date)) { - * date = date.plusDays(1); } + * if (isValidRedurringDate(calendar.getRecurrence(), seedDate, date)) { date = date.plusDays(1); } **/ final LocalDate scheduleDate = getNextRecurringDate(recur, seedDate, date); @@ -801,9 +797,8 @@ public class CalendarUtils { /* * Recurring dates should follow loanRepaymentInterval. * - * e.g. The weekly meeting will have interval of 1, if the loan product - * with fortnightly frequency will have interval of 2, to generate right - * set of meeting dates reset interval same as loan repayment interval. + * e.g. The weekly meeting will have interval of 1, if the loan product with fortnightly frequency will have + * interval of 2, to generate right set of meeting dates reset interval same as loan repayment interval. */ int meetingInterval = recur.getInterval(); if (meetingInterval < 1) { @@ -812,10 +807,9 @@ public class CalendarUtils { int rep = repaymentInterval < meetingInterval ? 1 : repaymentInterval / meetingInterval; /* - * Recurring dates should follow loanRepayment frequency. //e.g. daily - * meeting frequency should support all loan products with any type of - * frequency. to generate right set of meeting dates reset frequency - * same as loan repayment frequency. + * Recurring dates should follow loanRepayment frequency. //e.g. daily meeting frequency should support all loan + * products with any type of frequency. to generate right set of meeting dates reset frequency same as loan + * repayment frequency. */ Recur.Builder recurBuilder = getRecurBuilder(recur); @@ -873,9 +867,8 @@ public class CalendarUtils { final Integer interval = 4; Integer repaymentInterval = loanRepaymentInterval; /* - * check loanRepaymentInterval equal to 1, if repayments frequency is - * monthly and meeting frequency is weekly, then generate repayments - * schedule as every 4 weeks + * check loanRepaymentInterval equal to 1, if repayments frequency is monthly and meeting frequency is weekly, + * then generate repayments schedule as every 4 weeks */ if (frequency.equals(Recur.Frequency.MONTHLY.name()) && recur.getFrequency().equals(Recur.Frequency.WEEKLY)) { repaymentInterval = loanRepaymentInterval * interval; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java index d806e5adf..072d965c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java @@ -186,8 +186,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr .findByEntityIdAndEntityTypeIdAndCalendarTypeId(parent.getId(), centerEntityTypeId, CalendarType.COLLECTION.getValue()); /* - * If calendar is created by parent group, then it cannot be - * edited by the child group + * If calendar is created by parent group, then it cannot be edited by the child group */ if (collectionCalendarInstance != null) { final String errorMessage = "meeting.created.at.center.cannot.be.edited.at.group.level"; @@ -223,8 +222,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr loanStatuses); /* - * areActiveEntitiesSynced is set to true, if there are any active loans - * synced to this calendar. + * areActiveEntitiesSynced is set to true, if there are any active loans synced to this calendar. */ if (numberOfActiveLoansSyncedWithThisCalendar > 0) { @@ -246,19 +244,15 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr /* * System allows to change the meeting date by two means, * - * Option 1: reschedulebasedOnMeetingDates = false or - * reschedulebasedOnMeetingDates is not passed By directly editing the - * recurring day with effective from date and system decides the next - * meeting date based on some sensible logic (i.e., number of minimum - * days between two repayments) + * Option 1: reschedulebasedOnMeetingDates = false or reschedulebasedOnMeetingDates is not passed By directly + * editing the recurring day with effective from date and system decides the next meeting date based on some + * sensible logic (i.e., number of minimum days between two repayments) * * - * Option 2: reschedulebasedOnMeetingDates = true By providing - * alternative meeting date for one of future meeting date and derive - * the day of recurrence from the new meeting date. Ex: User proposes - * new meeting date say "14/Nov/2014" for present meeting date - * "12/Nov/2014", based on this input other values re derived and loans - * are rescheduled + * Option 2: reschedulebasedOnMeetingDates = true By providing alternative meeting date for one of future + * meeting date and derive the day of recurrence from the new meeting date. Ex: User proposes new meeting date + * say "14/Nov/2014" for present meeting date "12/Nov/2014", based on this input other values re derived and + * loans are rescheduled * */ @@ -271,8 +265,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr presentMeetingDate = command.localDateValueOfParameterNamed(CalendarSupportedParameters.PRESENT_MEETING_DATE.getValue()); /* - * New meeting date proposed will become the new start date for the - * updated calendar + * New meeting date proposed will become the new start date for the updated calendar */ changes = calendarForUpdate.updateStartDateAndDerivedFeilds(newMeetingDate); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java index 0045ce487..1dea54dd1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java @@ -357,11 +357,9 @@ public class Charge extends AbstractPersistableCustom { final String chargeAppliesToParamName = "chargeAppliesTo"; if (command.isChangeInIntegerParameterNamed(chargeAppliesToParamName, this.chargeAppliesTo)) { /* - * final Integer newValue = - * command.integerValueOfParameterNamed(chargeAppliesToParamName); - * actualChanges.put(chargeAppliesToParamName, newValue); - * actualChanges.put("locale", localeAsInput); this.chargeAppliesTo - * = ChargeAppliesTo.fromInt(newValue).getValue(); + * final Integer newValue = command.integerValueOfParameterNamed(chargeAppliesToParamName); + * actualChanges.put(chargeAppliesToParamName, newValue); actualChanges.put("locale", localeAsInput); + * this.chargeAppliesTo = ChargeAppliesTo.fromInt(newValue).getValue(); */ // AA: Do not allow to change chargeAppliesTo. @@ -506,8 +504,7 @@ public class Charge extends AbstractPersistableCustom { } /** - * Delete is a soft delete. Updates flag on charge so it wont appear - * in query/report results. + * Delete is a soft delete. Updates flag on charge so it wont appear in query/report results. * * Any fields with unique constraints and prepended with id of record. */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeRepositoryWrapper.java index 0fa68dd0b..68cb44c44 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeRepositoryWrapper.java @@ -25,14 +25,13 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link ChargeRepository} that is responsible for checking if - * {@link Charge} is returned when using findOne repository method - * and throwing an appropriate not found exception. + * Wrapper for {@link ChargeRepository} that is responsible for checking if {@link Charge} is returned when using + * findOne repository method and throwing an appropriate not found exception. *

* *

- * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link ChargeRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where {@link ChargeRepository} is + * required. *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeDueAtDisbursementCannotBePenaltyException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeDueAtDisbursementCannotBePenaltyException.java index eeeb19675..2a66f3124 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeDueAtDisbursementCannotBePenaltyException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeDueAtDisbursementCannotBePenaltyException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when attempting to crate - * charge of type penalty due at disbursement . + * {@link AbstractPlatformDomainRuleException} thrown when attempting to crate charge of type penalty due at + * disbursement . */ public class ChargeDueAtDisbursementCannotBePenaltyException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeMustBePenaltyException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeMustBePenaltyException.java index efaebd58c..972093dd0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeMustBePenaltyException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeMustBePenaltyException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when attempting to crate - * charge of type penalty due at disbursement . + * {@link AbstractPlatformDomainRuleException} thrown when attempting to crate charge of type penalty due at + * disbursement . */ public class ChargeMustBePenaltyException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeAddedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeAddedException.java index 842dfd5be..4bbcce8fd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeAddedException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeAddedException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when loan charge is not - * allowed to be added to the loan. + * {@link AbstractPlatformDomainRuleException} thrown when loan charge is not allowed to be added to the loan. */ public class LoanChargeCannotBeAddedException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeNotFoundException.java index 9971d87cf..2db934591 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeNotFoundException.java @@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * {@link AbstractPlatformDomainRuleException} thrown when loan charge does not - * exist. + * {@link AbstractPlatformDomainRuleException} thrown when loan charge does not exist. */ public class LoanChargeNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeWithoutMandatoryFieldException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeWithoutMandatoryFieldException.java index 6833b2b6f..02ea39498 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeWithoutMandatoryFieldException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeWithoutMandatoryFieldException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch - * occurs + * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch occurs */ public class LoanChargeWithoutMandatoryFieldException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java index 4484bd554..4f28d7c54 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java @@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * {@link AbstractPlatformDomainRuleException} thrown when savings account - * charge does not exist. + * {@link AbstractPlatformDomainRuleException} thrown when savings account charge does not exist. */ public class SavingsAccountChargeNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeWithoutMandatoryFieldException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeWithoutMandatoryFieldException.java index 1fdd39544..38dbeb783 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeWithoutMandatoryFieldException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeWithoutMandatoryFieldException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch - * occurs + * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch occurs */ public class SavingsAccountChargeWithoutMandatoryFieldException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ShareAccountChargeWithoutMandatoryFieldException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ShareAccountChargeWithoutMandatoryFieldException.java index 1c08ae603..adf56eb71 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ShareAccountChargeWithoutMandatoryFieldException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ShareAccountChargeWithoutMandatoryFieldException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch - * occurs + * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch occurs */ public class ShareAccountChargeWithoutMandatoryFieldException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformService.java index 0e818789c..0f8818c40 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformService.java @@ -56,8 +56,7 @@ public interface ChargeReadPlatformService { Collection retrieveLoanAccountApplicableCharges(final Long loanId, ChargeTimeType[] excludeChargeTimes); /** - * Returns all charges applicable for a given loan product (filter based on - * Currency of Selected Loan Product) + * Returns all charges applicable for a given loan product (filter based on Currency of Selected Loan Product) * * @param excludeChargeTimes * Excludes Given List of Charge Types from the response diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java index 17bb9d882..1f950c593 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java @@ -227,8 +227,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java index 5e031753a..bbafa490f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java @@ -185,9 +185,8 @@ public class ClientApiConstants { public static final String clientEntityName = "clients"; /** - * These parameters will match the class level parameters of - * {@link ClientData}. Where possible, we try to get response parameters to - * match those of request parameters. + * These parameters will match the class level parameters of {@link ClientData}. Where possible, we try to get + * response parameters to match those of request parameters. */ protected static final Set CLIENT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName, accountNoParamName, externalIdParamName, statusParamName, activeParamName, activationDateParamName, firstnameParamName, middlenameParamName, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java index d66f97d1a..2c7638101 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java @@ -49,9 +49,8 @@ public class ClientApiCollectionConstants extends ClientApiConstants { constitutionIdParamName, mainBusinessLineIdParamName)); /** - * These parameters will match the class level parameters of - * {@link ClientData}. Where possible, we try to get response parameters to - * match those of request parameters. + * These parameters will match the class level parameters of {@link ClientData}. Where possible, we try to get + * response parameters to match those of request parameters. */ protected static final Set ACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>( diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientDataValidator.java index 870d9a721..63c581c9f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientDataValidator.java @@ -104,14 +104,11 @@ public final class ClientDataValidator { baseDataValidator.reset().parameter(ClientApiConstants.savingsProductIdParamName).value(savingsProductId).ignoreIfNull() .longGreaterThanZero(); /* - * if (savingsProductId != null && - * this.fromApiJsonHelper.parameterExists(ClientApiConstants. - * datatables, element)) { final JsonArray datatables = - * this.fromApiJsonHelper.extractJsonArrayNamed(ClientApiConstants. + * if (savingsProductId != null && this.fromApiJsonHelper.parameterExists(ClientApiConstants. datatables, + * element)) { final JsonArray datatables = this.fromApiJsonHelper.extractJsonArrayNamed(ClientApiConstants. * datatables, element); if (datatables.size() > 0) { * baseDataValidator.reset().parameter(ClientApiConstants. - * savingsProductIdParamName).value(savingsProductId) - * .failWithCodeNoParameterAddedToErrorCode( + * savingsProductIdParamName).value(savingsProductId) .failWithCodeNoParameterAddedToErrorCode( * "should.not.be.used.with.datatables.parameter"); } } */ } @@ -175,12 +172,9 @@ public final class ClientDataValidator { element); baseDataValidator.reset().parameter(ClientApiConstants.activationDateParamName).value(joinedDate).notNull(); /* - * if(this.fromApiJsonHelper.parameterExists(ClientApiConstants. - * datatables,element)){ - * baseDataValidator.reset().parameter(ClientApiConstants. - * activeParamName).value(active) - * .failWithCodeNoParameterAddedToErrorCode( - * "should.not.be.used.with.datatables.parameter"); } + * if(this.fromApiJsonHelper.parameterExists(ClientApiConstants. datatables,element)){ + * baseDataValidator.reset().parameter(ClientApiConstants. activeParamName).value(active) + * .failWithCodeNoParameterAddedToErrorCode( "should.not.be.used.with.datatables.parameter"); } */ } } else { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientTimelineData.java index 685188550..52f6f982f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientTimelineData.java @@ -22,8 +22,7 @@ import java.io.Serializable; import org.joda.time.LocalDate; /** - * Immutable data object represent the important time-line events of a loan - * application and loan. + * Immutable data object represent the important time-line events of a loan application and loan. */ @SuppressWarnings("unused") public class ClientTimelineData implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java index 1c4dec636..0372bcd66 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java @@ -31,9 +31,8 @@ import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount; import org.springframework.stereotype.Component; /** - * Example {@link AccountNumberGenerator} for clients that takes an entities - * auto generated database id and zero fills it ensuring the identifier is - * always of a given maxLength. + * Example {@link AccountNumberGenerator} for clients that takes an entities auto generated database id and zero fills + * it ensuring the identifier is always of a given maxLength. */ @Component public class AccountNumberGenerator { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPersonRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPersonRepositoryWrapper.java index e2dd277f0..ec360de8e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPersonRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPersonRepositoryWrapper.java @@ -26,8 +26,7 @@ import org.springframework.stereotype.Service; /** *

- * Wrapper for {@link ClientNonPersonRepository} that adds NULL checking and - * Error handling capabilities + * Wrapper for {@link ClientNonPersonRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientRepositoryWrapper.java index 8a8fe914b..92e0b5431 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientRepositoryWrapper.java @@ -29,8 +29,7 @@ import org.springframework.transaction.annotation.Transactional; /** *

- * Wrapper for {@link ClientRepository} that adds NULL checking and Error - * handling capabilities + * Wrapper for {@link ClientRepository} that adds NULL checking and Error handling capabilities *

*/ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java index e052ba7c9..6268df727 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java @@ -139,8 +139,7 @@ public class ClientTransaction extends AbstractPersistableCustom { } /** - * Converts the content of this Client Transaction to a map which can be - * passed to the accounting module + * Converts the content of this Client Transaction to a map which can be passed to the accounting module * * * diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java index ddc64f10a..061fdbe93 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when client Identifier resources are not - * found. + * A {@link RuntimeException} thrown when client Identifier resources are not found. */ public class ClientIdentifierNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundByClientIdException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundByClientIdException.java index cf2be2425..872989425 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundByClientIdException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundByClientIdException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when clientNonPerson resources are not - * found. + * A {@link RuntimeException} thrown when clientNonPerson resources are not found. */ public class ClientNonPersonNotFoundByClientIdException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundException.java index 9ae84d7b5..99320ad1e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNonPersonNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when clientNonPerson resources are not - * found. + * A {@link RuntimeException} thrown when clientNonPerson resources are not found. */ public class ClientNonPersonNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/DuplicateClientIdentifierException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/DuplicateClientIdentifierException.java index 69999e1b4..41f3ba3b3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/DuplicateClientIdentifierException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/DuplicateClientIdentifierException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * A {@link RuntimeException} thrown when a client identifier of the particular - * type is already present + * A {@link RuntimeException} thrown when a client identifier of the particular type is already present */ public class DuplicateClientIdentifierException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientSavingProductException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientSavingProductException.java old mode 100755 new mode 100644 index e1d468d90..d0921161a --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientSavingProductException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientSavingProductException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class InvalidClientSavingProductException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientStateTransitionException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientStateTransitionException.java index 1a1df935b..bfbe4610b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientStateTransitionException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/InvalidClientStateTransitionException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class InvalidClientStateTransitionException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/handler/UpdateClientAddressCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/handler/UpdateClientAddressCommandHandler.java index 8bc7005fb..3523bfecf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/handler/UpdateClientAddressCommandHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/handler/UpdateClientAddressCommandHandler.java @@ -40,9 +40,8 @@ public class UpdateClientAddressCommandHandler implements NewCommandSourceHandle @Override public CommandProcessingResult processCommand(final JsonCommand command) { /* - * return - * this.writePlatformService.updateClientAddress(command.getClientId(), - * command.entityId(), command.getStatus(), command); + * return this.writePlatformService.updateClientAddress(command.getClientId(), command.entityId(), + * command.getStatus(), command); */ return this.writePlatformService.updateClientAddress(command.getClientId(), command); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/serialization/ClientIdentifierCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/serialization/ClientIdentifierCommandFromApiJsonDeserializer.java index 3b7f28fc8..13956afe0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/serialization/ClientIdentifierCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/serialization/ClientIdentifierCommandFromApiJsonDeserializer.java @@ -35,8 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link ClientIdentifierCommandFromApiJsonDeserializer} 's. + * Implementation of {@link FromApiJsonDeserializer} for {@link ClientIdentifierCommandFromApiJsonDeserializer} 's. */ @Component public final class ClientIdentifierCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java index fc3de2639..065d688ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java @@ -258,8 +258,7 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client /** * Validates transaction to ensure that
* charge is active
- * transaction date is valid (between client activation and todays date) - *
+ * transaction date is valid (between client activation and todays date)
* charge is not already paid or waived
* amount is not more than total due * @@ -269,8 +268,7 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client * @param transactionDate * @param amountPaid * @param requiresTransactionDateValidation - * if set to false, transaction date specific validation is - * skipped + * if set to false, transaction date specific validation is skipped * @param requiresTransactionAmountValidation * if set to false transaction amount validation is skipped * @return @@ -387,8 +385,7 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client } /** - * Ensures that the charge transaction date (for payments) is not on a - * holiday or a non working day + * Ensures that the charge transaction date (for payments) is not on a holiday or a non working day * * @param savingsAccountCharge * @param fmt diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientFamilyMembersWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientFamilyMembersWritePlatformServiceImpl.java index 1b8ec03dd..760cef1ef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientFamilyMembersWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientFamilyMembersWritePlatformServiceImpl.java @@ -249,8 +249,7 @@ public class ClientFamilyMembersWritePlatformServiceImpl implements ClientFamily } /* - * this.fromApiJsonHelper.extractDateFormatParameter(member.get( - * "dateOfBirth").getAsJsonObject()); + * this.fromApiJsonHelper.extractDateFormatParameter(member.get( "dateOfBirth").getAsJsonObject()); */ } @@ -292,8 +291,7 @@ public class ClientFamilyMembersWritePlatformServiceImpl implements ClientFamily apiJsonDeserializer.validateForUpdate(familyMemberId, command.json()); /* - * if (command.stringValueOfParameterNamed("clientFamilyMemberId") != - * null) { clientFamilyMemberId = + * if (command.stringValueOfParameterNamed("clientFamilyMemberId") != null) { clientFamilyMemberId = * command.longValueOfParameterNamed("clientFamilyMemberId"); } */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index e7f552e4e..603d67d06 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -196,8 +196,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { @@ -365,8 +364,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP } /** - * This method extracts ClientNonPerson details from Client command and - * creates a new ClientNonPerson record + * This method extracts ClientNonPerson details from Client command and creates a new ClientNonPerson record * * @param client * @param command @@ -680,9 +678,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP if (staffId != null) { staff = this.staffRepository.findByOfficeHierarchyWithNotFoundDetection(staffId, clientForUpdate.getOffice().getHierarchy()); /** - * TODO Vishwas: We maintain history of chage of loan officer w.r.t - * loan in a history table, should we do the same for a client? - * Especially useful when the change happens due to a transfer etc + * TODO Vishwas: We maintain history of chage of loan officer w.r.t loan in a history table, should we do + * the same for a client? Especially useful when the change happens due to a transfer etc **/ clientForUpdate.assignStaff(staff); } @@ -804,8 +801,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP } /* - * To become a part of a group, group may have set of criteria to be m et - * before client can become member of it. + * To become a part of a group, group may have set of criteria to be m et before client can become member of it. */ private void validateParentGroupRulesBeforeClientActivation(Client client) { Integer minNumberOfClients = configurationDomainService.retrieveMinAllowedClientsInGroup(); @@ -813,8 +809,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP if (client.getGroups() != null && maxNumberOfClients != null) { for (Group group : client.getGroups()) { /** - * Since this Client has not yet been associated with the group, - * reduce maxNumberOfClients by 1 + * Since this Client has not yet been associated with the group, reduce maxNumberOfClients by 1 **/ final boolean validationsuccess = group.isGroupsClientCountWithinMaxRange(maxNumberOfClients - 1); if (!validationsuccess) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java index 3fed35c79..a2498e7b4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java @@ -121,16 +121,13 @@ public class LoanCollateral extends AbstractPersistableCustom { } /* - * @Override public boolean equals(final Object obj) { if (obj == null) { - * return false; } if (obj == this) { return true; } if (obj.getClass() != - * getClass()) { return false; } final LoanCollateral rhs = (LoanCollateral) - * obj; return new EqualsBuilder().appendSuper(super.equals(obj)) // - * .append(getId(), rhs.getId()) // .append(this.type.getId(), - * rhs.type.getId()) // .append(this.description, rhs.description) // - * .append(this.value, this.value)// .isEquals(); } + * @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return + * true; } if (obj.getClass() != getClass()) { return false; } final LoanCollateral rhs = (LoanCollateral) obj; + * return new EqualsBuilder().appendSuper(super.equals(obj)) // .append(getId(), rhs.getId()) // + * .append(this.type.getId(), rhs.type.getId()) // .append(this.description, rhs.description) // .append(this.value, + * this.value)// .isEquals(); } * - * @Override public int hashCode() { return new HashCodeBuilder(3, 5) // - * .append(getId()) // .append(this.type.getId()) // - * .append(this.description) // .append(this.value)// .toHashCode(); } + * @Override public int hashCode() { return new HashCodeBuilder(3, 5) // .append(getId()) // + * .append(this.type.getId()) // .append(this.description) // .append(this.value)// .toHashCode(); } */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java index b76f4da05..160a9aa39 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java @@ -37,8 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link CollateralCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link CollateralCommand}'s. */ @Component public final class CollateralCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java index 477f3a5b4..6db49c30b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java @@ -86,8 +86,7 @@ public class CollateralWritePlatformServiceJpaRepositoryImpl implements Collater final LoanCollateral collateral = LoanCollateral.fromJson(loan, collateralType, command); /** - * Collaterals may be added only when the loan associated with them - * are yet to be approved + * Collaterals may be added only when the loan associated with them are yet to be approved **/ if (!loan.status().isSubmittedAndPendingApproval()) { throw new CollateralCannotBeCreatedException( @@ -133,8 +132,7 @@ public class CollateralWritePlatformServiceJpaRepositoryImpl implements Collater } /** - * Collaterals may be updated only when the loan associated with - * them are yet to be approved + * Collaterals may be updated only when the loan associated with them are yet to be approved **/ if (!loan.status().isSubmittedAndPendingApproval()) { throw new CollateralCannotBeUpdatedException( @@ -167,8 +165,7 @@ public class CollateralWritePlatformServiceJpaRepositoryImpl implements Collater } /** - * Collaterals may be deleted only when the loan associated with them - * are yet to be approved + * Collaterals may be deleted only when the loan associated with them are yet to be approved **/ if (!loan.status().isSubmittedAndPendingApproval()) { throw new CollateralCannotBeDeletedException( diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualClientData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualClientData.java index 59803c8bc..1585d84c4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualClientData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualClientData.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.collectionsheet.data; import java.util.Collection; /** - * Immutable data object for clients with loans due for disbursement or - * collection. + * Immutable data object for clients with loans due for disbursement or collection. */ public final class IndividualClientData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualCollectionSheetLoanFlatData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualCollectionSheetLoanFlatData.java index fe989027d..b4731e49a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualCollectionSheetLoanFlatData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/IndividualCollectionSheetLoanFlatData.java @@ -22,8 +22,7 @@ import java.math.BigDecimal; import org.apache.fineract.organisation.monetary.data.CurrencyData; /** - * Immutable data object for extracting flat data for joint liability group's - * collection sheet. + * Immutable data object for extracting flat data for joint liability group's collection sheet. */ public class IndividualCollectionSheetLoanFlatData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGClientData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGClientData.java index ad40290b2..fc7e3096d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGClientData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGClientData.java @@ -22,8 +22,7 @@ import java.util.Collection; import org.apache.fineract.infrastructure.core.data.EnumOptionData; /** - * Immutable data object for clients with loans due for disbursement or - * collection. + * Immutable data object for clients with loans due for disbursement or collection. */ public final class JLGClientData { @@ -48,10 +47,9 @@ public final class JLGClientData { } /* - * public JLGClientData(final Long clientId, final String clientName, final - * Collection loans, final EnumOptionData attendanceType) { - * this.clientId = clientId; this.clientName = clientName; this.loans = - * loans; this.attendanceType = attendanceType; } + * public JLGClientData(final Long clientId, final String clientName, final Collection loans, final + * EnumOptionData attendanceType) { this.clientId = clientId; this.clientName = clientName; this.loans = loans; + * this.attendanceType = attendanceType; } */ public static JLGClientData withAttendance(final Long clientId, final String clientName, final EnumOptionData attendanceType) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGCollectionSheetFlatData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGCollectionSheetFlatData.java index c4409faee..da9b86568 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGCollectionSheetFlatData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGCollectionSheetFlatData.java @@ -23,8 +23,7 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.organisation.monetary.data.CurrencyData; /** - * Immutable data object for extracting flat data for joint liability group's - * collection sheet. + * Immutable data object for extracting flat data for joint liability group's collection sheet. */ public class JLGCollectionSheetFlatData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGGroupData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGGroupData.java index 05d4a3e35..e1e977970 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGGroupData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/JLGGroupData.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.collectionsheet.data; import java.util.Collection; /** - * Immutable data object for groups with clients due for disbursement or - * collection. + * Immutable data object for groups with clients due for disbursement or collection. */ public final class JLGGroupData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/LoanDueData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/LoanDueData.java index f7974d246..da09280ef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/LoanDueData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/LoanDueData.java @@ -22,8 +22,7 @@ import java.math.BigDecimal; import org.apache.fineract.organisation.monetary.data.CurrencyData; /** - * Immutable data object for representing loan with dues (example: loan is due - * for disbursement, repayments). + * Immutable data object for representing loan with dues (example: loan is due for disbursement, repayments). */ public class LoanDueData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/SavingsDueData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/SavingsDueData.java index b15684a20..bcd2196bb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/SavingsDueData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/data/SavingsDueData.java @@ -22,8 +22,7 @@ import java.math.BigDecimal; import org.apache.fineract.organisation.monetary.data.CurrencyData; /** - * Immutable data object for representing loan with dues (example: loan is due - * for disbursement, repayments). + * Immutable data object for representing loan with dues (example: loan is due for disbursement, repayments). */ public final class SavingsDueData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkDisbursalCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkDisbursalCommandFromApiJsonDeserializer.java index 9a18e1afb..72e146797 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkDisbursalCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkDisbursalCommandFromApiJsonDeserializer.java @@ -35,8 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link CollectionSheetBulkDisbursalCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link CollectionSheetBulkDisbursalCommand}'s. */ @Component public final class CollectionSheetBulkDisbursalCommandFromApiJsonDeserializer diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer.java index 1fa9b6573..1bf8e2f55 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/serialization/CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer.java @@ -37,8 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link CollectionSheetBulkRepaymentCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link CollectionSheetBulkRepaymentCommand}'s. */ @Component public final class CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java index f78961981..9bae3caef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java @@ -120,9 +120,8 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe } /* - * Reads all the loans which are due for disbursement or collection and - * builds hierarchical data structure for collections sheet with hierarchy - * Groups >> Clients >> Loans. + * Reads all the loans which are due for disbursement or collection and builds hierarchical data structure for + * collections sheet with hierarchy Groups >> Clients >> Loans. */ @SuppressWarnings("null") private JLGCollectionSheetData buildJLGCollectionSheet(final LocalDate dueDate, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInMonthType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInMonthType.java index f2e0474eb..52590194f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInMonthType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInMonthType.java @@ -23,8 +23,7 @@ import java.util.List; /** * - * People typically use either of the following settings when calculating there - * interest using the daily method: + * People typically use either of the following settings when calculating there interest using the daily method: *
    *
  • Actual or
  • *
  • 30
  • diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInYearType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInYearType.java index f80bf73d3..956c54ac8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInYearType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/domain/DaysInYearType.java @@ -23,8 +23,7 @@ import java.util.List; /** * - * People typically use either of the following settings when calculating there - * interest using the daily method: + * People typically use either of the following settings when calculating there interest using the daily method: *
      *
    • Actual or
    • *
    • 360 or
    • diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventListner.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventListner.java old mode 100755 new mode 100644 index 67eb063ec..d1fecb3a2 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventListner.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventListner.java @@ -22,9 +22,8 @@ import java.util.Map; import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEntity; /** - * The interface to be implemented by classes that want to be informed when a - * Business Event executes. example: on completion of loan approval event need - * to block guarantor funds + * The interface to be implemented by classes that want to be informed when a Business Event executes. example: on + * completion of loan approval event need to block guarantor funds * */ public interface BusinessEventListner { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierService.java old mode 100755 new mode 100644 index 800f57e52..1d267a326 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierService.java @@ -23,33 +23,28 @@ import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.B import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEvents; /** - * Implemented class is responsible for notifying the business event to - * registered listeners. + * Implemented class is responsible for notifying the business event to registered listeners. * */ public interface BusinessEventNotifierService { /** - * Method should be called to notify listeners before Business event - * execution for any pre-processing of event + * Method should be called to notify listeners before Business event execution for any pre-processing of event */ public void notifyBusinessEventToBeExecuted(BusinessEvents businessEvent, Map businessEventEntity); /** - * Method should be called to notify listeners after Business event - * execution for any post-processing of event + * Method should be called to notify listeners after Business event execution for any post-processing of event */ public void notifyBusinessEventWasExecuted(BusinessEvents businessEvent, Map businessEventEntity); /** - * Method is to register a class as listener for pre-processing of any - * Business event + * Method is to register a class as listener for pre-processing of any Business event */ public void addBusinessEventPreListners(BusinessEvents businessEvent, BusinessEventListner businessEventListner); /** - * Method is to register a class as listener for post-processing of any - * Business event + * Method is to register a class as listener for post-processing of any Business event */ public void addBusinessEventPostListners(BusinessEvents businessEvent, BusinessEventListner businessEventListner); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierServiceImpl.java index 7d2d318a5..18dff7570 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/common/service/BusinessEventNotifierServiceImpl.java @@ -35,11 +35,9 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe /* * (non-Javadoc) * - * @see - * org.apache.fineract.portfolio.common.service.BusinessEventNotifierService - * #notifyBusinessEventToBeExecuted - * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants - * .BusinessEvents, org.springframework.data.jpa.domain.AbstractPersistable) + * @see org.apache.fineract.portfolio.common.service.BusinessEventNotifierService #notifyBusinessEventToBeExecuted + * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants .BusinessEvents, + * org.springframework.data.jpa.domain.AbstractPersistable) */ @Override public void notifyBusinessEventToBeExecuted(BusinessEvents businessEvent, Map businessEventEntity) { @@ -54,11 +52,9 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe /* * (non-Javadoc) * - * @see - * org.apache.fineract.portfolio.common.service.BusinessEventNotifierService - * #notifyBusinessEventWasExecuted - * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants - * .BusinessEvents, org.springframework.data.jpa.domain.AbstractPersistable) + * @see org.apache.fineract.portfolio.common.service.BusinessEventNotifierService #notifyBusinessEventWasExecuted + * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants .BusinessEvents, + * org.springframework.data.jpa.domain.AbstractPersistable) */ @Override public void notifyBusinessEventWasExecuted(BusinessEvents businessEvent, Map businessEventEntity) { @@ -73,11 +69,8 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe /* * (non-Javadoc) * - * @see - * org.apache.fineract.portfolio.common.service.BusinessEventNotifierService - * #addBusinessEventPreListners - * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants - * .BusinessEvents, + * @see org.apache.fineract.portfolio.common.service.BusinessEventNotifierService #addBusinessEventPreListners + * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants .BusinessEvents, * org.apache.fineract.portfolio.common.service.BusinessEventListner) */ @Override @@ -88,11 +81,8 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe /* * (non-Javadoc) * - * @see - * org.apache.fineract.portfolio.common.service.BusinessEventNotifierService - * #addBusinessEventPostListners - * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants - * .BusinessEvents, + * @see org.apache.fineract.portfolio.common.service.BusinessEventNotifierService #addBusinessEventPostListners + * (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants .BusinessEvents, * org.apache.fineract.portfolio.common.service.BusinessEventListner) */ @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java index d0495552e..f4786c794 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java @@ -109,8 +109,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleFundDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { if (realCause.getMessage().contains("fund_externalid_org")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupingTypesApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupingTypesApiConstants.java index 9b7dcc190..34e55c227 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupingTypesApiConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupingTypesApiConstants.java @@ -89,9 +89,8 @@ public class GroupingTypesApiConstants { public static final String datatables = "datatables"; /** - * These parameters will match the class level parameters of - * {@link CenterData}. Where possible, we try to get response parameters to - * match those of request parameters. + * These parameters will match the class level parameters of {@link CenterData}. Where possible, we try to get + * response parameters to match those of request parameters. */ protected static final Set CENTER_RESPONSE_DATA_PARAMETERS = new HashSet<>( Arrays.asList(idParamName, nameParamName, externalIdParamName, officeIdParamName, officeNameParamName, staffIdParamName, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java index 310677caf..e9503acb8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java @@ -32,8 +32,7 @@ import org.apache.fineract.portfolio.client.data.ClientData; import org.joda.time.LocalDate; /** - * Immutable data object representing a general group (so may or may not have a - * parent). + * Immutable data object representing a general group (so may or may not have a parent). */ public class GroupGeneralData implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupTimelineData.java index 8aeb3b8ba..3db962b63 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupTimelineData.java @@ -23,8 +23,7 @@ import java.util.Objects; import org.joda.time.LocalDate; /** - * Immutable data object represent the important time-line events of a - * group/center. + * Immutable data object represent the important time-line events of a group/center. * */ @SuppressWarnings("unused") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java index 3ea03578f..746b311a0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java @@ -215,8 +215,7 @@ public final class Group extends AbstractPersistableCustom { associateClients(clientMembers); /* - * Always keep status change at the bottom, as status change rule - * depends on the attribute's value + * Always keep status change at the bottom, as status change rule depends on the attribute's value */ setStatus(activationDate, currentUser, status, dataValidationErrors); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRepositoryWrapper.java index 4d02ee70d..a06fa308e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRepositoryWrapper.java @@ -27,8 +27,7 @@ import org.springframework.stereotype.Service; /** *

      - * Wrapper for {@link GroupRepository} that adds NULL checking and Error - * handling capabilities + * Wrapper for {@link GroupRepository} that adds NULL checking and Error handling capabilities *

      */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/InvalidGroupLevelException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/InvalidGroupLevelException.java index 150d3393c..27f4667ba 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/InvalidGroupLevelException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/InvalidGroupLevelException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.group.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when parentGroup'd level - * is not equal to parent level of the levelid param,. + * {@link AbstractPlatformDomainRuleException} thrown when parentGroup'd level is not equal to parent level of the + * levelid param,. */ public class InvalidGroupLevelException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java index 37cf4bed2..3d221d24c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java @@ -221,8 +221,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group this.groupRepository.save(newGroup); /* - * Generate hierarchy for a new center/group and all the child - * groups if they exist + * Generate hierarchy for a new center/group and all the child groups if they exist */ newGroup.generateHierarchy(); @@ -419,9 +418,8 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group final GroupLevel groupLevel = this.groupLevelRepository.findById(groupForUpdate.getGroupLevel().getId()).orElse(null); /* - * Ignoring parentId param, if group for update is super parent. - * TODO Need to check: Ignoring is correct or need throw unsupported - * param + * Ignoring parentId param, if group for update is super parent. TODO Need to check: Ignoring is correct or + * need throw unsupported param */ if (!groupLevel.isSuperParent()) { @@ -445,10 +443,8 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group throw new InvalidOfficeException("group", "attach.to.parent.group", errorMessage); } /* - * If Group is not super parent then validate group - * level's parent level is same as group parent's level - * this check makes sure new group is added at immediate - * next level in hierarchy + * If Group is not super parent then validate group level's parent level is same as group + * parent's level this check makes sure new group is added at immediate next level in hierarchy */ if (!groupForUpdate.getGroupLevel().isIdentifiedByParentId(newParentGroup.getGroupLevel().getId())) { @@ -467,12 +463,9 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group } /* - * final Set clientMembers = assembleSetOfClients(officeId, - * command); List changes = - * groupForUpdate.updateClientMembersIfDifferent(clientMembers); if - * (!changes.isEmpty()) { - * actualChanges.put(GroupingTypesApiConstants - * .clientMembersParamName, changes); } + * final Set clientMembers = assembleSetOfClients(officeId, command); List changes = + * groupForUpdate.updateClientMembersIfDifferent(clientMembers); if (!changes.isEmpty()) { + * actualChanges.put(GroupingTypesApiConstants .clientMembersParamName, changes); } */ this.groupRepository.saveAndFlush(groupForUpdate); @@ -550,8 +543,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group if (inheritStaffForClientAccounts) { LocalDate loanOfficerReassignmentDate = LocalDate.now(); /* - * update loan officer for client and update loan officer for - * clients loans and savings + * update loan officer for client and update loan officer for clients loans and savings */ Set clients = groupForUpdate.getClientMembers(); if (clients != null) { @@ -767,8 +759,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleGroupDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve, final GroupTypes groupLevel) { @@ -982,8 +973,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group } /** - * Group shouldn't have a meeting when no meeting attached for - * center + * Group shouldn't have a meeting when no meeting attached for center */ if (ceneterCalendar == null && groupCalendar != null) { throw new GeneralPlatformDomainRuleException( @@ -991,8 +981,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group "Group with id " + group.getId() + " is already associated with meeting", group.getId()); } /** - * Group meeting recurrence should match with center meeting - * recurrence + * Group meeting recurrence should match with center meeting recurrence */ else if (ceneterCalendar != null && groupCalendar != null) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartRepositoryWrapper.java index e2bca6efd..e1dfbcad5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartRepositoryWrapper.java @@ -25,15 +25,13 @@ import org.springframework.stereotype.Service; /** *

      - * Wrapper for {@link InterestRateChartRepository} that is responsible for - * checking if {@link InterestRateChart} is returned when using - * findOne repository method and throwing an appropriate not found - * exception. + * Wrapper for {@link InterestRateChartRepository} that is responsible for checking if {@link InterestRateChart} is + * returned when using findOne repository method and throwing an appropriate not found exception. *

      * *

      - * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link InterestRateChartRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where + * {@link InterestRateChartRepository} is required. *

      */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartSlabRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartSlabRepositoryWrapper.java index 7cbea3024..64f811b46 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartSlabRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartSlabRepositoryWrapper.java @@ -25,15 +25,13 @@ import org.springframework.stereotype.Service; /** *

      - * Wrapper for {@link InterestRateChartSlabRepository} that is responsible for - * checking if {@link InterestRateChartSlab} is returned when using - * findOne repository method and throwing an appropriate not found - * exception. + * Wrapper for {@link InterestRateChartSlabRepository} that is responsible for checking if {@link InterestRateChartSlab} + * is returned when using findOne repository method and throwing an appropriate not found exception. *

      * *

      - * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link InterestRateChartSlabRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where + * {@link InterestRateChartSlabRepository} is required. *

      */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java old mode 100755 new mode 100644 index 937095f2a..4414bfbee --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java @@ -45,10 +45,8 @@ public class InterestIncentives extends AbstractPersistableCustom { } /* - * public InterestIncentives(final InterestRateChartSlab - * interestRateChartSlab, final InterestIncentivesFields - * interestIncentivesFields) { this.interestRateChartSlab = - * interestRateChartSlab; this.interestIncentivesFields = + * public InterestIncentives(final InterestRateChartSlab interestRateChartSlab, final InterestIncentivesFields + * interestIncentivesFields) { this.interestRateChartSlab = interestRateChartSlab; this.interestIncentivesFields = * interestIncentivesFields; } */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java index a965e0819..3166d66d9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java @@ -264,8 +264,7 @@ public class InterestRateChart extends AbstractPersistableCustom { } else { /** - * TODO: AA: Move this code to - * InterestRateChartSlabAssembler + * TODO: AA: Move this code to InterestRateChartSlabAssembler */ final String description = chartSlabsCommand.stringValueOfParameterNamed(descriptionParamName); final Integer periodTypeId = chartSlabsCommand.integerValueOfParameterNamed(periodTypeParamName, locale); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java index b7836b2ab..39d3d2ede 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java @@ -60,8 +60,7 @@ public class InterestRateChartAssembler { } /** - * Assembles a new {@link InterestRateChart} from JSON Slabs passed in - * request + * Assembles a new {@link InterestRateChart} from JSON Slabs passed in request */ public InterestRateChart assembleFrom(final JsonCommand command) { final List dataValidationErrors = new ArrayList<>(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java index 153bd6453..35fc2673a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java @@ -69,8 +69,7 @@ public class InterestRateChartSlabAssembler { } /** - * Assembles a new {@link InterestRateChartSlab} from JSON Slabs passed in - * request + * Assembles a new {@link InterestRateChartSlab} from JSON Slabs passed in request */ public InterestRateChartSlab assembleFrom(final JsonCommand command) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java index 8da259908..fe46eebfc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java @@ -324,10 +324,9 @@ public class LoansApiResource { } /* - * This template API is used for loan approval, ideally this should be - * invoked on loan that are pending for approval. But system does not - * validate the status of the loan, it returns the template irrespective of - * loan status + * This template API is used for loan approval, ideally this should be invoked on loan that are pending for + * approval. But system does not validate the status of the loan, it returns the template irrespective of loan + * status */ @GET diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/command/UpdateLoanOfficerCommand.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/command/UpdateLoanOfficerCommand.java index bbbb87115..816ffc04d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/command/UpdateLoanOfficerCommand.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/command/UpdateLoanOfficerCommand.java @@ -26,8 +26,7 @@ import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidati import org.joda.time.LocalDate; /** - * Immutable data object for updating relationship between loan officer and a - * loan. + * Immutable data object for updating relationship between loan officer and a loan. */ public class UpdateLoanOfficerCommand { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java index c8714505c..900e12d11 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java @@ -463,8 +463,7 @@ public final class LoanAccountData { } /** - * Used to produce a {@link LoanAccountData} with only collateral options - * for now. + * Used to produce a {@link LoanAccountData} with only collateral options for now. */ public static LoanAccountData collateralTemplate(final Collection loanCollateralOptions) { final Long id = null; @@ -607,8 +606,7 @@ public final class LoanAccountData { } /** - * Used to produce a {@link LoanAccountData} with only client information - * defaulted. + * Used to produce a {@link LoanAccountData} with only client information defaulted. */ public static LoanAccountData clientDefaults(final Long clientId, final String clientAccountNo, final String clientName, final Long clientOfficeId, final LocalDate expectedDisbursementDate) { @@ -780,8 +778,7 @@ public final class LoanAccountData { } /** - * Used to produce a {@link LoanAccountData} with only group information - * defaulted. + * Used to produce a {@link LoanAccountData} with only group information defaulted. */ public static LoanAccountData groupDefaults(final GroupGeneralData group, final LocalDate expectedDisbursementDate) { @@ -1174,8 +1171,7 @@ public final class LoanAccountData { } /* - * Used to send back loan account data with the basic details coming from - * query. + * Used to send back loan account data with the basic details coming from query. */ public static LoanAccountData basicLoanDetails(final Long id, final String accountNo, final LoanStatusEnumData status, final String externalId, final Long clientId, final String clientAccountNo, final String clientName, final Long clientOfficeId, @@ -1265,8 +1261,7 @@ public final class LoanAccountData { } /* - * Used to combine the associations and template data on top of exist loan - * account data + * Used to combine the associations and template data on top of exist loan account data */ public static LoanAccountData associationsAndTemplate(final LoanAccountData acc, final LoanScheduleData repaymentSchedule, final Collection transactions, final Collection charges, @@ -1872,8 +1867,7 @@ public final class LoanAccountData { } /** - * Used to produce a {@link LoanAccountData} with only collateral options - * for now. + * Used to produce a {@link LoanAccountData} with only collateral options for now. * * @return {@link LoanAccountData} object */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanApplicationTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanApplicationTimelineData.java index e587605a8..18d8df487 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanApplicationTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanApplicationTimelineData.java @@ -23,8 +23,7 @@ import org.apache.fineract.organisation.monetary.data.CurrencyData; import org.joda.time.LocalDate; /** - * Immutable data object represent the important time-line events of a loan - * application and loan. + * Immutable data object represent the important time-line events of a loan application and loan. */ @SuppressWarnings("unused") public class LoanApplicationTimelineData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargeData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargeData.java index dfaba085f..9e1b00c94 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargeData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargeData.java @@ -87,8 +87,7 @@ public class LoanChargeData { } /** - * used when populating with details from charge definition (for crud on - * charges) + * used when populating with details from charge definition (for crud on charges) */ public static LoanChargeData newLoanChargeDetails(final Long chargeId, final String name, final CurrencyData currency, final BigDecimal amount, final BigDecimal percentage, final EnumOptionData chargeTimeType, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionEnumData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionEnumData.java index 7aee9b1f1..f970eb518 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionEnumData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionEnumData.java @@ -80,8 +80,8 @@ public class LoanTransactionEnumData { } /** - * Returns true if the transaction involves either a payment (disbursement) - * or a receipt (repayments, repayments during disbursement etc) + * Returns true if the transaction involves either a payment (disbursement) or a receipt (repayments, repayments + * during disbursement etc) * * @return */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/ChangedTransactionDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/ChangedTransactionDetail.java old mode 100755 new mode 100644 index 2e7c89181..e76f603b8 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/ChangedTransactionDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/ChangedTransactionDetail.java @@ -22,8 +22,7 @@ import java.util.HashMap; import java.util.Map; /** - * Stores details of {@link LoanTransaction}'s that were reversed or newly - * created + * Stores details of {@link LoanTransaction}'s that were reversed or newly created * * */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index e6ad2a67e..369397e98 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -506,10 +506,8 @@ public class Loan extends AbstractPersistableCustom { this.createStandingInstructionAtDisbursement = createStandingInstructionAtDisbursement; /* - * During loan origination stage and before loan is approved - * principal_amount, approved_principal and principal_amount_demanded - * will same amount and that amount is same as applicant loan demanded - * amount. + * During loan origination stage and before loan is approved principal_amount, approved_principal and + * principal_amount_demanded will same amount and that amount is same as applicant loan demanded amount. */ this.proposedPrincipal = this.loanRepaymentScheduleDetail.getPrincipal().getAmount(); @@ -642,13 +640,11 @@ public class Loan extends AbstractPersistableCustom { } /** - * Creates a loanTransaction for "Apply Charge Event" with transaction date - * set to "suppliedTransactionDate". The newly created transaction is also - * added to the Loan on which this method is called. + * Creates a loanTransaction for "Apply Charge Event" with transaction date set to "suppliedTransactionDate". The + * newly created transaction is also added to the Loan on which this method is called. * - * If "suppliedTransactionDate" is not passed Id, the transaction date is - * set to the loans due date if the due date is lesser than todays date. If - * not, the transaction date is set to todays date + * If "suppliedTransactionDate" is not passed Id, the transaction date is set to the loans due date if the due date + * is lesser than todays date. If not, the transaction date is set to todays date * * @param loanCharge * @param suppliedTransactionDate @@ -787,12 +783,11 @@ public class Loan extends AbstractPersistableCustom { .determineProcessor(this.transactionProcessingStrategy); if (!loanCharge.isDueAtDisbursement() && loanCharge.isPaidOrPartiallyPaid(loanCurrency())) { /**** - * TODO Vishwas Currently we do not allow removing a loan charge - * after a loan is approved (hence there is no need to adjust any - * loan transactions). + * TODO Vishwas Currently we do not allow removing a loan charge after a loan is approved (hence there is no + * need to adjust any loan transactions). * - * Consider removing this block of code or logically completing it - * for the future by getting the list of affected Transactions + * Consider removing this block of code or logically completing it for the future by getting the list of + * affected Transactions ***/ final List allNonContraTransactionsPostDisbursement = retreiveListOfTransactionsPostDisbursement(); loanRepaymentScheduleTransactionProcessor.handleTransaction(getDisbursementDate(), allNonContraTransactionsPostDisbursement, @@ -856,12 +851,11 @@ public class Loan extends AbstractPersistableCustom { .determineProcessor(this.transactionProcessingStrategy); if (!loanCharge.isDueAtDisbursement()) { /**** - * TODO Vishwas Currently we do not allow waiving updating loan - * charge after a loan is approved (hence there is no need to adjust - * any loan transactions). + * TODO Vishwas Currently we do not allow waiving updating loan charge after a loan is approved (hence there + * is no need to adjust any loan transactions). * - * Consider removing this block of code or logically completing it - * for the future by getting the list of affected Transactions + * Consider removing this block of code or logically completing it for the future by getting the list of + * affected Transactions ***/ final List allNonContraTransactionsPostDisbursement = retreiveListOfTransactionsPostDisbursement(); loanRepaymentScheduleTransactionProcessor.handleTransaction(getDisbursementDate(), allNonContraTransactionsPostDisbursement, @@ -1045,12 +1039,11 @@ public class Loan extends AbstractPersistableCustom { .determineProcessor(this.transactionProcessingStrategy); if (!loanCharge.isDueAtDisbursement() && loanCharge.isPaidOrPartiallyPaid(loanCurrency())) { /**** - * TODO Vishwas Currently we do not allow waiving fully paid loan - * charge and waiving partially paid loan charges only waives the - * remaining amount. + * TODO Vishwas Currently we do not allow waiving fully paid loan charge and waiving partially paid loan + * charges only waives the remaining amount. * - * Consider removing this block of code or logically completing it - * for the future by getting the list of affected Transactions + * Consider removing this block of code or logically completing it for the future by getting the list of + * affected Transactions ***/ final List allNonContraTransactionsPostDisbursement = retreiveListOfTransactionsPostDisbursement(); loanRepaymentScheduleTransactionProcessor.handleTransaction(getDisbursementDate(), allNonContraTransactionsPostDisbursement, @@ -1227,8 +1220,7 @@ public class Loan extends AbstractPersistableCustom { } /** - * method updates accrual derived fields on installments and reverse the - * unprocessed transactions + * method updates accrual derived fields on installments and reverse the unprocessed transactions */ private void applyAccurals(AppUser currentUser) { Collection accruals = retreiveListOfAccrualTransactions(); @@ -2024,8 +2016,7 @@ public class Loan extends AbstractPersistableCustom { validateDisbursementDateIsOnHoliday(allowTransactionsOnHoliday, holidays); /** - * Copy interest recalculation settings if interest recalculation is - * enabled + * Copy interest recalculation settings if interest recalculation is enabled */ if (this.loanRepaymentScheduleDetail.isInterestRecalculationEnabled()) { @@ -2156,20 +2147,16 @@ public class Loan extends AbstractPersistableCustom { final Map actualChanges = new LinkedHashMap<>(); /* - * statusEnum is holding the possible new status derived from - * loanLifecycleStateMachine.transition. + * statusEnum is holding the possible new status derived from loanLifecycleStateMachine.transition. */ final LoanStatus newStatusEnum = loanLifecycleStateMachine.transition(LoanEvent.LOAN_APPROVED, LoanStatus.fromInt(this.loanStatus)); /* - * FIXME: There is no need to check below condition, if - * loanLifecycleStateMachine.transition is doing it's responsibility - * properly. Better implementation approach is, if code passes invalid - * combination of states (fromState and toState), state machine should - * return invalidate state and below if condition should check for not - * equal to invalidateState, instead of check new value is same as - * present value. + * FIXME: There is no need to check below condition, if loanLifecycleStateMachine.transition is doing it's + * responsibility properly. Better implementation approach is, if code passes invalid combination of states + * (fromState and toState), state machine should return invalidate state and below if condition should check for + * not equal to invalidateState, instead of check new value is same as present value. */ if (!newStatusEnum.hasStateOf(LoanStatus.fromInt(this.loanStatus))) { @@ -2198,9 +2185,8 @@ public class Loan extends AbstractPersistableCustom { this.approvedPrincipal = approvedLoanAmount; /* - * All the calculations are done based on the principal - * amount, so it is necessary to set principal amount to - * approved amount + * All the calculations are done based on the principal amount, so it is necessary to set principal + * amount to approved amount */ this.loanRepaymentScheduleDetail.setPrincipal(approvedLoanAmount); @@ -2368,9 +2354,8 @@ public class Loan extends AbstractPersistableCustom { final Money interestApplied = Money.of(getCurrency(), this.summary.getTotalInterestCharged()); /** - * Add an interest applied transaction of the interest is accrued - * upfront (Up front accrual), no accounting or cash based accounting is - * selected + * Add an interest applied transaction of the interest is accrued upfront (Up front accrual), no accounting or + * cash based accounting is selected **/ if ((isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct() && isMultiDisburmentLoan() @@ -2635,8 +2620,7 @@ public class Loan extends AbstractPersistableCustom { } /* - * Ability to regenerate the repayment schedule based on the loans current - * details/state. + * Ability to regenerate the repayment schedule based on the loans current details/state. */ public void regenerateRepaymentSchedule(final ScheduleGeneratorDTO scheduleGeneratorDTO, final AppUser currentUser) { final LoanScheduleModel loanSchedule = regenerateScheduleModel(scheduleGeneratorDTO); @@ -2711,15 +2695,13 @@ public class Loan extends AbstractPersistableCustom { // for (charges due at time of disbursement) /*** - * TODO Vishwas: do we need to be able to pass in payment type details - * for repayments at disbursements too? + * TODO Vishwas: do we need to be able to pass in payment type details for repayments at disbursements too? ***/ final Money totalFeeChargesDueAtDisbursement = this.summary.getTotalFeeChargesDueAtDisbursement(loanCurrency()); /** - * all Charges repaid at disbursal is marked as repaid and "APPLY - * Charge" transactions are created for all other fees ( which are - * created during disbursal but not repaid) + * all Charges repaid at disbursal is marked as repaid and "APPLY Charge" transactions are created for all other + * fees ( which are created during disbursal but not repaid) **/ Money disbursentMoney = Money.zero(getCurrency()); @@ -2744,8 +2726,7 @@ public class Loan extends AbstractPersistableCustom { } } else if (disbursedOn.equals(new LocalDate(this.actualDisbursementDate))) { /** - * create a Charge applied transaction if Up front Accrual, None - * or Cash based accounting is enabled + * create a Charge applied transaction if Up front Accrual, None or Cash based accounting is enabled **/ if (isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()) { handleChargeAppliedTransaction(charge, disbursedOn, currentUser); @@ -3132,9 +3113,8 @@ public class Loan extends AbstractPersistableCustom { mapEntry.getValue().updateLoan(this); } /*** - * Commented since throwing exception if external id present for one - * of the transactions. for this need to save the reversed - * transactions first and then new transactions. + * Commented since throwing exception if external id present for one of the transactions. for this need to + * save the reversed transactions first and then new transactions. */ this.loanTransactions.addAll(changedTransactionDetail.getNewTransactionMappings().values()); } @@ -3142,8 +3122,7 @@ public class Loan extends AbstractPersistableCustom { updateLoanSummaryDerivedFields(); /** - * FIXME: Vishwas, skipping post loan transaction checks for Loan - * recoveries + * FIXME: Vishwas, skipping post loan transaction checks for Loan recoveries **/ if (loanTransaction.isNotRecoveryRepayment()) { doPostLoanTransactionChecks(loanTransaction.getTransactionDate(), loanLifecycleStateMachine); @@ -3786,8 +3765,8 @@ public class Loan extends AbstractPersistableCustom { } /** - * Behaviour added to comply with capability of previous mifos product to - * support easier transition to fineract platform. + * Behaviour added to comply with capability of previous mifos product to support easier transition to fineract + * platform. */ public void closeAsMarkedForReschedule(final JsonCommand command, final LoanLifecycleStateMachine loanLifecycleStateMachine, final Map changes) { @@ -4339,11 +4318,10 @@ public class Loan extends AbstractPersistableCustom { receivableInterest = receivableInterest.zero(); } /* - * if (transaction.getTransactionDate().isAfter(tillDate) && - * transaction.isAccrual()) { final String errorMessage = - * "The date on which a loan is interest waived cannot be in after accrual transactions." - * ; throw new InvalidLoanStateTransitionException("waive", - * "cannot.be.after.accrual.date", errorMessage, tillDate); } + * if (transaction.getTransactionDate().isAfter(tillDate) && transaction.isAccrual()) { final String + * errorMessage = "The date on which a loan is interest waived cannot be in after accrual transactions." ; + * throw new InvalidLoanStateTransitionException("waive", "cannot.be.after.accrual.date", errorMessage, + * tillDate); } */ } return receivableInterest; @@ -4371,8 +4349,7 @@ public class Loan extends AbstractPersistableCustom { // first repayment's from date is same as disbursement date. /* - * meetingStartDate is used as seedDate Capture the seedDate from user - * and use the seedDate as meetingStart date + * meetingStartDate is used as seedDate Capture the seedDate from user and use the seedDate as meetingStart date */ LocalDate tmpFromDate = getDisbursementDate(); @@ -5129,14 +5106,11 @@ public class Loan extends AbstractPersistableCustom { existingTransactionIds.addAll(findExistingTransactionIds()); existingReversedTransactionIds.addAll(findExistingReversedTransactionIds()); /* - * LocalDate recalculateFrom = null; List - * loanTransactions = - * this.retreiveListOfTransactionsPostDisbursementExcludeAccruals(); for - * (LoanTransaction loanTransaction : loanTransactions) { if - * (recalculateFrom == null || - * loanTransaction.getTransactionDate().isAfter(recalculateFrom)) { - * recalculateFrom = loanTransaction.getTransactionDate(); } } - * generatorDTO.setRecalculateFrom(recalculateFrom); + * LocalDate recalculateFrom = null; List loanTransactions = + * this.retreiveListOfTransactionsPostDisbursementExcludeAccruals(); for (LoanTransaction loanTransaction : + * loanTransactions) { if (recalculateFrom == null || + * loanTransaction.getTransactionDate().isAfter(recalculateFrom)) { recalculateFrom = + * loanTransaction.getTransactionDate(); } } generatorDTO.setRecalculateFrom(recalculateFrom); */ if (this.repaymentScheduleDetail().isInterestRecalculationEnabled()) { regenerateRepaymentScheduleWithInterestRecalculation(generatorDTO, currentUser); @@ -5165,9 +5139,8 @@ public class Loan extends AbstractPersistableCustom { mapEntry.getValue().updateLoan(this); } /*** - * Commented since throwing exception if external id present for one of - * the transactions. for this need to save the reversed transactions - * first and then new transactions. + * Commented since throwing exception if external id present for one of the transactions. for this need to save + * the reversed transactions first and then new transactions. */ this.loanTransactions.addAll(changedTransactionDetail.getNewTransactionMappings().values()); updateLoanSummaryDerivedFields(); @@ -6059,8 +6032,7 @@ public class Loan extends AbstractPersistableCustom { } /** - * Reverse only disbursement, accruals, and repayments at disbursal - * transactions + * Reverse only disbursement, accruals, and repayments at disbursal transactions * * @param actualDisbursementDate * @return diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainService.java index fc1e3d5ce..bf02097eb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainService.java @@ -50,9 +50,8 @@ public interface LoanAccountDomainService { BigDecimal transactionAmount, PaymentDetail paymentDetail, String noteText, String txnExternalId); /** - * This method is to recalculate and accrue the income till the last accrued - * date. this method is used when the schedule changes due to interest - * recalculation + * This method is to recalculate and accrue the income till the last accrued date. this method is used when the + * schedule changes due to interest recalculation * * @param loan */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java index 1a9734f2a..41d244fdc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java @@ -157,14 +157,10 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { // TODO: Is it required to validate transaction date with meeting dates // if repayments is synced with meeting? /* - * if(loan.isSyncDisbursementWithMeeting()){ // validate actual - * disbursement date against meeting date CalendarInstance - * calendarInstance = - * this.calendarInstanceRepository.findCalendarInstaneByLoanId - * (loan.getId(), CalendarEntityType.LOANS.getValue()); - * this.loanEventApiJsonValidator - * .validateRepaymentDateWithMeetingDate(transactionDate, - * calendarInstance); } + * if(loan.isSyncDisbursementWithMeeting()){ // validate actual disbursement date against meeting date + * CalendarInstance calendarInstance = this.calendarInstanceRepository.findCalendarInstaneByLoanId + * (loan.getId(), CalendarEntityType.LOANS.getValue()); this.loanEventApiJsonValidator + * .validateRepaymentDateWithMeetingDate(transactionDate, calendarInstance); } */ final List existingTransactionIds = new ArrayList<>(); @@ -195,11 +191,9 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { saveLoanTransactionWithDataIntegrityViolationChecks(newRepaymentTransaction); /*** - * TODO Vishwas Batch save is giving me a - * HibernateOptimisticLockingFailureException, looping and saving for - * the time being, not a major issue for now as this loop is entered - * only in edge cases (when a payment is made before the latest payment - * recorded against the loan) + * TODO Vishwas Batch save is giving me a HibernateOptimisticLockingFailureException, looping and saving for the + * time being, not a major issue for now as this loop is entered only in edge cases (when a payment is made + * before the latest payment recorded against the loan) ***/ saveAndFlushLoanWithDataIntegrityViolationChecks(loan); @@ -471,10 +465,8 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { /* * (non-Javadoc) * - * @see - * org.apache.fineract.portfolio.loanaccount.domain.LoanAccountDomainService - * #recalculateAccruals(org.apache.fineract.portfolio.loanaccount.domain. - * Loan) + * @see org.apache.fineract.portfolio.loanaccount.domain.LoanAccountDomainService + * #recalculateAccruals(org.apache.fineract.portfolio.loanaccount.domain. Loan) */ @Override public void recalculateAccruals(Loan loan) { @@ -696,11 +688,9 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { defaultLoanLifecycleStateMachine(), scheduleGeneratorDTO, appUser); /*** - * TODO Vishwas Batch save is giving me a - * HibernateOptimisticLockingFailureException, looping and saving for - * the time being, not a major issue for now as this loop is entered - * only in edge cases (when a payment is made before the latest payment - * recorded against the loan) + * TODO Vishwas Batch save is giving me a HibernateOptimisticLockingFailureException, looping and saving for the + * time being, not a major issue for now as this loop is entered only in edge cases (when a payment is made + * before the latest payment recorded against the loan) ***/ for (LoanTransaction newTransaction : newTransactions) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java index ac6c9d30b..b9e306558 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java @@ -636,9 +636,8 @@ public class LoanCharge extends AbstractPersistableCustom { /** * @param percentageOf - * @returns a minimum cap or maximum cap set on charges if the criteria fits - * else it returns the percentageOf if the amount is within min and - * max cap + * @returns a minimum cap or maximum cap set on charges if the criteria fits else it returns the percentageOf if the + * amount is within min and max cap */ private BigDecimal minimumAndMaximumCap(final BigDecimal percentageOf) { BigDecimal minMaxCap = BigDecimal.ZERO; @@ -808,18 +807,15 @@ public class LoanCharge extends AbstractPersistableCustom { } /* - * @Override public boolean equals(final Object obj) { if (obj == null) { - * return false; } if (obj == this) { return true; } if (obj.getClass() != - * getClass()) { return false; } final LoanCharge rhs = (LoanCharge) obj; - * return new EqualsBuilder().appendSuper(super.equals(obj)) // - * .append(getId(), rhs.getId()) // .append(this.charge.getId(), - * rhs.charge.getId()) // .append(this.amount, rhs.amount) // - * .append(getDueLocalDate(), rhs.getDueLocalDate()) // .isEquals(); } + * @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return + * true; } if (obj.getClass() != getClass()) { return false; } final LoanCharge rhs = (LoanCharge) obj; return new + * EqualsBuilder().appendSuper(super.equals(obj)) // .append(getId(), rhs.getId()) // .append(this.charge.getId(), + * rhs.charge.getId()) // .append(this.amount, rhs.amount) // .append(getDueLocalDate(), rhs.getDueLocalDate()) // + * .isEquals(); } * * @Override public int hashCode() { return 1; * - * return new HashCodeBuilder(3, 5) // .append(getId()) // - * .append(this.charge.getId()) // + * return new HashCodeBuilder(3, 5) // .append(getId()) // .append(this.charge.getId()) // * .append(this.amount).append(getDueLocalDate()) // .toHashCode(); * * } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java index a2712782f..71efa7be3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java @@ -30,8 +30,7 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanRescheduleStrategyMe import org.apache.fineract.portfolio.loanproduct.domain.RecalculationFrequencyType; /** - * Entity for holding interest recalculation setting, details will be copied - * from product directly + * Entity for holding interest recalculation setting, details will be copied from product directly * * @author conflux */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleProcessingWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleProcessingWrapper.java index 1dcca2338..39bc909d9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleProcessingWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleProcessingWrapper.java @@ -26,8 +26,7 @@ import org.apache.fineract.organisation.monetary.domain.Money; import org.joda.time.LocalDate; /** - * A wrapper around loan schedule related data exposing needed behaviour by - * loan. + * A wrapper around loan schedule related data exposing needed behaviour by loan. */ public class LoanRepaymentScheduleProcessingWrapper { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepositoryWrapper.java index 3dd04c9e9..00fab0d12 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepositoryWrapper.java @@ -31,8 +31,7 @@ import org.springframework.transaction.annotation.Transactional; /** *

      - * Wrapper for {@link LoanRepository} that adds NULL checking and Error handling - * capabilities + * Wrapper for {@link LoanRepository} that adds NULL checking and Error handling capabilities *

      */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java index 8e4b1b52b..0eb7da607 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java @@ -170,8 +170,7 @@ public final class LoanSummary { } /** - * All fields but totalFeeChargesDueAtDisbursement should be - * reset. + * All fields but totalFeeChargesDueAtDisbursement should be reset. */ public void zeroFields() { this.totalPrincipalDisbursed = BigDecimal.ZERO; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummaryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummaryWrapper.java index 1b33d1371..90ed8c82d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummaryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummaryWrapper.java @@ -26,8 +26,7 @@ import org.joda.time.LocalDate; import org.springframework.stereotype.Component; /** - * A wrapper for dealing with side-effect free functionality related to a loans - * transactions and repayment schedule. + * A wrapper for dealing with side-effect free functionality related to a loans transactions and repayment schedule. */ @Component public final class LoanSummaryWrapper { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariationsComparator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariationsComparator.java index 67ce832e2..8f7b3b5d7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariationsComparator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariationsComparator.java @@ -30,8 +30,8 @@ public class LoanTermVariationsComparator implements Comparator { @@ -31,9 +30,8 @@ public class LoanTransactionComparator implements Comparator { int compareResult = 0; final int comparsion = o1.getTransactionDate().compareTo(o2.getTransactionDate()); /** - * For transactions bearing the same transaction date, we sort - * transactions based on created date (when available) after which - * sorting for waivers takes place + * For transactions bearing the same transaction date, we sort transactions based on created date (when + * available) after which sorting for waivers takes place **/ if (comparsion == 0) { int comparisonBasedOnCreatedDate = 0; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionType.java index 2ac359037..efb777e55 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionType.java @@ -29,21 +29,19 @@ public enum LoanTransactionType { WRITEOFF(6, "loanTransactionType.writeOff"), // MARKED_FOR_RESCHEDULING(7, "loanTransactionType.marked.for.rescheduling"), // /** - * This type of transactions is allowed on written-off loans where mfi still - * attempts to recover payments from applicant after writing-off. + * This type of transactions is allowed on written-off loans where mfi still attempts to recover payments from + * applicant after writing-off. */ RECOVERY_REPAYMENT(8, "loanTransactionType.recoveryRepayment"), // WAIVE_CHARGES(9, "loanTransactionType.waiveCharges"), // /** - * Transaction represents an Accrual (For either interest, charge or a - * penalty + * Transaction represents an Accrual (For either interest, charge or a penalty **/ ACCRUAL(10, "loanTransactionType.accrual"), // /*** - * A Loan Transfer involves two steps, first a "initiate" Loan transfer - * transaction done by the Source branch followed by a "complete" loan - * transaction initiated by the destination branch + * A Loan Transfer involves two steps, first a "initiate" Loan transfer transaction done by the Source branch + * followed by a "complete" loan transaction initiated by the destination branch **/ INITIATE_TRANSFER(12, "loanTransactionType.initiateTransfer"), // APPROVE_TRANSFER(13, "loanTransactionType.approveTransfer"), // diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/AbstractLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/AbstractLoanRepaymentScheduleTransactionProcessor.java index 328da6071..4992cbe63 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/AbstractLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/AbstractLoanRepaymentScheduleTransactionProcessor.java @@ -43,8 +43,8 @@ import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.imp import org.joda.time.LocalDate; /** - * Abstract implementation of {@link LoanRepaymentScheduleTransactionProcessor} - * which is more convenient for concrete implementations to extend. + * Abstract implementation of {@link LoanRepaymentScheduleTransactionProcessor} which is more convenient for concrete + * implementations to extend. * * @see InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor * @@ -54,11 +54,10 @@ import org.joda.time.LocalDate; public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implements LoanRepaymentScheduleTransactionProcessor { /** - * Provides support for passing all {@link LoanTransaction}'s so it will - * completely re-process the entire loan schedule. This is required in cases - * where the {@link LoanTransaction} being processed is in the past and - * falls before existing transactions or and adjustment is made to an - * existing in which case the entire loan schedule needs to be re-processed. + * Provides support for passing all {@link LoanTransaction}'s so it will completely re-process the entire loan + * schedule. This is required in cases where the {@link LoanTransaction} being processed is in the past and falls + * before existing transactions or and adjustment is made to an existing in which case the entire loan schedule + * needs to be re-processed. */ @Override @@ -160,9 +159,8 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen loanTransaction.adjustInterestComponent(currency); } else { /** - * For existing transactions, check if the re-payment - * breakup (principal, interest, fees, penalties) has - * changed.
      + * For existing transactions, check if the re-payment breakup (principal, interest, fees, penalties) + * has changed.
      **/ final LoanTransaction newLoanTransaction = LoanTransaction.copyTransactionProperties(loanTransaction); @@ -171,8 +169,7 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen handleTransaction(newLoanTransaction, currency, installments, charges); newLoanTransaction.adjustInterestComponent(currency); /** - * Check if the transaction amounts have changed. If so, - * reverse the original transaction and update + * Check if the transaction amounts have changed. If so, reverse the original transaction and update * changedTransactionDetail accordingly **/ if (LoanTransaction.transactionAmountsMatch(currency, loanTransaction, newLoanTransaction)) { @@ -198,8 +195,8 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen } /** - * Provides support for processing the latest transaction (which should be - * latest transaction) against the loan schedule. + * Provides support for processing the latest transaction (which should be latest transaction) against the loan + * schedule. */ @Override public void handleTransaction(final LoanTransaction loanTransaction, final MonetaryCurrency currency, @@ -416,11 +413,11 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen // abstract interface /** - * This method is responsible for checking if the current transaction is 'an - * advance/early payment' based on the details passed through. + * This method is responsible for checking if the current transaction is 'an advance/early payment' based on the + * details passed through. * - * Default implementation simply processes transactions as 'Late' if the - * transaction date is after the installment due date. + * Default implementation simply processes transactions as 'Late' if the transaction date is after the installment + * due date. */ protected boolean isTransactionALateRepaymentOnInstallment(final int installmentIndex, final List installments, final LocalDate transactionDate) { @@ -441,11 +438,10 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen final Money transactionAmountUnprocessed, final List transactionMappings); /** - * This method is responsible for checking if the current transaction is 'an - * advance/early payment' based on the details passed through. + * This method is responsible for checking if the current transaction is 'an advance/early payment' based on the + * details passed through. * - * Default implementation is check transaction date is before installment - * due date. + * Default implementation is check transaction date is before installment due date. */ protected boolean isTransactionInAdvanceOfInstallment(final int currentInstallmentIndex, final List installments, final LocalDate transactionDate, @@ -480,8 +476,7 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen /** * Invoked when a transaction results in an over-payment of the full loan. * - * transaction amount is greater than the total expected principal and - * interest of the loan. + * transaction amount is greater than the total expected principal and interest of the loan. */ @SuppressWarnings("unused") protected void onLoanOverpayment(final LoanTransaction loanTransaction, final Money loanOverPaymentAmount) { @@ -559,11 +554,9 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen } /** - * Invoked when a there is a refund of an active loan or undo of an active - * loan + * Invoked when a there is a refund of an active loan or undo of an active loan * - * Undoes principal, interest, fees and charges of this transaction based on - * the repayment strategy + * Undoes principal, interest, fees and charges of this transaction based on the repayment strategy * * @param transactionMappings * TODO diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/LoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/LoanRepaymentScheduleTransactionProcessor.java index 015f3e7da..21df78a24 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/LoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/LoanRepaymentScheduleTransactionProcessor.java @@ -43,8 +43,7 @@ public interface LoanRepaymentScheduleTransactionProcessor { List installments); /** - * Used in interest recalculation to introduce new interest only - * installment. + * Used in interest recalculation to introduce new interest only installment. */ boolean isInterestFirstRepaymentScheduleTransactionProcessor(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/CreocoreLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/CreocoreLoanRepaymentScheduleTransactionProcessor.java index a1f36decf..11eb456e8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/CreocoreLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/CreocoreLoanRepaymentScheduleTransactionProcessor.java @@ -31,21 +31,17 @@ import org.joda.time.LocalDate; /** * Creocore style {@link LoanRepaymentScheduleTransactionProcessor}. * - * For standard transactions, pays off components in order of interest, then - * principal. + * For standard transactions, pays off components in order of interest, then principal. * - * If a transaction results in an advance payment or over-payment for a given - * installment, the over paid amount is pay off on the principal component of - * subsequent installments. + * If a transaction results in an advance payment or over-payment for a given installment, the over paid amount is pay + * off on the principal component of subsequent installments. * - * If the entire principal of an installment is paid in advance then the - * interest component is waived. + * If the entire principal of an installment is paid in advance then the interest component is waived. */ public class CreocoreLoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { /** - * For creocore, early is defined as any date before the installment due - * date + * For creocore, early is defined as any date before the installment due date */ @SuppressWarnings("unused") @Override @@ -58,8 +54,7 @@ public class CreocoreLoanRepaymentScheduleTransactionProcessor extends AbstractL } /** - * For early/'in advance' repayments, pay off in the same way as on-time - * payments, interest first then principal. + * For early/'in advance' repayments, pay off in the same way as on-time payments, interest first then principal. */ @SuppressWarnings("unused") @Override @@ -73,8 +68,7 @@ public class CreocoreLoanRepaymentScheduleTransactionProcessor extends AbstractL } /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @SuppressWarnings("unused") @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/EarlyPaymentLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/EarlyPaymentLoanRepaymentScheduleTransactionProcessor.java index d412ad441..b5f728676 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/EarlyPaymentLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/EarlyPaymentLoanRepaymentScheduleTransactionProcessor.java @@ -29,14 +29,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.Loa import org.joda.time.LocalDate; /** - * This {@link LoanRepaymentScheduleTransactionProcessor} defaults to having the - * payment order of Interest first, then principal, penalties and fees. + * This {@link LoanRepaymentScheduleTransactionProcessor} defaults to having the payment order of Interest first, then + * principal, penalties and fees. */ public class EarlyPaymentLoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { /** - * For early/'in advance' repayments, pay off in the same way as on-time - * payments, interest first, principal, penalties and charges. + * For early/'in advance' repayments, pay off in the same way as on-time payments, interest first, principal, + * penalties and charges. */ @SuppressWarnings("unused") @Override @@ -92,8 +92,7 @@ public class EarlyPaymentLoanRepaymentScheduleTransactionProcessor extends Abstr } /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @SuppressWarnings("unused") @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/FineractStyleLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/FineractStyleLoanRepaymentScheduleTransactionProcessor.java index b28621715..9ef2dac55 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/FineractStyleLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/FineractStyleLoanRepaymentScheduleTransactionProcessor.java @@ -31,13 +31,11 @@ import org.joda.time.LocalDate; /** * Old style {@link LoanRepaymentScheduleTransactionProcessor}. * - * For ALL types of transactions, pays off components in order of interest, then - * principal. + * For ALL types of transactions, pays off components in order of interest, then principal. * - * Other formulas exist on fineract where you can choose 'Declining-Balance - * Interest Recalculation' which simply means, recalculate the interest - * component based on the how much principal is outstanding at a point in time; - * but this isnt trying to model that option only the basic one for now. + * Other formulas exist on fineract where you can choose 'Declining-Balance Interest Recalculation' which simply means, + * recalculate the interest component based on the how much principal is outstanding at a point in time; but this isnt + * trying to model that option only the basic one for now. */ @SuppressWarnings("unused") public class FineractStyleLoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { @@ -52,8 +50,7 @@ public class FineractStyleLoanRepaymentScheduleTransactionProcessor extends Abst } /** - * For early/'in advance' repayments, pay off in the same way as on-time - * payments, interest first then principal. + * For early/'in advance' repayments, pay off in the same way as on-time payments, interest first then principal. */ @Override protected Money handleTransactionThatIsPaymentInAdvanceOfInstallment(final LoanRepaymentScheduleInstallment currentInstallment, @@ -66,8 +63,7 @@ public class FineractStyleLoanRepaymentScheduleTransactionProcessor extends Abst } /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @Override protected Money handleTransactionThatIsALateRepaymentOfInstallment(final LoanRepaymentScheduleInstallment currentInstallment, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java index 3750b9928..2711dbd61 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java @@ -31,22 +31,18 @@ import org.joda.time.LocalDate; /** * Heavensfamily style {@link LoanRepaymentScheduleTransactionProcessor}. * - * For standard transactions, pays off components in order of interest, then - * principal. + * For standard transactions, pays off components in order of interest, then principal. * - * If a transaction results in an advance payment or overpayment for a given - * installment, the over paid amount is pay off on the principal component of - * subsequent installments. + * If a transaction results in an advance payment or overpayment for a given installment, the over paid amount is pay + * off on the principal component of subsequent installments. * - * If the entire principal of an installment is paid in advance then the - * interest component is waived. + * If the entire principal of an installment is paid in advance then the interest component is waived. */ @SuppressWarnings("unused") public class HeavensFamilyLoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @Override protected Money handleTransactionThatIsALateRepaymentOfInstallment(final LoanRepaymentScheduleInstallment currentInstallment, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java index 6e5a8592d..87bb81f3d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java @@ -29,15 +29,15 @@ import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.Loa import org.joda.time.LocalDate; /** - * This {@link LoanRepaymentScheduleTransactionProcessor} defaults to having the - * payment order of Interest first, then principal, penalties and fees. + * This {@link LoanRepaymentScheduleTransactionProcessor} defaults to having the payment order of Interest first, then + * principal, penalties and fees. */ public class InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { /** - * For early/'in advance' repayments, pay off in the same way as on-time - * payments, interest first, principal, penalties and charges. + * For early/'in advance' repayments, pay off in the same way as on-time payments, interest first, principal, + * penalties and charges. */ @SuppressWarnings("unused") @Override @@ -51,8 +51,7 @@ public class InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionPr } /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @SuppressWarnings("unused") @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java index a86b87529..6906084ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor.java @@ -29,15 +29,15 @@ import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.Loa import org.joda.time.LocalDate; /** - * This {@link LoanRepaymentScheduleTransactionProcessor} defaults to having the - * payment order of principal first, then interest, penalties and fees. + * This {@link LoanRepaymentScheduleTransactionProcessor} defaults to having the payment order of principal first, then + * interest, penalties and fees. */ public class PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { /** - * For early/'in advance' repayments, pay off in the same way as on-time - * payments, interest first, principal, penalties and charges. + * For early/'in advance' repayments, pay off in the same way as on-time payments, interest first, principal, + * penalties and charges. */ @SuppressWarnings("unused") @Override @@ -51,8 +51,7 @@ public class PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionPr } /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @SuppressWarnings("unused") @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/RBILoanRepaymentScheduleTransactionProcessor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/RBILoanRepaymentScheduleTransactionProcessor.java index 00b153a13..0078ef71d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/RBILoanRepaymentScheduleTransactionProcessor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/RBILoanRepaymentScheduleTransactionProcessor.java @@ -33,20 +33,18 @@ import org.joda.time.LocalDate; * * From https://mifosforge.jira.com/browse/MIFOS-5636: * - * Per RBI regulations, all interest must be paid (both current and overdue) - * before principal is paid. + * Per RBI regulations, all interest must be paid (both current and overdue) before principal is paid. * - * For example on a loan with two installments due (one current and one overdue) - * of 220 each (200 principal + 20 interest): + * For example on a loan with two installments due (one current and one overdue) of 220 each (200 principal + 20 + * interest): * - * Partial Payment of 40 20 Payment to interest on Installment #1 (200 principal - * remaining) 20 Payment to interest on Installment #2 (200 principal remaining) + * Partial Payment of 40 20 Payment to interest on Installment #1 (200 principal remaining) 20 Payment to interest on + * Installment #2 (200 principal remaining) */ public class RBILoanRepaymentScheduleTransactionProcessor extends AbstractLoanRepaymentScheduleTransactionProcessor { /** - * For creocore, early is defined as any date before the installment due - * date + * For creocore, early is defined as any date before the installment due date */ @SuppressWarnings("unused") @Override @@ -73,8 +71,7 @@ public class RBILoanRepaymentScheduleTransactionProcessor extends AbstractLoanRe } /** - * For late repayments, pay off in the same way as on-time payments, - * interest first then principal. + * For late repayments, pay off in the same way as on-time payments, interest first then principal. */ @Override protected Money handleTransactionThatIsALateRepaymentOfInstallment(final LoanRepaymentScheduleInstallment currentInstallment, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/DateMismatchException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/DateMismatchException.java index 31e34b347..6c489a605 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/DateMismatchException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/DateMismatchException.java @@ -22,8 +22,8 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR import org.joda.time.LocalDate; /** - * {@link AbstractPlatformDomainRuleException} thrown when actual disbursement - * date does not match with expected disbursement date + * {@link AbstractPlatformDomainRuleException} thrown when actual disbursement date does not match with expected + * disbursement date * */ public class DateMismatchException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java index 71ab58430..ef85d50fd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class InvalidLoanStateTransitionException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java index 4f629f8a0..8b8342295 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class InvalidLoanTransactionTypeException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTypeException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTypeException.java index ba0989856..94e063a49 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTypeException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidLoanTypeException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class InvalidLoanTypeException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidPaidInAdvanceAmountException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidPaidInAdvanceAmountException.java index 090c62000..d46339e90 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidPaidInAdvanceAmountException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/InvalidPaidInAdvanceAmountException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class InvalidPaidInAdvanceAmountException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java index ed7d734e1..751d2e8e2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when trying to delete a - * loan in an invalid state. + * {@link AbstractPlatformDomainRuleException} thrown when trying to delete a loan in an invalid state. */ public class LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeDeleted extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeModified.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeModified.java index 721be7931..0f3fd367d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeModified.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeModified.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when trying to modify a - * loan in an invalid state. + * {@link AbstractPlatformDomainRuleException} thrown when trying to modify a loan in an invalid state. */ public class LoanApplicationNotInSubmittedAndPendingApprovalStateCannotBeModified extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTemplateTypeRequiredException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTemplateTypeRequiredException.java index 8819c3142..b151a8cc7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTemplateTypeRequiredException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTemplateTypeRequiredException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when not supported loan - * template type is sent. + * {@link AbstractPlatformDomainRuleException} thrown when not supported loan template type is sent. */ public class LoanTemplateTypeRequiredException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java index c33889c9d..c445d7ffa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when loan transactions processing strategy - * resources are not found. + * A {@link RuntimeException} thrown when loan transactions processing strategy resources are not found. */ public class LoanTransactionProcessingStrategyNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/MinDaysBetweenDisbursalAndFirstRepaymentViolationException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/MinDaysBetweenDisbursalAndFirstRepaymentViolationException.java index e08ac5433..b9a183e52 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/MinDaysBetweenDisbursalAndFirstRepaymentViolationException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/MinDaysBetweenDisbursalAndFirstRepaymentViolationException.java @@ -22,9 +22,8 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR import org.joda.time.LocalDate; /** - * {@link AbstractPlatformDomainRuleException} thrown when a number of days - * between disbursal date and firstRepayment is less than - * minimumDaysBetweenDisbursalAndFirstRepayment + * {@link AbstractPlatformDomainRuleException} thrown when a number of days between disbursal date and firstRepayment is + * less than minimumDaysBetweenDisbursalAndFirstRepayment * */ public class MinDaysBetweenDisbursalAndFirstRepaymentViolationException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/NotSupportedLoanTemplateTypeException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/NotSupportedLoanTemplateTypeException.java index 0248609da..7b1371eaf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/NotSupportedLoanTemplateTypeException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/NotSupportedLoanTemplateTypeException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when not supported loan - * template type is sent. + * {@link AbstractPlatformDomainRuleException} thrown when not supported loan template type is sent. */ public class NotSupportedLoanTemplateTypeException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/exception/InvalidGuarantorException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/exception/InvalidGuarantorException.java index 894784b70..7c7ec9580 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/exception/InvalidGuarantorException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/exception/InvalidGuarantorException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.guarantor.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when a Client is set as a - * guarantor for his/her own loans + * {@link AbstractPlatformDomainRuleException} thrown when a Client is set as a guarantor for his/her own loans */ public class InvalidGuarantorException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/serialization/GuarantorCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/serialization/GuarantorCommandFromApiJsonDeserializer.java index 4a1ce12f2..cd0bbff06 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/serialization/GuarantorCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/serialization/GuarantorCommandFromApiJsonDeserializer.java @@ -37,8 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link GuarantorCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s. */ @Component public final class GuarantorCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java index c7957c122..e758072e7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java @@ -164,8 +164,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method assigns a guarantor to loan and blocks the funds on guarantor's - * account + * Method assigns a guarantor to loan and blocks the funds on guarantor's account */ @Override public void assignGuarantor(final GuarantorFundingDetails guarantorFundingDetails, final LocalDate transactionDate) { @@ -190,8 +189,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method releases(withdraw) a guarantor from loan and unblocks the funds on - * guarantor's account + * Method releases(withdraw) a guarantor from loan and unblocks the funds on guarantor's account */ @Override public void releaseGuarantor(final GuarantorFundingDetails guarantorFundingDetails, final LocalDate transactionDate) { @@ -213,9 +211,8 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method is to recover funds from guarantor's in case loan is unpaid. - * (Transfers guarantee amount from guarantor's account to loan account and - * releases guarantor) + * Method is to recover funds from guarantor's in case loan is unpaid. (Transfers guarantee amount from guarantor's + * account to loan account and releases guarantor) */ @Override public void transaferFundsFromGuarantor(final Loan loan) { @@ -292,8 +289,8 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method reverses all blocked fund(both hold and release) transactions. - * example: reverses all transactions on undo approval of loan account. + * Method reverses all blocked fund(both hold and release) transactions. example: reverses all transactions on undo + * approval of loan account. * */ private void reverseAllFundTransaction(final Loan loan) { @@ -317,8 +314,8 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method holds all guarantor's guarantee amount for a loan account. - * example: hold funds on approval of loan account. + * Method holds all guarantor's guarantee amount for a loan account. example: hold funds on approval of loan + * account. * */ private void holdGuarantorFunds(final Loan loan) { @@ -377,10 +374,9 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method releases all guarantor's guarantee amount(first external guarantee - * and then self guarantee) for a loan account in the portion of guarantee - * percentage on a paid principal. example: releases funds on repayments of - * loan account. + * Method releases all guarantor's guarantee amount(first external guarantee and then self guarantee) for a loan + * account in the portion of guarantee percentage on a paid principal. example: releases funds on repayments of loan + * account. * */ private void releaseGuarantorFunds(final LoanTransaction loanTransaction) { @@ -432,8 +428,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method releases all guarantor's guarantee amount. example: releases funds - * on write-off of a loan account. + * Method releases all guarantor's guarantee amount. example: releases funds on write-off of a loan account. * */ private void releaseAllGuarantors(final LoanTransaction loanTransaction) { @@ -471,9 +466,8 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method releases guarantor's guarantee amount on transferring guarantee - * amount to loan account. example: on recovery of guarantee funds from - * guarantor's. + * Method releases guarantor's guarantee amount on transferring guarantee amount to loan account. example: on + * recovery of guarantee funds from guarantor's. */ private void completeGuarantorFund(final LoanTransaction loanTransaction) { Loan loan = loanTransaction.getLoan(); @@ -516,8 +510,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { } /** - * Method reverses the fund release transactions in case of loan transaction - * reversed + * Method reverses the fund release transactions in case of loan transaction reversed */ private void reverseTransaction(final List loanTransactionIds) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorReadPlatformService.java index 28f2f3faa..054d3bc4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorReadPlatformService.java @@ -33,8 +33,7 @@ public interface GuarantorReadPlatformService { List retrieveGuarantorsForValidLoan(Long loanId); /** - * Methods Returns all Guarantors for a Given loan Id (if the loan Id is - * valid and Exists) + * Methods Returns all Guarantors for a Given loan Id (if the loan Id is valid and Exists) * * @param loanId * @return diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanScheduleData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanScheduleData.java index 86c7b050e..da1d8907c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanScheduleData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanScheduleData.java @@ -26,10 +26,9 @@ import org.apache.fineract.organisation.monetary.data.CurrencyData; * Immutable data object to represent aspects of a loan schedule such as: * *
        - *
      • Totals information - the totals for each part of repayment schedule - * monitored.
      • - *
      • Repayment schedule - the principal due, outstanding balance and cost of - * loan items such as interest and charges (both fees and penalties)
      • + *
      • Totals information - the totals for each part of repayment schedule monitored.
      • + *
      • Repayment schedule - the principal due, outstanding balance and cost of loan items such as interest and charges + * (both fees and penalties)
      • *
      */ @SuppressWarnings("unused") @@ -55,9 +54,8 @@ public class LoanScheduleData { private final BigDecimal totalOutstanding; /** - * periods is collection of data objects containing specific - * information to each period of the loan schedule including disbursement - * and repayment information. + * periods is collection of data objects containing specific information to each period of the loan + * schedule including disbursement and repayment information. */ private final Collection periods; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanSchedulePeriodData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanSchedulePeriodData.java index 5463f8daf..a8ba9b348 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanSchedulePeriodData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanSchedulePeriodData.java @@ -134,8 +134,7 @@ public final class LoanSchedulePeriodData { } /* - * constructor used for creating period on loan schedule that is only a - * disbursement (typically first period) + * constructor used for creating period on loan schedule that is only a disbursement (typically first period) */ private LoanSchedulePeriodData(final Integer periodNumber, final LocalDate fromDate, final LocalDate dueDate, final BigDecimal principalDisbursed, final BigDecimal chargesDueAtTimeOfDisbursement, final boolean isDisbursed) { @@ -201,8 +200,7 @@ public final class LoanSchedulePeriodData { } /* - * used for repayment only period when creating an empty loan schedule for - * preview etc + * used for repayment only period when creating an empty loan schedule for preview etc */ private LoanSchedulePeriodData(final Integer periodNumber, final LocalDate fromDate, final LocalDate dueDate, final BigDecimal principalOriginalDue, final BigDecimal principalOutstanding, @@ -264,8 +262,8 @@ public final class LoanSchedulePeriodData { } /* - * Used for creating loan schedule periods with full information on expected - * principal, interest & charges along with what portion of each is paid. + * Used for creating loan schedule periods with full information on expected principal, interest & charges along + * with what portion of each is paid. */ private LoanSchedulePeriodData(final Integer periodNumber, final LocalDate fromDate, final LocalDate dueDate, final LocalDate obligationsMetOnDate, final boolean complete, final BigDecimal principalOriginalDue, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java index c2edf6ff3..5457357a2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java @@ -1248,8 +1248,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * this method calculates the principal amount for generating the repayment - * schedule. + * this method calculates the principal amount for generating the repayment schedule. */ private Money getPrincipalToBeScheduled(final LoanApplicationTerms loanApplicationTerms) { Money principalToBeScheduled; @@ -1298,9 +1297,8 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * Method calculates interest on not paid outstanding principal and interest - * (if compounding is enabled) till current date and adds new repayment - * schedule detail + * Method calculates interest on not paid outstanding principal and interest (if compounding is enabled) till + * current date and adds new repayment schedule detail * * @param compoundingMap * TODO @@ -1522,8 +1520,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * Identifies all the past date principal changes and apply them on - * outstanding balance for future calculations + * Identifies all the past date principal changes and apply them on outstanding balance for future calculations */ private Money updateBalanceForInterestCalculation(final Map principalPortionMap, final LocalDate scheduledDueDate, final Money outstandingBalanceAsPerRest, boolean addMapDetails) { @@ -1591,9 +1588,8 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * this Method updates late/ not paid installment components to Map with - * effective date as per REST(for principal portion ) and compounding - * (interest or fee or interest and fee portions) frequency + * this Method updates late/ not paid installment components to Map with effective date as per REST(for principal + * portion ) and compounding (interest or fee or interest and fee portions) frequency * */ private void updateLatePaymentsToMap(final LoanApplicationTerms loanApplicationTerms, final HolidayDetailDTO holidayDetailDTO, @@ -1802,8 +1798,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * This Method updates principal paid component to map with effective date - * as per the REST + * This Method updates principal paid component to map with effective date as per the REST * */ private void updatePrincipalPaidPortionToMap(final LoanApplicationTerms loanApplicationTerms, final HolidayDetailDTO holidayDetailDTO, @@ -1819,9 +1814,8 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * merges all the applicable amounts(compounding dates, disbursements, late - * payment compounding and principal change as per rest) changes to single - * map for interest calculation + * merges all the applicable amounts(compounding dates, disbursements, late payment compounding and principal change + * as per rest) changes to single map for interest calculation * */ private TreeMap mergeVariationsToMap(final LoanScheduleParams params) { @@ -2049,8 +2043,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * Method preprocess the installments and transactions and sets the required - * fields to generate the schedule + * Method preprocess the installments and transactions and sets the required fields to generate the schedule */ @Override public LoanScheduleDTO rescheduleNextInstallments(final MathContext mc, final LoanApplicationTerms loanApplicationTerms, Loan loan, @@ -2395,8 +2388,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * Method identifies the early paid amounts for a installment and update the - * principal map for further calculations + * Method identifies the early paid amounts for a installment and update the principal map for further calculations */ private Money updateEarlyPaidAmountsToMap(final LoanApplicationTerms loanApplicationTerms, final HolidayDetailDTO holidayDetailDTO, final LoanRepaymentScheduleTransactionProcessor loanRepaymentScheduleTransactionProcessor, @@ -2493,8 +2485,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener } /** - * Method identifies early paid amount and applies the early payment - * strategy + * Method identifies early paid amount and applies the early payment strategy */ private Money fetchEarlyPaidAmount(final Money principalPortion, final Money principalPortionCalculated, final Money reducePrincipal, final LoanApplicationTerms applicationTerms, final Money totalCumulativePrincipal, int periodNumber, final MathContext mc) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DecliningBalanceInterestLoanScheduleGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DecliningBalanceInterestLoanScheduleGenerator.java index 740517079..2af9487a3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DecliningBalanceInterestLoanScheduleGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DecliningBalanceInterestLoanScheduleGenerator.java @@ -32,8 +32,7 @@ import org.joda.time.LocalDate; /** *

      - * Declining balance can be amortized (see {@link AmortizationMethod}) in two - * ways at present: + * Declining balance can be amortized (see {@link AmortizationMethod}) in two ways at present: *

        *
      1. Equal principal payments
      2. *
      3. Equal installment payments
      4. @@ -42,18 +41,16 @@ import org.joda.time.LocalDate; *

        * *

        - * When amortized using equal principal payments, the principal - * component of each installment is fixed and interest due is - * calculated from the outstanding principal balance resulting in a - * different total payment due for each installment. + * When amortized using equal principal payments, the principal component of each installment is fixed and + * interest due is calculated from the outstanding principal balance resulting in a different total + * payment due for each installment. *

        * *

        - * When amortized using equal installments, the total payment due - * for each installment is fixed and is calculated using the excel like - * pmt function. The interest due is calculated from the - * outstanding principal balance which results in a principal - * component that is total payment due minus interest due. + * When amortized using equal installments, the total payment due for each installment is fixed and is + * calculated using the excel like pmt function. The interest due is calculated from the + * outstanding principal balance which results in a principal component that is total payment due + * minus interest due. *

        */ public class DecliningBalanceInterestLoanScheduleGenerator extends AbstractLoanScheduleGenerator { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java index 01a70da38..1440ba0af 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java @@ -115,9 +115,8 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { } /** - * Recursively checking non working days and holidays and working days - * exemption to generate next repayment period date Base on the - * configuration + * Recursively checking non working days and holidays and working days exemption to generate next repayment period + * date Base on the configuration * * @param adjustedDateDetailsDTO * @param loanApplicationTerms @@ -138,8 +137,8 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { isFirstRepayment); /** - * Check Changed Schedule Date is holiday or is not a working day Then - * re-call this method to get the non holiday and working day + * Check Changed Schedule Date is holiday or is not a working day Then re-call this method to get the non + * holiday and working day */ if ((holidayDetailDTO.isHolidayEnabled() && HolidayUtil.getApplicableHoliday(adjustedDateDetailsDTO.getChangedScheduleDate(), holidayDetailDTO.getHolidays()) != null) @@ -151,8 +150,7 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { } /** - * This method to check and update the working day if repayment date is - * holiday + * This method to check and update the working day if repayment date is holiday * * @param adjustedDateDetailsDTO * @param holidayDetailDTO @@ -183,8 +181,7 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { } /** - * This method to check and update the working day if repayment date is non - * working day + * This method to check and update the working day if repayment date is non working day * * @param adjustedDateDetailsDTO * @param holidayDetailDTO diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FinanicalFunctions.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FinanicalFunctions.java index 9666ff639..54c2cd2cd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FinanicalFunctions.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FinanicalFunctions.java @@ -21,15 +21,13 @@ package org.apache.fineract.portfolio.loanaccount.loanschedule.domain; public class FinanicalFunctions { /** - * PMT calculates a fixed monthly payment to be paid by borrower every - * 'period' to ensure loan is paid off in full (with interest). + * PMT calculates a fixed monthly payment to be paid by borrower every 'period' to ensure loan is paid off in full + * (with interest). * - * This monthly payment c depends upon the monthly interest rate r - * (expressed as a fraction, not a percentage, i.e., divide the quoted - * yearly percentage rate by 100 and by 12 to obtain the monthly interest - * rate), the number of monthly payments N called the loan's term, and the - * amount borrowed P known as the loan's principal; c is given by the - * formula: + * This monthly payment c depends upon the monthly interest rate r (expressed as a fraction, not a percentage, i.e., + * divide the quoted yearly percentage rate by 100 and by 12 to obtain the monthly interest rate), the number of + * monthly payments N called the loan's term, and the amount borrowed P known as the loan's principal; c is given by + * the formula: * * c = (r / (1 - (1 + r)^-N))P * diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FlatInterestLoanScheduleGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FlatInterestLoanScheduleGenerator.java index f71fe8922..98b8c7e5b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FlatInterestLoanScheduleGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/FlatInterestLoanScheduleGenerator.java @@ -57,12 +57,10 @@ public class FlatInterestLoanScheduleGenerator extends AbstractLoanScheduleGener // totalCumulativeInterest from partial schedule generation for multi // rescheduling /* - * if (loanApplicationTerms.getPartialTotalCumulativeInterest() != null - * && loanApplicationTerms.getTotalInterestDue() != null) { - * totalInterestDueForLoan = loanApplicationTerms.getTotalInterestDue(); - * totalInterestDueForLoan = - * totalInterestDueForLoan.plus(loanApplicationTerms. - * getPartialTotalCumulativeInterest()); } + * if (loanApplicationTerms.getPartialTotalCumulativeInterest() != null && + * loanApplicationTerms.getTotalInterestDue() != null) { totalInterestDueForLoan = + * loanApplicationTerms.getTotalInterestDue(); totalInterestDueForLoan = + * totalInterestDueForLoan.plus(loanApplicationTerms. getPartialTotalCumulativeInterest()); } */ interestForThisInstallment = loanApplicationTerms.adjustInterestIfLastRepaymentPeriod(interestForThisInstallment, totalCumulativeInterestToDate, totalInterestDueForLoan, periodNumber); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java index 3c7663ffa..7bf3d1dad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java @@ -86,30 +86,26 @@ public final class LoanApplicationTerms { private final LocalDate repaymentsStartingFromDate; private final LocalDate calculatedRepaymentsStartingFromDate; /** - * Integer representing the number of 'repayment frequencies' or - * installments where 'grace' should apply to the principal component of a - * loans repayment period (installment). + * Integer representing the number of 'repayment frequencies' or installments where 'grace' should apply to the + * principal component of a loans repayment period (installment). */ private Integer principalGrace; private Integer recurringMoratoriumOnPrincipalPeriods; /** - * Integer representing the number of 'repayment frequencies' or - * installments where 'grace' should apply to the payment of interest in a - * loans repayment period (installment). + * Integer representing the number of 'repayment frequencies' or installments where 'grace' should apply to the + * payment of interest in a loans repayment period (installment). * - * Note: Interest is still calculated taking into account the full - * loan term, the interest is simply offset to a later period. + * Note: Interest is still calculated taking into account the full loan term, the interest is simply offset + * to a later period. */ private Integer interestPaymentGrace; /** - * Integer representing the number of 'repayment frequencies' or - * installments where 'grace' should apply to the charging of interest in a - * loans repayment period (installment). + * Integer representing the number of 'repayment frequencies' or installments where 'grace' should apply to the + * charging of interest in a loans repayment period (installment). * - * Note: The loan is interest-free for the period of time - * indicated. + * Note: The loan is interest-free for the period of time indicated. */ private final Integer interestChargingGrace; @@ -117,13 +113,11 @@ public final class LoanApplicationTerms { * Legacy method of support 'grace' on the charging of interest on a loan. * *

        - * For the typical structured loan, its reasonable to use an integer to - * indicate the number of 'repayment frequency' periods the 'grace' should - * apply to but for slightly irregular loans where the period between - * disbursement and the date of the 'first repayment period' isnt doest - * match the 'repayment frequency' but can be less (15days instead of 1 - * month) or more (6 weeks instead of 1 month) - The idea was to use a date - * to indicate from whence interest should be charged. + * For the typical structured loan, its reasonable to use an integer to indicate the number of 'repayment frequency' + * periods the 'grace' should apply to but for slightly irregular loans where the period between disbursement + * and the date of the 'first repayment period' isnt doest match the 'repayment frequency' but can be less (15days + * instead of 1 month) or more (6 weeks instead of 1 month) - The idea was to use a date to indicate from whence + * interest should be charged. *

        */ private LocalDate interestChargedFromDate; @@ -565,8 +559,7 @@ public final class LoanApplicationTerms { } /** - * Calculates the total interest to be charged on loan taking into account - * grace settings. + * Calculates the total interest to be charged on loan taking into account grace settings. * */ public Money calculateTotalInterestCharged(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc) { @@ -732,8 +725,7 @@ public final class LoanApplicationTerms { } /** - * general method to calculate totalInterestDue discounting any grace - * settings + * general method to calculate totalInterestDue discounting any grace settings */ private Money calculateTotalFlatInterestDueWithoutGrace(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc) { @@ -937,11 +929,9 @@ public final class LoanApplicationTerms { } /* - * calculates the interest that should be due for a given scheduled loan - * repayment period. It takes into account GRACE periods and calculates how - * much interest is due per period by averaging the number of periods where - * interest is due and should be paid against the total known interest that - * is due without grace. + * calculates the interest that should be due for a given scheduled loan repayment period. It takes into account + * GRACE periods and calculates how much interest is due per period by averaging the number of periods where + * interest is due and should be paid against the total known interest that is due without grace. */ private Money calculateTotalFlatInterestForInstallmentAveragingOutGracePeriods(final PaymentPeriodsInOneYearCalculator calculator, final int periodNumber, final MathContext mc) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelDisbursementPeriod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelDisbursementPeriod.java index c1eb9fa90..68731b429 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelDisbursementPeriod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelDisbursementPeriod.java @@ -26,8 +26,7 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanScheduleP import org.joda.time.LocalDate; /** - * Domain representation of a Loan Schedule Disbursement Period (not used for - * persistence) + * Domain representation of a Loan Schedule Disbursement Period (not used for persistence) */ public final class LoanScheduleModelDisbursementPeriod implements LoanScheduleModelPeriod { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelRepaymentPeriod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelRepaymentPeriod.java index 138a41f9e..3cb035f6c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelRepaymentPeriod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanScheduleModelRepaymentPeriod.java @@ -27,8 +27,7 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanScheduleP import org.joda.time.LocalDate; /** - * Domain representation of a Loan Schedule Repayment Period (not used for - * persistence) + * Domain representation of a Loan Schedule Repayment Period (not used for persistence) */ public final class LoanScheduleModelRepaymentPeriod implements LoanScheduleModelPeriod { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java index 5a80d925c..ebfd5048a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java @@ -245,10 +245,9 @@ public class LoanScheduleAssembler { final AccountType loanType = AccountType.fromName(loanTypeStr); /* - * If it is JLG loan/Group Loan then make sure loan frequency is same as - * Group/Center meeting frequency or multiple of it. TODO: Check should - * be either same frequency or loan freq is multiple of center/group - * meeting freq multiples + * If it is JLG loan/Group Loan then make sure loan frequency is same as Group/Center meeting frequency or + * multiple of it. TODO: Check should be either same frequency or loan freq is multiple of center/group meeting + * freq multiples */ if ((loanType.isJLGAccount() || loanType.isGroupAccount()) && calendarId != null) { calendar = this.calendarRepository.findById(calendarId).orElseThrow(() -> new CalendarNotFoundException(calendarId)); @@ -267,8 +266,7 @@ public class LoanScheduleAssembler { } /* - * If user has not passed the first repayments date then then derive the - * same based on loan type. + * If user has not passed the first repayments date then then derive the same based on loan type. */ if (calculatedRepaymentsStartingFromDate == null) { calculatedRepaymentsStartingFromDate = deriveFirstRepaymentDate(loanType, repaymentEvery, expectedDisbursementDate, @@ -276,8 +274,7 @@ public class LoanScheduleAssembler { } /* - * If it is JLG loan/Group Loan synched with a meeting, then make sure - * first repayment falls on meeting date + * If it is JLG loan/Group Loan synched with a meeting, then make sure first repayment falls on meeting date */ final Long groupId = this.fromApiJsonHelper.extractLongNamed("groupId", element); Group group = null; @@ -299,8 +296,7 @@ public class LoanScheduleAssembler { numberOfDays); /* - * If disbursement is synced on meeting, make sure disbursement date - * is on a meeting date + * If disbursement is synced on meeting, make sure disbursement date is on a meeting date */ if (synchDisbursement != null && synchDisbursement.booleanValue()) { validateDisbursementDateWithMeetingDates(expectedDisbursementDate, calendar, isSkipMeetingOnFirstDay, numberOfDays); @@ -696,11 +692,9 @@ public class LoanScheduleAssembler { // Collections.sort(variations, new LoanTermVariationsComparator()); /* - * List loanTermVariationsDatas = new - * ArrayList<>(); loanTermVariationsDatas.addAll(loanApplicationTerms. - * getLoanTermVariations ().getExceptionData()); loanApplicationTerms = - * LoanApplicationTerms.assembleFrom(loanApplicationTerms, - * loanTermVariationsDatas); + * List loanTermVariationsDatas = new ArrayList<>(); + * loanTermVariationsDatas.addAll(loanApplicationTerms. getLoanTermVariations ().getExceptionData()); + * loanApplicationTerms = LoanApplicationTerms.assembleFrom(loanApplicationTerms, loanTermVariationsDatas); */ // date validations diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java index ffdc200d6..bf2d04fda 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleCalculationPlatformServiceImpl.java @@ -101,8 +101,7 @@ public class LoanScheduleCalculationPlatformServiceImpl implements LoanScheduleC public LoanScheduleModel calculateLoanSchedule(final JsonQuery query, Boolean validateParams) { /*** - * TODO: Vishwas, this is probably not required, test and remove the - * same + * TODO: Vishwas, this is probably not required, test and remove the same **/ final Long productId = this.fromJsonHelper.extractLongNamed("productId", query.parsedJson()); final LoanProduct loanProduct = this.loanProductRepository.findById(productId) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java index a17e4cba7..62bad9a5d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java @@ -196,20 +196,16 @@ public class RescheduleLoansApiResource { * * @Consumes({ MediaType.APPLICATION_JSON }) * - * @Produces({ MediaType.APPLICATION_JSON }) public String - * retrieveTemplate(@Context final UriInfo uriInfo) { + * @Produces({ MediaType.APPLICATION_JSON }) public String retrieveTemplate(@Context final UriInfo uriInfo) { * * this.platformSecurityContext.authenticatedUser(). - * validateHasReadPermission(RescheduleLoansApiConstants.ENTITY_NAME); final - * ApiRequestJsonSerializationSettings settings = - * this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); + * validateHasReadPermission(RescheduleLoansApiConstants.ENTITY_NAME); final ApiRequestJsonSerializationSettings + * settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); * - * LoanRescheduleRequestData loanRescheduleReasons = null; - * loanRescheduleReasons = this.loanRescheduleRequestReadPlatformService - * .retrieveAllRescheduleReasons(RescheduleLoansApiConstants. + * LoanRescheduleRequestData loanRescheduleReasons = null; loanRescheduleReasons = + * this.loanRescheduleRequestReadPlatformService .retrieveAllRescheduleReasons(RescheduleLoansApiConstants. * LOAN_RESCHEDULE_REASON); * - * return this.loanRescheduleRequestToApiJsonSerializer.serialize(settings, - * loanRescheduleReasons); } + * return this.loanRescheduleRequestToApiJsonSerializer.serialize(settings, loanRescheduleReasons); } */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java index 5f9318c7b..7f392a8c2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.rescheduleloan.data; import org.joda.time.LocalDate; /** - * Immutable data object represent the timeline events of a loan reschedule - * request + * Immutable data object represent the timeline events of a loan reschedule request **/ @SuppressWarnings("unused") public class LoanRescheduleRequestTimelineData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java index ffc016ee3..7f91e7a89 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java @@ -260,8 +260,8 @@ public class LoanRescheduleRequest extends AbstractPersistableCustom { } /** - * change the status of the loan reschedule request to approved, also - * updating the approvedByUser and approvedOnDate properties + * change the status of the loan reschedule request to approved, also updating the approvedByUser and approvedOnDate + * properties * * @param approvedByUser * the user who approved the request @@ -279,8 +279,8 @@ public class LoanRescheduleRequest extends AbstractPersistableCustom { } /** - * change the status of the loan reschedule request to rejected, also - * updating the approvedByUser and approvedOnDate properties + * change the status of the loan reschedule request to rejected, also updating the approvedByUser and approvedOnDate + * properties * * @param approvedByUser * the user who approved the request diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/exception/LoanRescheduleRequestNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/exception/LoanRescheduleRequestNotFoundException.java index 1aa61e50f..787306e79 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/exception/LoanRescheduleRequestNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/exception/LoanRescheduleRequestNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.rescheduleloan.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when loan reschedule request resources are - * not found. + * A {@link RuntimeException} thrown when loan reschedule request resources are not found. **/ public class LoanRescheduleRequestNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestReadPlatformService.java index f121607e8..8d390c056 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestReadPlatformService.java @@ -63,9 +63,8 @@ public interface LoanRescheduleRequestReadPlatformService { * get all loan reschedule request * * @param command - * all/null - give all request approved - give all approved - * request pending - give all request which is pending for - * approval reject - give all rejected requests + * all/null - give all request approved - give all approved request pending - give all request which is + * pending for approval reject - give all rejected requests * @return list of LoanRescheduleRequestData objects **/ public List retrieveAllRescheduleRequests(String command); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java index 1b85773d6..a9c0e4dba 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java @@ -156,8 +156,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche } /** - * create a new instance of the LoanRescheduleRequest object from the - * JsonCommand object and persist + * create a new instance of the LoanRescheduleRequest object from the JsonCommand object and persist * * @return CommandProcessingResult object **/ @@ -435,17 +434,13 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche /* * for (LoanTermVariationsData loanTermVariation : - * loanApplicationTerms.getLoanTermVariations().getDueDateVariation( - * )) { if (rescheduleFromDate.isBefore(loanTermVariation. - * getTermApplicableFrom())) { LocalDate applicableDate = - * this.scheduledDateGenerator.generateNextRepaymentDate( - * rescheduleFromDate, loanApplicationTerms, false, + * loanApplicationTerms.getLoanTermVariations().getDueDateVariation( )) { if + * (rescheduleFromDate.isBefore(loanTermVariation. getTermApplicableFrom())) { LocalDate applicableDate = + * this.scheduledDateGenerator.generateNextRepaymentDate( rescheduleFromDate, loanApplicationTerms, false, * loanApplicationTerms.getHolidayDetailDTO()); if - * (loanTermVariation.getTermApplicableFrom().equals(applicableDate) - * ) { LocalDate adjustedDate = - * this.scheduledDateGenerator.generateNextRepaymentDate( - * adjustedApplicableDate, loanApplicationTerms, false, - * loanApplicationTerms.getHolidayDetailDTO()); + * (loanTermVariation.getTermApplicableFrom().equals(applicableDate) ) { LocalDate adjustedDate = + * this.scheduledDateGenerator.generateNextRepaymentDate( adjustedApplicableDate, loanApplicationTerms, + * false, loanApplicationTerms.getHolidayDetailDTO()); * loanTermVariation.setApplicableFromDate(adjustedDate); } } } */ @@ -586,8 +581,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche } /** - * handles the data integrity violation exception for loan reschedule write - * services + * handles the data integrity violation exception for loan reschedule write services * * @param dve * data integrity violation exception diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java index 650600830..e30df95b4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java @@ -993,9 +993,8 @@ public final class LoanApplicationCommandFromApiJsonHelper { numberOfRepayments, repaymentEvery, repaymentEveryType); /** - * For multi-disbursal loans where schedules are auto-generated based on - * a fixed EMI, ensure the number of repayments is within the - * permissible range defined by the loan product + * For multi-disbursal loans where schedules are auto-generated based on a fixed EMI, ensure the number of + * repayments is within the permissible range defined by the loan product **/ if (loan.getFixedEmiAmount() != null) { Integer minimumNoOfRepayments = loan.loanProduct().getMinNumberOfRepayments(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java index b62b7bd13..962e16b36 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -774,8 +774,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa .fetchDisbursementData(command.parsedJson().getAsJsonObject()); /** - * Stores all charges which are passed in during modify loan - * application + * Stores all charges which are passed in during modify loan application **/ final Set possiblyModifedLoanCharges = this.loanChargeAssembler.fromParsedJson(command.parsedJson(), disbursementDetails); @@ -788,8 +787,8 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa } /** - * If there are any charges already present, which are now not - * passed in as a part of the request, deem the charges as modified + * If there are any charges already present, which are now not passed in as a part of the request, deem the + * charges as modified **/ if (!possiblyModifedLoanCharges.isEmpty()) { if (!possiblyModifedLoanCharges.containsAll(existingCharges)) { @@ -798,8 +797,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa } /** - * If any new charges are added or values of existing charges are - * modified + * If any new charges are added or values of existing charges are modified **/ for (LoanCharge loanCharge : possiblyModifedLoanCharges) { if (loanCharge.getId() == null) { @@ -1223,8 +1221,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformService.java index 731c3a405..eeb14d45f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformService.java @@ -82,12 +82,11 @@ public interface LoanReadPlatformService { Collection retrieveAllowedLoanOfficers(Long selectedOfficeId, boolean staffInSelectedOfficeOnly); /* - * musoni-specific at present - will find overdue scheduled installments - * that have a special 'overdue charge' associated with the loan product. + * musoni-specific at present - will find overdue scheduled installments that have a special 'overdue charge' + * associated with the loan product. * - * The 'overdue-charge' is only ever applied once to an installment and as a - * result overdue installments with this charge already applied are not - * returned. + * The 'overdue-charge' is only ever applied once to an installment and as a result overdue installments with this + * charge already applied are not returned. */ Collection retrieveAllLoansWithOverdueInstallments(final Long penaltyWaitPeriod, final Boolean backdatePenalties); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index b5c98d423..ee937c4d2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -472,16 +472,12 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { private BigDecimal adjustPrepayInstallmentCharge(Loan loan, final LocalDate onDate) { BigDecimal chargeAmount = BigDecimal.ZERO; /* - * for(LoanCharge loanCharge: loan.charges()){ - * if(loanCharge.isInstalmentFee() && - * loanCharge.getCharge().getChargeCalculation()==ChargeCalculationType. - * FLAT.getValue()){ for (LoanRepaymentScheduleInstallment installment : - * loan.getRepaymentScheduleInstallments()) { - * if(onDate.isBefore(installment.getDueDate())){ LoanInstallmentCharge - * loanInstallmentCharge = - * loanCharge.getInstallmentLoanCharge(installment.getInstallmentNumber( - * )); if(loanInstallmentCharge != null){ chargeAmount = - * chargeAmount.add(loanInstallmentCharge.getAmountOutstanding()); } + * for(LoanCharge loanCharge: loan.charges()){ if(loanCharge.isInstalmentFee() && + * loanCharge.getCharge().getChargeCalculation()==ChargeCalculationType. FLAT.getValue()){ for + * (LoanRepaymentScheduleInstallment installment : loan.getRepaymentScheduleInstallments()) { + * if(onDate.isBefore(installment.getDueDate())){ LoanInstallmentCharge loanInstallmentCharge = + * loanCharge.getInstallmentLoanCharge(installment.getInstallmentNumber( )); if(loanInstallmentCharge != null){ + * chargeAmount = chargeAmount.add(loanInstallmentCharge.getAmountOutstanding()); } * * break; } } } } */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index ef31aee14..b856926a5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -633,8 +633,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf /**** * TODO Vishwas: Pair with Ashok and re-factor collection sheet code-base * - * May of the changes made to disburseLoan aren't being made here, should - * refactor to reuse disburseLoan ASAP + * May of the changes made to disburseLoan aren't being made here, should refactor to reuse disburseLoan ASAP *****/ @Transactional @Override @@ -1038,11 +1037,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf } /*** - * TODO Vishwas Batch save is giving me a - * HibernateOptimisticLockingFailureException, looping and saving for - * the time being, not a major issue for now as this loop is entered - * only in edge cases (when a adjustment is made before the latest - * payment recorded against the loan) + * TODO Vishwas Batch save is giving me a HibernateOptimisticLockingFailureException, looping and saving for the + * time being, not a major issue for now as this loop is entered only in edge cases (when a adjustment is made + * before the latest payment recorded against the loan) ***/ saveAndFlushLoanWithDataIntegrityViolationChecks(loan); if (changedTransactionDetail != null) { @@ -1059,8 +1056,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf changes.put("note", noteText); Note note = null; /** - * If a new transaction is not created, associate note with the - * transaction to be adjusted + * If a new transaction is not created, associate note with the transaction to be adjusted **/ if (newTransactionDetail.isGreaterThanZero(loan.getPrincpal().getCurrency())) { note = Note.loanTransactionNote(loan, newTransactionDetail, noteText); @@ -1147,11 +1143,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf this.loanTransactionRepository.save(waiveInterestTransaction); /*** - * TODO Vishwas Batch save is giving me a - * HibernateOptimisticLockingFailureException, looping and saving for - * the time being, not a major issue for now as this loop is entered - * only in edge cases (when a waiver is made before the latest payment - * recorded against the loan) + * TODO Vishwas Batch save is giving me a HibernateOptimisticLockingFailureException, looping and saving for the + * time being, not a major issue for now as this loop is entered only in edge cases (when a waiver is made + * before the latest payment recorded against the loan) ***/ saveAndFlushLoanWithDataIntegrityViolationChecks(loan); if (changedTransactionDetail != null) { @@ -1546,9 +1540,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf this.loanChargeRepository.save(loanCharge); /** - * we want to apply charge transactions only for those loans charges - * that are applied when a loan is active and the loan product uses - * Upfront Accruals + * we want to apply charge transactions only for those loans charges that are applied when a loan is active and + * the loan product uses Upfront Accruals **/ if (loan.status().isActive() && loan.isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()) { final LoanTransaction applyLoanChargeTransaction = loan.handleChargeAppliedTransaction(loanCharge, null, currentUser); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationCompoundingMethod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationCompoundingMethod.java index 37ec24b05..88c90a330 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationCompoundingMethod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationCompoundingMethod.java @@ -23,8 +23,7 @@ import java.util.Map; /*** * - * People typically use either of the following settings when defining interest - * recalculation method: + * People typically use either of the following settings when defining interest recalculation method: *
          *
        • NONE
        • *
        • INTEREST
        • diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationPeriodMethod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationPeriodMethod.java index 5e522789b..5d8f85367 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationPeriodMethod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/InterestRecalculationPeriodMethod.java @@ -23,8 +23,7 @@ import java.util.Map; /*** * - * People typically use either of the following settings when defining interest - * recalculation method: + * People typically use either of the following settings when defining interest recalculation method: *
            *
          • SAME_AS_REPAYMENT_PERIOD
          • *
          • DAILY
          • diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LendingStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LendingStrategy.java index 25403336e..3f01da31c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LendingStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LendingStrategy.java @@ -22,12 +22,10 @@ import java.util.HashMap; import java.util.Map; /** - * INDIVIDUAL_LOAN: Individual loans are applicable only to clients. GROUP_LOAN: - * * Group loans are applicable only to groups. And tracked only at group level. - * JOINT_LIABILITY_LOAN: Joint liability loans are applicable only to clients - * within a group. LINKED_LOAN: Loan is given to group, then later loan amount - * is split into individual loans. Loan is tracked at both individual and group - * level + * INDIVIDUAL_LOAN: Individual loans are applicable only to clients. GROUP_LOAN: * Group loans are applicable only to + * groups. And tracked only at group level. JOINT_LIABILITY_LOAN: Joint liability loans are applicable only to clients + * within a group. LINKED_LOAN: Loan is given to group, then later loan amount is split into individual loans. Loan is + * tracked at both individual and group level * */ public enum LendingStrategy { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java index 758eb606f..3fb922359 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java @@ -65,11 +65,10 @@ import org.apache.fineract.portfolio.rate.domain.Rate; import org.joda.time.LocalDate; /** - * Loan products allow for categorisation of an organisations loans into - * something meaningful to them. + * Loan products allow for categorisation of an organisations loans into something meaningful to them. * - * They provide a means of simplifying creation/maintenance of loans. They can - * also allow for product comparison to take place when reporting. + * They provide a means of simplifying creation/maintenance of loans. They can also allow for product comparison to take + * place when reporting. * * They allow for constraints to be added at product level. */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java index fa8d6deec..de4c3567c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java @@ -26,8 +26,7 @@ import javax.persistence.Embeddable; import org.apache.fineract.infrastructure.core.api.JsonCommand; /** - * LoanProductMinMaxConstraints encapsulates all the Min and Max details of a - * {@link LoanProduct}. + * LoanProductMinMaxConstraints encapsulates all the Min and Max details of a {@link LoanProduct}. */ @Embeddable public class LoanProductMinMaxConstraints { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinimumRepaymentScheduleRelatedDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinimumRepaymentScheduleRelatedDetail.java index fb1d55733..81c7dfd93 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinimumRepaymentScheduleRelatedDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinimumRepaymentScheduleRelatedDetail.java @@ -24,8 +24,7 @@ import org.apache.fineract.organisation.monetary.domain.Money; import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType; /** - * Represents the bare minimum repayment details needed for activities related - * to generating repayment schedules. + * Represents the bare minimum repayment details needed for activities related to generating repayment schedules. */ public interface LoanProductMinimumRepaymentScheduleRelatedDetail { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java index 375e6e297..28146174f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java @@ -42,8 +42,8 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.AprCalculat import org.apache.fineract.portfolio.loanproduct.LoanProductConstants; /** - * LoanRepaymentScheduleDetail encapsulates all the details of a - * {@link LoanProduct} that are also used and persisted by a {@link Loan}. + * LoanRepaymentScheduleDetail encapsulates all the details of a {@link LoanProduct} that are also used and persisted by + * a {@link Loan}. */ @Embeddable public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentScheduleRelatedDetail { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanRescheduleStrategyMethod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanRescheduleStrategyMethod.java index 1ac347758..253ccd231 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanRescheduleStrategyMethod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanRescheduleStrategyMethod.java @@ -22,8 +22,7 @@ import java.util.HashMap; import java.util.Map; /*** - * * People typically use either of the following settings when defining - * interest recalculation method: + * * People typically use either of the following settings when defining interest recalculation method: *
              *
            • RESCHEDULE_NEXT_REPAYMENTS
            • *
            • REDUCE_NUMBER_OF_INSTALLMENTS
            • diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidCurrencyException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidCurrencyException.java index b81b6cb16..3a965bb2f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidCurrencyException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidCurrencyException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanproduct.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch - * occurs + * {@link AbstractPlatformDomainRuleException} thrown when currency mismatch occurs */ public class InvalidCurrencyException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidLendingStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidLendingStrategy.java index 38fae3f6b..285e63a39 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidLendingStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/InvalidLendingStrategy.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanproduct.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when lending strategy - * mismatch occurs + * {@link AbstractPlatformDomainRuleException} thrown when lending strategy mismatch occurs */ public class InvalidLendingStrategy extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/NotInMinMaxRangeException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/NotInMinMaxRangeException.java index 5569d705c..ae6a1539a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/NotInMinMaxRangeException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/NotInMinMaxRangeException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanproduct.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when a value is not within - * minimum and maximum values. + * {@link AbstractPlatformDomainRuleException} thrown when a value is not within minimum and maximum values. * */ public class NotInMinMaxRangeException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java index 6606d636e..26610606f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.loanproduct.productmix.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when no product mixes found with the - * productId. + * A {@link RuntimeException} thrown when no product mixes found with the productId. */ public class ProductMixNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java index ba95ee9d6..718762c53 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java @@ -150,8 +150,8 @@ public class ProductMixWritePlatformServiceJpaRepositoryImpl implements ProductM } /* - * if restrictedProducts array is not empty delete the duplicate ids - * which are already exists and update existedProductMixes + * if restrictedProducts array is not empty delete the duplicate ids which are already exists and update + * existedProductMixes */ final List productMixesToRemove = updateRestrictedIds(restrictedIds, existedProductMixes); final Map restrictedProductsAsMap = getRestrictedProducts(restrictedIds); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index a76dcaed5..a4c1a5e87 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -337,8 +337,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/MeetingRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/MeetingRepositoryWrapper.java index e9b50f060..f125037b5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/MeetingRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/MeetingRepositoryWrapper.java @@ -24,14 +24,13 @@ import org.springframework.stereotype.Service; /** *

              - * Wrapper for {@link MeetingRepository} that is responsible for checking if - * {@link Meeting} is returned when using findOne repository method - * and throwing an appropriate not found exception. + * Wrapper for {@link MeetingRepository} that is responsible for checking if {@link Meeting} is returned when using + * findOne repository method and throwing an appropriate not found exception. *

              * *

              - * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link MeetingRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where {@link MeetingRepository} is + * required. *

              */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotSupportedResourceException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotSupportedResourceException.java index be3712c9f..933aec1c6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotSupportedResourceException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotSupportedResourceException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.meeting.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when meeting is captured - * against not supported resource. + * {@link AbstractPlatformDomainRuleException} thrown when meeting is captured against not supported resource. */ public class MeetingNotSupportedResourceException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingWritePlatformServiceJpaRepositoryImpl.java index 1c1af3263..441bc5767 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingWritePlatformServiceJpaRepositoryImpl.java @@ -99,15 +99,11 @@ public class MeetingWritePlatformServiceJpaRepositoryImpl implements MeetingWrit final Date meetingDate = command.dateValueOfParameterNamed(meetingDateParamName); final Boolean isTransactionDateOnNonMeetingDate = false; /* - * Boolean isSkipRepaymentOnFirstMonth = false; Integer numberOfDays = - * 0; boolean isSkipRepaymentOnFirstMonthEnabled = - * configurationDomainService.isSkippingMeetingOnFirstDayOfMonthEnabled( - * ); if(isSkipRepaymentOnFirstMonthEnabled){ - * isSkipRepaymentOnFirstMonth = - * isLoanRepaymentsSyncWithMeeting(loan.group(), calendar); - * if(isSkipRepaymentOnFirstMonth) { numberOfDays = - * configurationDomainService. - * retreivePeroidInNumberOfDaysForSkipMeetingDate().intValue(); } } + * Boolean isSkipRepaymentOnFirstMonth = false; Integer numberOfDays = 0; boolean + * isSkipRepaymentOnFirstMonthEnabled = configurationDomainService.isSkippingMeetingOnFirstDayOfMonthEnabled( ); + * if(isSkipRepaymentOnFirstMonthEnabled){ isSkipRepaymentOnFirstMonth = + * isLoanRepaymentsSyncWithMeeting(loan.group(), calendar); if(isSkipRepaymentOnFirstMonth) { numberOfDays = + * configurationDomainService. retreivePeroidInNumberOfDaysForSkipMeetingDate().intValue(); } } */ try { @@ -163,8 +159,7 @@ public class MeetingWritePlatformServiceJpaRepositoryImpl implements MeetingWrit entityId = command.getGroupId(); entityType = CalendarEntityType.GROUPS; /* - * If group is within a center then center entityType should be - * passed for retrieving CalendarInstance. + * If group is within a center then center entityType should be passed for retrieving CalendarInstance. */ final Group group = this.groupRepository.findById(entityId).get(); if (group.isCenter()) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/data/NoteData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/data/NoteData.java index 1dc2f1ba3..a2247487a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/data/NoteData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/data/NoteData.java @@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.joda.time.DateTime; /** - * Immutable data object represent note or case information about a client, loan - * or loan transaction. + * Immutable data object represent note or case information about a client, loan or loan transaction. */ public class NoteData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java index 243b3289b..6abe50295 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java @@ -23,8 +23,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; /** - * Bowpi GT Rate repository to save on m_rate table (custom change for Credi - * Chapin) Created by Jose on 19/07/2017. + * Bowpi GT Rate repository to save on m_rate table (custom change for Credi Chapin) Created by Jose on 19/07/2017. */ public interface RateRepository extends JpaRepository, JpaSpecificationExecutor { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java index 3fb703a1b..207283c9c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java @@ -133,8 +133,7 @@ public class RateWriteServiceImpl implements RateWriteService { } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleRateDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { if (realCause.getMessage().contains("rate_name_org")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnClosureType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnClosureType.java index 76b0e5aa2..61da52012 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnClosureType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnClosureType.java @@ -24,8 +24,8 @@ import org.apache.fineract.portfolio.savings.domain.FixedDepositAccount; import org.apache.fineract.portfolio.savings.domain.RecurringDepositAccount; /** - * An enumeration of different options available on account closure - * {@link FixedDepositAccount} & {@link RecurringDepositAccount}. + * An enumeration of different options available on account closure {@link FixedDepositAccount} & + * {@link RecurringDepositAccount}. */ public enum DepositAccountOnClosureType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnHoldTransactionType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnHoldTransactionType.java index b6b6f1c51..751782100 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnHoldTransactionType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountOnHoldTransactionType.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.savings; import org.apache.fineract.portfolio.savings.domain.SavingsAccount; /** - * An enumeration of on hold transactions that can occur on a - * {@link SavingsAccount}. + * An enumeration of on hold transactions that can occur on a {@link SavingsAccount}. */ public enum DepositAccountOnHoldTransactionType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountType.java index 5cc539f8e..b038dd309 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountType.java @@ -22,8 +22,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.fineract.portfolio.savings.domain.SavingsAccount; /** - * An enumeration of different transactions that can occur on a - * {@link SavingsAccount}. + * An enumeration of different transactions that can occur on a {@link SavingsAccount}. */ public enum DepositAccountType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsAccountTransactionType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsAccountTransactionType.java index 99956b6d0..65bb7cc0d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsAccountTransactionType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsAccountTransactionType.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.savings; import org.apache.fineract.portfolio.savings.domain.SavingsAccount; /** - * An enumeration of different transactions that can occur on a - * {@link SavingsAccount}. + * An enumeration of different transactions that can occur on a {@link SavingsAccount}. */ public enum SavingsAccountTransactionType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsCompoundingInterestPeriodType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsCompoundingInterestPeriodType.java index 966c3d4ff..0aa5290b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsCompoundingInterestPeriodType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsCompoundingInterestPeriodType.java @@ -23,8 +23,7 @@ import java.util.List; /** *

              - * The compounding interest period is the span of time at the end of which - * savings in a client's account earn interest. + * The compounding interest period is the span of time at the end of which savings in a client's account earn interest. *

              */ public enum SavingsCompoundingInterestPeriodType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationDaysInYearType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationDaysInYearType.java index 0696e0951..d0f655267 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationDaysInYearType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationDaysInYearType.java @@ -23,8 +23,7 @@ import java.util.List; /** * - * People typically use either of the following settings when calculating there - * interest using the daily method: + * People typically use either of the following settings when calculating there interest using the daily method: *
                *
              • 360 and
              • *
              • 365
              • diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationType.java index 0e35dbb25..a62f1af85 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsInterestCalculationType.java @@ -30,8 +30,7 @@ import java.util.List; *
              * *

              - * The interest calculation must be based on a point in time for determining the - * balance in the account, such as: + * The interest calculation must be based on a point in time for determining the balance in the account, such as: *

              *
                *
              • beginning-of-day balance
              • @@ -40,8 +39,7 @@ import java.util.List; *
              * *

              - * Any one of the three may be used, but must be applied consistently. - * End-of-day balance is used by default at present. + * Any one of the three may be used, but must be applied consistently. End-of-day balance is used by default at present. *

              */ public enum SavingsInterestCalculationType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsPostingInterestPeriodType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsPostingInterestPeriodType.java index 59e35ed7a..c2e2a6828 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsPostingInterestPeriodType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsPostingInterestPeriodType.java @@ -22,8 +22,8 @@ import java.util.ArrayList; import java.util.List; /** - * The interest posting period is the span of time at the end of which savings - * earned but not yet credited/posted in a client's account is credited/posted. + * The interest posting period is the span of time at the end of which savings earned but not yet credited/posted in a + * client's account is credited/posted. */ public enum SavingsPostingInterestPeriodType { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java index 115c267a5..0c1cb2def 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java @@ -128,15 +128,13 @@ public class RecurringDepositAccountTransactionsApiResource { } /*** - * By default get the deposit template for deposits and withdrawal - * transactions + * By default get the deposit template for deposits and withdrawal transactions */ SavingsAccountTransactionData savingsAccount = this.depositAccountReadPlatformService .retrieveRecurringAccountDepositTransactionTemplate(recurringDepositAccountId); /*** - * Update transaction date and transaction type if transaction type is - * withdrawal + * Update transaction date and transaction type if transaction type is withdrawal */ if (is(commandParam, "withdrawal")) { savingsAccount = SavingsAccountTransactionData.withWithDrawalTransactionDetails(savingsAccount); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java index 49390fa7d..2753833c0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java @@ -307,20 +307,18 @@ public class SavingsAccountsApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) /* - * public String updateGsim(@PathParam("parentAccountId") final Long - * parentAccountId, final String apiRequestBodyAsJson, + * public String updateGsim(@PathParam("parentAccountId") final Long parentAccountId, final String + * apiRequestBodyAsJson, * * @QueryParam("command") final String commandParam) { */ public String updateGsim(@PathParam("parentAccountId") final Long parentAccountId, final String apiRequestBodyAsJson) { /* - * if (is(commandParam, "updateWithHoldTax")) { final CommandWrapper - * commandRequest = new - * CommandWrapperBuilder().withJson(apiRequestBodyAsJson). - * updateWithHoldTax(accountId) .build(); final CommandProcessingResult - * result = this.commandsSourceWritePlatformService.logCommandSource( - * commandRequest); return this.toApiJsonSerializer.serialize(result); } + * if (is(commandParam, "updateWithHoldTax")) { final CommandWrapper commandRequest = new + * CommandWrapperBuilder().withJson(apiRequestBodyAsJson). updateWithHoldTax(accountId) .build(); final + * CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource( commandRequest); + * return this.toApiJsonSerializer.serialize(result); } */ final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGSIMAccount(parentAccountId).withJson(apiRequestBodyAsJson) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsApiSetConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsApiSetConstants.java index 78fb5ef47..3ec70e700 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsApiSetConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsApiSetConstants.java @@ -28,9 +28,8 @@ import org.apache.fineract.portfolio.savings.data.SavingsProductData; public class SavingsApiSetConstants extends SavingsApiConstants { /** - * These parameters will match the class level parameters of - * {@link SavingsProductData}. Where possible, we try to get response - * parameters to match those of request parameters. + * These parameters will match the class level parameters of {@link SavingsProductData}. Where possible, we try to + * get response parameters to match those of request parameters. */ protected static final Set SAVINGS_PRODUCT_RESPONSE_DATA_PARAMETERS = new HashSet<>( Arrays.asList(idParamName, nameParamName, shortNameParamName, descriptionParamName, "currency", digitsAfterDecimalParamName, @@ -45,9 +44,8 @@ public class SavingsApiSetConstants extends SavingsApiConstants { daysToDormancyParamName, daysToInactiveParamName)); /** - * These parameters will match the class level parameters of - * {@link SavingsAccountData}. Where possible, we try to get response - * parameters to match those of request parameters. + * These parameters will match the class level parameters of {@link SavingsAccountData}. Where possible, we try to + * get response parameters to match those of request parameters. */ protected static final Set SAVINGS_ACCOUNT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountData.java index b68679885..e9ae7f32e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountData.java @@ -30,8 +30,7 @@ import org.apache.fineract.portfolio.charge.data.ChargeData; import org.apache.fineract.portfolio.tax.data.TaxGroupData; /** - * Immutable data object representing abstract for Fixed and Recurring Deposit - * Accounts Accounts. + * Immutable data object representing abstract for Fixed and Recurring Deposit Accounts Accounts. */ public class DepositAccountData { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountDataValidator.java index 21e84a6c3..87d0cb7cb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountDataValidator.java @@ -626,14 +626,10 @@ public class DepositAccountDataValidator { baseDataValidator.reset().parameter(recurringFrequencyParamName).value(frequency).notNull().integerGreaterThanZero(); /* - * if (CalendarFrequencyType.fromInt(frequency).isWeekly()) { - * final Integer repeatsOnDay = - * this.fromApiJsonHelper.extractIntegerSansLocaleNamed - * (repeatsOnDayParamName, element); - * baseDataValidator.reset().parameter - * (repeatsOnDayParamName).value(repeatsOnDay).notBlank() - * .inMinMaxRange(CalendarWeekDaysType.getMinValue(), - * CalendarWeekDaysType.getMaxValue()); } + * if (CalendarFrequencyType.fromInt(frequency).isWeekly()) { final Integer repeatsOnDay = + * this.fromApiJsonHelper.extractIntegerSansLocaleNamed (repeatsOnDayParamName, element); + * baseDataValidator.reset().parameter (repeatsOnDayParamName).value(repeatsOnDay).notBlank() + * .inMinMaxRange(CalendarWeekDaysType.getMinValue(), CalendarWeekDaysType.getMaxValue()); } */ } } @@ -674,16 +670,11 @@ public class DepositAccountDataValidator { final Integer frequency = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(recurringFrequencyParamName, element); baseDataValidator.reset().parameter(recurringFrequencyParamName).value(frequency).notNull().integerGreaterThanZero(); /* - * if (this.fromApiJsonHelper.parameterExists(repeatsOnDayParamName, - * element)) { if - * (CalendarFrequencyType.fromInt(frequency).isWeekly()) { final - * Integer repeatsOnDay = - * this.fromApiJsonHelper.extractIntegerSansLocaleNamed - * (repeatsOnDayParamName, element); - * baseDataValidator.reset().parameter - * (repeatsOnDayParamName).value(repeatsOnDay).notBlank() - * .inMinMaxRange(CalendarWeekDaysType.getMinValue(), - * CalendarWeekDaysType.getMaxValue()); } } + * if (this.fromApiJsonHelper.parameterExists(repeatsOnDayParamName, element)) { if + * (CalendarFrequencyType.fromInt(frequency).isWeekly()) { final Integer repeatsOnDay = + * this.fromApiJsonHelper.extractIntegerSansLocaleNamed (repeatsOnDayParamName, element); + * baseDataValidator.reset().parameter (repeatsOnDayParamName).value(repeatsOnDay).notBlank() + * .inMinMaxRange(CalendarWeekDaysType.getMinValue(), CalendarWeekDaysType.getMaxValue()); } } */ } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductData.java index 0493c2d5a..04c72bf02 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductData.java @@ -144,8 +144,8 @@ public class DepositProductData { } /** - * Returns a {@link DepositProductData} that contains and exist - * {@link DepositProductData} data with further template data for dropdowns. + * Returns a {@link DepositProductData} that contains and exist {@link DepositProductData} data with further + * template data for dropdowns. * * @param taxGroupOptions * TODO diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductDataValidator.java index e4b68a8ba..59d35c1dd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositProductDataValidator.java @@ -259,13 +259,9 @@ public class DepositProductDataValidator { .isOneOfTheseValues(SavingsInterestCalculationDaysInYearType.integerValues()); /* - * if - * (fromApiJsonHelper.parameterExists(minRequiredOpeningBalanceParamName - * , element)) { final BigDecimal minOpeningBalance = - * fromApiJsonHelper.extractBigDecimalWithLocaleNamed - * (minRequiredOpeningBalanceParamName, element); - * baseDataValidator.reset - * ().parameter(minRequiredOpeningBalanceParamName + * if (fromApiJsonHelper.parameterExists(minRequiredOpeningBalanceParamName , element)) { final BigDecimal + * minOpeningBalance = fromApiJsonHelper.extractBigDecimalWithLocaleNamed (minRequiredOpeningBalanceParamName, + * element); baseDataValidator.reset ().parameter(minRequiredOpeningBalanceParamName * ).value(minOpeningBalance).zeroOrPositiveAmount(); } */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java index b59532b9d..7b580ebfa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java @@ -134,9 +134,8 @@ public final class FixedDepositProductData extends DepositProductData { } /** - * Returns a {@link FixedDepositProductData} that contains and exist - * {@link FixedDepositProductData} data with further template data for - * dropdowns. + * Returns a {@link FixedDepositProductData} that contains and exist {@link FixedDepositProductData} data with + * further template data for dropdowns. * * @param taxGroupOptions * TODO diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/RecurringDepositProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/RecurringDepositProductData.java index 1be8d15e3..7952a0144 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/RecurringDepositProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/RecurringDepositProductData.java @@ -142,9 +142,8 @@ public final class RecurringDepositProductData extends DepositProductData { } /** - * Returns a {@link RecurringDepositProductData} that contains and exist - * {@link RecurringDepositProductData} data with further template data for - * dropdowns. + * Returns a {@link RecurringDepositProductData} that contains and exist {@link RecurringDepositProductData} data + * with further template data for dropdowns. * * @param taxGroupOptions * TODO diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java index 120917689..b3481d837 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java @@ -22,8 +22,7 @@ import java.io.Serializable; import org.joda.time.LocalDate; /** - * Immutable data object represent the important time-line events of a savings - * account application. + * Immutable data object represent the important time-line events of a savings account application. */ @SuppressWarnings("unused") public class SavingsAccountApplicationTimelineData implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountConstant.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountConstant.java index dce547582..150eabade 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountConstant.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountConstant.java @@ -26,9 +26,8 @@ import org.apache.fineract.portfolio.savings.SavingsApiConstants; public class SavingsAccountConstant extends SavingsApiConstants { /** - * These parameters will match the class level parameters of - * {@link SavingsProductData}. Where possible, we try to get response - * parameters to match those of request parameters. + * These parameters will match the class level parameters of {@link SavingsProductData}. Where possible, we try to + * get response parameters to match those of request parameters. */ protected static final Set SAVINGS_ACCOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName, dateFormatParamName, monthDayFormatParamName, staffIdParamName, isGSIM, isParentAccount, accountNoParamName, @@ -43,9 +42,8 @@ public class SavingsAccountConstant extends SavingsApiConstants { gsimApplicationId, gsimLastApplication)); /** - * These parameters will match the class level parameters of - * {@link SavingsAccountData}. Where possible, we try to get response - * parameters to match those of request parameters. + * These parameters will match the class level parameters of {@link SavingsAccountData}. Where possible, we try to + * get response parameters to match those of request parameters. */ protected static final Set SAVINGS_ACCOUNT_TRANSACTION_REQUEST_DATA_PARAMETERS = new HashSet<>( diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionEnumData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionEnumData.java index c7ab3b631..61684354b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionEnumData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionEnumData.java @@ -22,8 +22,7 @@ import java.io.Serializable; import org.apache.fineract.portfolio.savings.SavingsAccountTransactionType; /** - * Immutable data object represent savings account transaction type - * enumerations. + * Immutable data object represent savings account transaction type enumerations. */ public class SavingsAccountTransactionEnumData implements Serializable { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java index 5937f33ff..856adf407 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java @@ -162,8 +162,8 @@ public final class SavingsProductData implements Serializable { } /** - * Returns a {@link SavingsProductData} that contains and exist - * {@link SavingsProductData} data with further template data for dropdowns. + * Returns a {@link SavingsProductData} that contains and exist {@link SavingsProductData} data with further + * template data for dropdowns. * * @param taxGroupOptions * TODO diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductDataValidator.java index 46a60b161..0dfd0b91c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductDataValidator.java @@ -204,38 +204,25 @@ public class SavingsProductDataValidator { } /* - * if - * (this.fromApiJsonHelper.parameterExists(withdrawalFeeAmountParamName, - * element)) { + * if (this.fromApiJsonHelper.parameterExists(withdrawalFeeAmountParamName, element)) { * - * final BigDecimal withdrawalFeeAmount = - * this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed - * (withdrawalFeeAmountParamName, element); - * baseDataValidator.reset().parameter - * (withdrawalFeeAmountParamName).value - * (withdrawalFeeAmount).zeroOrPositiveAmount(); + * final BigDecimal withdrawalFeeAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed + * (withdrawalFeeAmountParamName, element); baseDataValidator.reset().parameter + * (withdrawalFeeAmountParamName).value (withdrawalFeeAmount).zeroOrPositiveAmount(); * * if (withdrawalFeeAmount != null) { final Integer withdrawalFeeType = - * this.fromApiJsonHelper.extractIntegerSansLocaleNamed( - * withdrawalFeeTypeParamName, element); - * baseDataValidator.reset().parameter - * (withdrawalFeeTypeParamName).value(withdrawalFeeType) + * this.fromApiJsonHelper.extractIntegerSansLocaleNamed( withdrawalFeeTypeParamName, element); + * baseDataValidator.reset().parameter (withdrawalFeeTypeParamName).value(withdrawalFeeType) * .isOneOfTheseValues(SavingsWithdrawalFeesType.integerValues()); } } * - * if - * (this.fromApiJsonHelper.parameterExists(withdrawalFeeTypeParamName, - * element)) { final Integer withdrawalFeeType = - * this.fromApiJsonHelper.extractIntegerSansLocaleNamed - * (withdrawalFeeTypeParamName, element); - * baseDataValidator.reset().parameter - * (withdrawalFeeTypeParamName).value(withdrawalFeeType).ignoreIfNull() - * .isOneOfTheseValues(1, 2); + * if (this.fromApiJsonHelper.parameterExists(withdrawalFeeTypeParamName, element)) { final Integer + * withdrawalFeeType = this.fromApiJsonHelper.extractIntegerSansLocaleNamed (withdrawalFeeTypeParamName, + * element); baseDataValidator.reset().parameter + * (withdrawalFeeTypeParamName).value(withdrawalFeeType).ignoreIfNull() .isOneOfTheseValues(1, 2); * - * if (withdrawalFeeType != null) { final BigDecimal withdrawalFeeAmount - * = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed( - * withdrawalFeeAmountParamName, element); - * baseDataValidator.reset().parameter - * (withdrawalFeeAmountParamName).value(withdrawalFeeAmount).notNull() + * if (withdrawalFeeType != null) { final BigDecimal withdrawalFeeAmount = + * this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed( withdrawalFeeAmountParamName, element); + * baseDataValidator.reset().parameter (withdrawalFeeAmountParamName).value(withdrawalFeeAmount).notNull() * .zeroOrPositiveAmount(); } } */ if (this.fromApiJsonHelper.parameterExists(withdrawalFeeForTransfersParamName, element)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountAssembler.java index b8f8e292a..4c53f3c45 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountAssembler.java @@ -148,9 +148,8 @@ public class DepositAccountAssembler { } /** - * Assembles a new {@link SavingsAccount} from JSON details passed in - * request inheriting details where relevant from chosen - * {@link SavingsProduct}. + * Assembles a new {@link SavingsAccount} from JSON details passed in request inheriting details where relevant from + * chosen {@link SavingsProduct}. */ public SavingsAccount assembleFrom(final JsonCommand command, final AppUser submittedBy, final DepositAccountType depositAccountType) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java index c54ece998..cbf643256 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java @@ -209,17 +209,13 @@ public class DepositAccountDomainServiceJpa implements DepositAccountDomainServi */ updateExistingTransactionsDetails(account, existingTransactionIds, existingReversedTransactionIds); /* - * final SavingsAccountTransactionDTO transactionDTO = new - * SavingsAccountTransactionDTO(fmt, transactionDate, transactionAmount, - * paymentDetail, new Date()); final SavingsAccountTransaction deposit = - * account.deposit(transactionDTO); boolean isInterestTransfer = false; - * final MathContext mc = MathContext.DECIMAL64; if - * (account.isBeforeLastPostingPeriod(transactionDate)) { final - * LocalDate today = DateUtils.getLocalDateOfTenant(); - * account.postInterest(mc, today, isInterestTransfer); } else { final - * LocalDate today = DateUtils.getLocalDateOfTenant(); - * account.calculateInterestUsing(mc, today, isInterestTransfer); - * ======= + * final SavingsAccountTransactionDTO transactionDTO = new SavingsAccountTransactionDTO(fmt, transactionDate, + * transactionAmount, paymentDetail, new Date()); final SavingsAccountTransaction deposit = + * account.deposit(transactionDTO); boolean isInterestTransfer = false; final MathContext mc = + * MathContext.DECIMAL64; if (account.isBeforeLastPostingPeriod(transactionDate)) { final LocalDate today = + * DateUtils.getLocalDateOfTenant(); account.postInterest(mc, today, isInterestTransfer); } else { final + * LocalDate today = DateUtils.getLocalDateOfTenant(); account.calculateInterestUsing(mc, today, + * isInterestTransfer); ======= */ final MathContext mc = MathContext.DECIMAL64; final Locale locale = command.extractLocale(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositPreClosureDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositPreClosureDetail.java index e8d786eef..e22ad229b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositPreClosureDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositPreClosureDetail.java @@ -34,9 +34,8 @@ import org.apache.fineract.portfolio.savings.PreClosurePenalInterestOnType; import org.apache.fineract.portfolio.savings.service.SavingsEnumerations; /** - * DepositPreClosureDetail encapsulates all the details of a - * {@link FixedDepositProduct} that are also used and persisted by a - * {@link FixedDepositAccount}. + * DepositPreClosureDetail encapsulates all the details of a {@link FixedDepositProduct} that are also used and + * persisted by a {@link FixedDepositAccount}. */ @Embeddable public class DepositPreClosureDetail { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductAmountDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductAmountDetails.java index 955602019..b7ac667f0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductAmountDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductAmountDetails.java @@ -26,8 +26,7 @@ import javax.persistence.Embeddable; import org.apache.fineract.infrastructure.core.api.JsonCommand; /** - * RecurringDepositProductAmountDetails encapsulates all recurring Deposit - * Amount of a {@link RecurringDepositProduct}. + * RecurringDepositProductAmountDetails encapsulates all recurring Deposit Amount of a {@link RecurringDepositProduct}. */ @Embeddable public class DepositProductAmountDetails { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositRecurringDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositRecurringDetail.java index 1a8a03b7d..67c96c560 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositRecurringDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositRecurringDetail.java @@ -29,9 +29,8 @@ import javax.persistence.Embeddable; import org.apache.fineract.infrastructure.core.api.JsonCommand; /** - * DepositRecurringDetail encapsulates all the details of a - * {@link RecurringDepositProduct} that are also used and persisted by a - * {@link RecurringDepositAccount}. + * DepositRecurringDetail encapsulates all the details of a {@link RecurringDepositProduct} that are also used and + * persisted by a {@link RecurringDepositAccount}. */ @Embeddable public class DepositRecurringDetail { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java index fd36bf8ee..5c874ac4e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java @@ -41,8 +41,7 @@ import org.joda.time.Weeks; import org.joda.time.Years; /** - * DepositTermDetail encapsulates all the details of a - * {@link FixedDepositProduct} that are also used and persisted by a + * DepositTermDetail encapsulates all the details of a {@link FixedDepositProduct} that are also used and persisted by a * {@link FixedDepositAccount}. */ @Embeddable diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java index 6fb2ceff5..e4dc721cf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java @@ -406,12 +406,10 @@ public class FixedDepositAccount extends SavingsAccount { this.accountTermAndPreClosure.updateOnAccountClosureStatus(onClosureType); /* - * // withdraw deposit amount before closing the account final Money - * transactionAmountMoney = Money.of(this.currency, - * this.getAccountBalance()); final SavingsAccountTransaction withdraw = - * SavingsAccountTransaction.withdrawal(this, office(), paymentDetail, - * closedDate, transactionAmountMoney, new Date()); - * this.transactions.add(withdraw); + * // withdraw deposit amount before closing the account final Money transactionAmountMoney = + * Money.of(this.currency, this.getAccountBalance()); final SavingsAccountTransaction withdraw = + * SavingsAccountTransaction.withdrawal(this, office(), paymentDetail, closedDate, transactionAmountMoney, new + * Date()); this.transactions.add(withdraw); */ actualChanges.put(SavingsApiConstants.statusParamName, SavingsEnumerations.status(this.status)); actualChanges.put(SavingsApiConstants.localeParamName, command.locale()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java index 171fb7ade..1839ce0ed 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java @@ -511,12 +511,10 @@ public class RecurringDepositAccount extends SavingsAccount { this.accountTermAndPreClosure.updateOnAccountClosureStatus(onClosureType); /* - * // withdraw deposit amount before closing the account final Money - * transactionAmountMoney = Money.of(this.currency, - * this.getAccountBalance()); final SavingsAccountTransaction withdraw = - * SavingsAccountTransaction.withdrawal(this, office(), paymentDetail, - * closedDate, transactionAmountMoney, new Date()); - * this.transactions.add(withdraw); + * // withdraw deposit amount before closing the account final Money transactionAmountMoney = + * Money.of(this.currency, this.getAccountBalance()); final SavingsAccountTransaction withdraw = + * SavingsAccountTransaction.withdrawal(this, office(), paymentDetail, closedDate, transactionAmountMoney, new + * Date()); this.transactions.add(withdraw); */ actualChanges.put(SavingsApiConstants.statusParamName, SavingsEnumerations.status(this.status)); actualChanges.put(SavingsApiConstants.localeParamName, command.locale()); @@ -611,12 +609,10 @@ public class RecurringDepositAccount extends SavingsAccount { this.accountTermAndPreClosure.updateOnAccountClosureStatus(onClosureType); /* - * // withdraw deposit amount before closing the account final Money - * transactionAmountMoney = Money.of(this.currency, - * this.getAccountBalance()); final SavingsAccountTransaction withdraw = - * SavingsAccountTransaction.withdrawal(this, office(), paymentDetail, - * closedDate, transactionAmountMoney, new Date()); - * this.transactions.add(withdraw); + * // withdraw deposit amount before closing the account final Money transactionAmountMoney = + * Money.of(this.currency, this.getAccountBalance()); final SavingsAccountTransaction withdraw = + * SavingsAccountTransaction.withdrawal(this, office(), paymentDetail, closedDate, transactionAmountMoney, new + * Date()); this.transactions.add(withdraw); */ actualChanges.put(SavingsApiConstants.statusParamName, SavingsEnumerations.status(this.status)); @@ -944,11 +940,10 @@ public class RecurringDepositAccount extends SavingsAccount { } /** - * This method is responsible for checking if the current transaction is 'an - * advance/early payment' based on the details passed through. + * This method is responsible for checking if the current transaction is 'an advance/early payment' based on the + * details passed through. * - * Default implementation is check transaction date is before installment - * due date. + * Default implementation is check transaction date is before installment due date. */ protected boolean isTransactionInAdvanceOfInstallment(final int currentInstallmentIndex, final List installments, final LocalDate transactionDate) { @@ -1042,8 +1037,7 @@ public class RecurringDepositAccount extends SavingsAccount { // FIXME: Handle this scenario /* - * //final boolean recurringFrequencyBeforeDepositPeriod = - * recurringFrequencyBeforeDepositPeriod(); + * //final boolean recurringFrequencyBeforeDepositPeriod = recurringFrequencyBeforeDepositPeriod(); * * if (!recurringFrequencyBeforeDepositPeriod) { * baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode( @@ -1087,8 +1081,7 @@ public class RecurringDepositAccount extends SavingsAccount { throw new PlatformApiDataValidationException(dataValidationErrors); } /** - * final boolean recurringFrequencyBeforeDepositPeriod = - * recurringFrequencyBeforeDepositPeriod(); + * final boolean recurringFrequencyBeforeDepositPeriod = recurringFrequencyBeforeDepositPeriod(); * * if (!recurringFrequencyBeforeDepositPeriod) { * baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode( diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java index 27b2d9b77..8e9ef3187 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java @@ -220,11 +220,9 @@ public class SavingsAccount extends AbstractPersistableCustom { protected BigDecimal nominalAnnualInterestRate; /** - * The interest period is the span of time at the end of which savings in a - * client's account earn interest. + * The interest period is the span of time at the end of which savings in a client's account earn interest. * - * A value from the {@link SavingsCompoundingInterestPeriodType} - * enumeration. + * A value from the {@link SavingsCompoundingInterestPeriodType} enumeration. */ @Column(name = "interest_compounding_period_enum", nullable = false) protected Integer interestCompoundingPeriodType; @@ -242,8 +240,7 @@ public class SavingsAccount extends AbstractPersistableCustom { protected Integer interestCalculationType; /** - * A value from the {@link SavingsInterestCalculationDaysInYearType} - * enumeration. + * A value from the {@link SavingsInterestCalculationDaysInYearType} enumeration. */ @Column(name = "interest_calculation_days_in_year_type_enum", nullable = false) protected Integer interestCalculationDaysInYearType; @@ -258,8 +255,7 @@ public class SavingsAccount extends AbstractPersistableCustom { protected Integer lockinPeriodFrequencyType; /** - * When account becomes active this field is derived if - * lockinPeriodFrequency and + * When account becomes active this field is derived if lockinPeriodFrequency and * lockinPeriodFrequencyType details are present. */ @Temporal(TemporalType.DATE) @@ -433,9 +429,8 @@ public class SavingsAccount extends AbstractPersistableCustom { } /** - * Used after fetching/hydrating a {@link SavingsAccount} object to inject - * helper services/components used for update summary details after - * events/transactions on a {@link SavingsAccount}. + * Used after fetching/hydrating a {@link SavingsAccount} object to inject helper services/components used for + * update summary details after events/transactions on a {@link SavingsAccount}. */ public void setHelpers(final SavingsAccountTransactionSummaryWrapper savingsAccountTransactionSummaryWrapper, final SavingsHelper savingsHelper) { @@ -676,16 +671,13 @@ public class SavingsAccount extends AbstractPersistableCustom { /** * All interest calculation based on END-OF-DAY-BALANCE. * - * Interest calculation is performed on-the-fly over all account - * transactions. + * Interest calculation is performed on-the-fly over all account transactions. * * - * 1. Calculate Interest From Beginning Of Account 1a. determine the - * 'crediting' periods that exist for this savings acccount 1b. determine - * the 'compounding' periods that exist within each 'crediting' period - * calculate the amount of interest due at the end of each 'crediting' - * period check if an existing 'interest posting' transaction exists for - * date and matches the amount posted + * 1. Calculate Interest From Beginning Of Account 1a. determine the 'crediting' periods that exist for this savings + * acccount 1b. determine the 'compounding' periods that exist within each 'crediting' period calculate the amount + * of interest due at the end of each 'crediting' period check if an existing 'interest posting' transaction exists + * for date and matches the amount posted * * @param isInterestTransfer * TODO @@ -1107,9 +1099,8 @@ public class SavingsAccount extends AbstractPersistableCustom { } /* - * Loop through the onHold funds and see if we need to deduct or add - * to minimum required balance and the point in time the transaction - * was made: + * Loop through the onHold funds and see if we need to deduct or add to minimum required balance and the + * point in time the transaction was made: */ if (depositAccountOnHoldTransactions != null) { for (final DepositAccountOnHoldTransaction onHoldTransaction : depositAccountOnHoldTransactions) { @@ -1169,9 +1160,8 @@ public class SavingsAccount extends AbstractPersistableCustom { } /* - * Loop through the onHold funds and see if we need to deduct or add - * to minimum required balance and the point in time the transaction - * was made: + * Loop through the onHold funds and see if we need to deduct or add to minimum required balance and the + * point in time the transaction was made: */ if (depositAccountOnHoldTransactions != null) { for (final DepositAccountOnHoldTransaction onHoldTransaction : depositAccountOnHoldTransactions) { @@ -1451,8 +1441,7 @@ public class SavingsAccount extends AbstractPersistableCustom { } /** - * If overdrafts are allowed and the overdraft limit is not set, set the - * same to Zero + * If overdrafts are allowed and the overdraft limit is not set, set the same to Zero **/ private void esnureOverdraftLimitsSetForOverdraftAccounts() { @@ -1466,9 +1455,8 @@ public class SavingsAccount extends AbstractPersistableCustom { private void validateLockinDetails(final DataValidatorBuilder baseDataValidator) { /* - * final List dataValidationErrors = new - * ArrayList(); final DataValidatorBuilder - * baseDataValidator = new DataValidatorBuilder(dataValidationErrors) + * final List dataValidationErrors = new ArrayList(); final + * DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) * .resource(resourceName); */ @@ -2185,8 +2173,7 @@ public class SavingsAccount extends AbstractPersistableCustom { this.lockedInUntilDate = calculateDateAccountIsLockedUntil(getActivationLocalDate()); /* - * if (annualFeeSettingsSet()) { - * updateToNextAnnualFeeDueDateFrom(getActivationLocalDate()); } + * if (annualFeeSettingsSet()) { updateToNextAnnualFeeDueDateFrom(getActivationLocalDate()); } */ if (this.client != null && this.client.isActivatedAfter(activationDate)) { final DateTimeFormatter formatter = DateTimeFormat.forPattern(command.dateFormat()).withLocale(command.extractLocale()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountAssembler.java index c57e810b0..6642baf32 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountAssembler.java @@ -109,9 +109,8 @@ public class SavingsAccountAssembler { } /** - * Assembles a new {@link SavingsAccount} from JSON details passed in - * request inheriting details where relevant from chosen - * {@link SavingsProduct}. + * Assembles a new {@link SavingsAccount} from JSON details passed in request inheriting details where relevant from + * chosen {@link SavingsProduct}. */ public SavingsAccount assembleFrom(final JsonCommand command, final AppUser submittedBy) { @@ -319,9 +318,8 @@ public class SavingsAccountAssembler { } /** - * Assembles a new {@link SavingsAccount} from JSON details passed in - * request inheriting details where relevant from chosen - * {@link SavingsProduct}. + * Assembles a new {@link SavingsAccount} from JSON details passed in request inheriting details where relevant from + * chosen {@link SavingsProduct}. */ public SavingsAccount assembleFrom(final Client client, final Group group, final Long productId, final LocalDate appliedonDate, final AppUser appliedBy) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java index a447503f1..76364a637 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java @@ -193,8 +193,7 @@ public class SavingsAccountCharge extends AbstractPersistableCustom { defaultUserMessage, chargeDefinition.getId(), chargeDefinition.getName()); } /** - * For Weekly fee feeOnDay is ISO standard day of the week. - * Monday=1, Tuesday=2 + * For Weekly fee feeOnDay is ISO standard day of the week. Monday=1, Tuesday=2 */ this.feeOnDay = dueDate.getDayOfWeek(); } else { @@ -858,11 +857,9 @@ public class SavingsAccountCharge extends AbstractPersistableCustom { } /** - * This method is to identify the charges which can override the savings - * rules(for example if there is a minimum enforced balance of 1000 on - * savings account with account balance of 1000, still these charges can be - * collected as these charges are initiated by system and it can bring down - * the balance below the enforced minimum balance). + * This method is to identify the charges which can override the savings rules(for example if there is a minimum + * enforced balance of 1000 on savings account with account balance of 1000, still these charges can be collected as + * these charges are initiated by system and it can bring down the balance below the enforced minimum balance). * */ public boolean canOverriteSavingAccountRules() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargeRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargeRepositoryWrapper.java index 1f8b9ead3..88af69c4c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargeRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargeRepositoryWrapper.java @@ -26,8 +26,7 @@ import org.springframework.stereotype.Service; /** *

              - * Wrapper for {@link SavingsAccountChargeRepository} that adds NULL checking - * and Error handling capabilities + * Wrapper for {@link SavingsAccountChargeRepository} that adds NULL checking and Error handling capabilities *

              */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountRepositoryWrapper.java index 26b0de2a9..2ce045b60 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountRepositoryWrapper.java @@ -30,14 +30,13 @@ import org.springframework.transaction.annotation.Transactional; /** *

              - * Wrapper for {@link SavingsAccountRepository} that is responsible for checking - * if {@link SavingsAccount} is returned when using findOne - * repository method and throwing an appropriate not found exception. + * Wrapper for {@link SavingsAccountRepository} that is responsible for checking if {@link SavingsAccount} is returned + * when using findOne repository method and throwing an appropriate not found exception. *

              * *

              - * This is to avoid need for checking and throwing in multiple areas of code - * base where {@link SavingsAccountRepository} is required. + * This is to avoid need for checking and throwing in multiple areas of code base where {@link SavingsAccountRepository} + * is required. *

              */ @Service diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java index 557f9b74a..a15debd19 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java @@ -33,8 +33,7 @@ import org.apache.fineract.portfolio.savings.domain.interest.PostingPeriod; import org.joda.time.LocalDate; /** - * {@link SavingsAccountSummary} encapsulates all the summary details of a - * {@link SavingsAccount}. + * {@link SavingsAccountSummary} encapsulates all the summary details of a {@link SavingsAccount}. */ @Embeddable public final class SavingsAccountSummary { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java index 5bb221f4b..bee444f50 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java @@ -55,8 +55,7 @@ import org.joda.time.LocalDate; import org.springframework.util.CollectionUtils; /** - * All monetary transactions against a savings account are modelled through this - * entity. + * All monetary transactions against a savings account are modelled through this entity. */ @Entity @Table(name = "m_savings_account_transaction") @@ -480,9 +479,8 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom { } /*** - * Sending data in a map, though in savings we currently expect a - * transaction to always repay a single charge (or may repay a part of a - * single charge too) + * Sending data in a map, though in savings we currently expect a transaction to always repay a single charge + * (or may repay a part of a single charge too) ***/ if (!this.savingsAccountChargesPaid.isEmpty()) { final List> savingsChargesPaidData = new ArrayList<>(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionComparator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionComparator.java index 8fa1d6a60..e72028d99 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionComparator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionComparator.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.savings.domain; import java.util.Comparator; /** - * Sort savings account transactions by transaction date and transaction type - * placing + * Sort savings account transactions by transaction date and transaction type placing */ public class SavingsAccountTransactionComparator implements Comparator { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionSummaryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionSummaryWrapper.java index d72a2b1e1..51f1c639a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionSummaryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionSummaryWrapper.java @@ -25,8 +25,8 @@ import org.apache.fineract.organisation.monetary.domain.Money; import org.springframework.stereotype.Component; /** - * A wrapper for dealing with side-effect free functionality related to a - * {@link SavingsAccount}'s {@link SavingsAccountTransaction}'s. + * A wrapper for dealing with side-effect free functionality related to a {@link SavingsAccount}'s + * {@link SavingsAccountTransaction}'s. */ @Component public final class SavingsAccountTransactionSummaryWrapper { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java index 8af02b9e1..b736fa2eb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java @@ -114,11 +114,9 @@ public class SavingsProduct extends AbstractPersistableCustom { protected BigDecimal nominalAnnualInterestRate; /** - * The interest period is the span of time at the end of which savings in a - * client's account earn interest. + * The interest period is the span of time at the end of which savings in a client's account earn interest. * - * A value from the {@link SavingsCompoundingInterestPeriodType} - * enumeration. + * A value from the {@link SavingsCompoundingInterestPeriodType} enumeration. */ @Column(name = "interest_compounding_period_enum", nullable = false) protected Integer interestCompoundingPeriodType; @@ -136,8 +134,7 @@ public class SavingsProduct extends AbstractPersistableCustom { protected Integer interestCalculationType; /** - * A value from the {@link SavingsInterestCalculationDaysInYearType} - * enumeration. + * A value from the {@link SavingsInterestCalculationDaysInYearType} enumeration. */ @Column(name = "interest_calculation_days_in_year_type_enum", nullable = false) protected Integer interestCalculationDaysInYearType; @@ -312,8 +309,7 @@ public class SavingsProduct extends AbstractPersistableCustom { } /** - * If overdrafts are allowed and the overdraft limit is not set, set the - * same to Zero + * If overdrafts are allowed and the overdraft limit is not set, set the same to Zero **/ private void esnureOverdraftLimitsSetForOverdraftAccounts() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/CompoundInterestHelper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/CompoundInterestHelper.java index 0d026cb47..777d7b2e4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/CompoundInterestHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/CompoundInterestHelper.java @@ -30,12 +30,11 @@ public class CompoundInterestHelper { * @param currency * @param allPeriods * @param lockUntil - * - account locked date used with the combination of - * immediateWithdrawalOfInterest to avoid exclusion of + * - account locked date used with the combination of immediateWithdrawalOfInterest to avoid exclusion of * interestEarned * @param interestTransferEnabled - * - boolean flag used to avoid addition of interest to next - * posting period as income while calculating interest + * - boolean flag used to avoid addition of interest to next posting period as income while calculating + * interest * @return */ public Money calculateInterestForAllPostingPeriods(final MonetaryCurrency currency, final List allPeriods, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/EndOfDayBalance.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/EndOfDayBalance.java index 16e6b73be..14f313e51 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/EndOfDayBalance.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/EndOfDayBalance.java @@ -90,9 +90,8 @@ public class EndOfDayBalance { /** * Future Value (FV) = PV x (1+r)^n * - * Interest = FV - PV PV = Principal or the Account Balance r = rate per - * compounding period (so for daily, r = nominalInterestRateAsFraction x - * 1/365 n = number of periods rate is compounded + * Interest = FV - PV PV = Principal or the Account Balance r = rate per compounding period (so for daily, r = + * nominalInterestRateAsFraction x 1/365 n = number of periods rate is compounded */ public BigDecimal calculateInterestOnBalanceAndInterest(final BigDecimal interestToCompound, final BigDecimal interestRateAsFraction, final long daysInYear, final BigDecimal minBalanceForInterestCalculation, final BigDecimal overdraftInterestRateAsFraction, @@ -132,9 +131,8 @@ public class EndOfDayBalance { /** * @param compoundingPeriodInterval * @param upToInterestCalculationDate - * : For calculating maturity details in advance - * upToInterestCalculationDate will be maturity date else it will - * be DateUtils.getLocalDateOfTenant(). + * : For calculating maturity details in advance upToInterestCalculationDate will be maturity date else + * it will be DateUtils.getLocalDateOfTenant(). * @return */ public EndOfDayBalance upTo(final LocalDateInterval compoundingPeriodInterval, final LocalDate upToInterestCalculationDate) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/PostingPeriod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/PostingPeriod.java index f0f057e91..257b81a64 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/PostingPeriod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/PostingPeriod.java @@ -436,10 +436,9 @@ public final class PostingPeriod { } boolean notInRange = true; /* - * if strt date is 2016-10-05 if financial year set to 4 then applicable - * month will be march and september that is (3,9) if start date fall in - * month of oct,nov or dec then month will be 10, 11 or 12 so period end - * date should be taken from next year for march month + * if strt date is 2016-10-05 if financial year set to 4 then applicable month will be march and september that + * is (3,9) if start date fall in month of oct,nov or dec then month will be 10, 11 or 12 so period end date + * should be taken from next year for march month */ for (Integer month : monthSet) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountTransactionNotAllowedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountTransactionNotAllowedException.java index 997051236..1c9b8aeda 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountTransactionNotAllowedException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountTransactionNotAllowedException.java @@ -23,8 +23,7 @@ import org.apache.fineract.portfolio.savings.DepositAccountType; import org.apache.fineract.portfolio.savings.service.SavingsEnumerations; /** - * A {@link RuntimeException} thrown when deposit account transaction not - * allowed. + * A {@link RuntimeException} thrown when deposit account transaction not allowed. */ public class DepositAccountTransactionNotAllowedException extends AbstractPlatformServiceUnavailableException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/InsufficientAccountBalanceException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/InsufficientAccountBalanceException.java index f7194fe0a..f76474ad9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/InsufficientAccountBalanceException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/InsufficientAccountBalanceException.java @@ -22,8 +22,7 @@ import java.math.BigDecimal; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * Thrown when an attempt is made to withdraw money that is greater than the - * account balance. + * Thrown when an attempt is made to withdraw money that is greater than the account balance. */ public class InsufficientAccountBalanceException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsActivityPriorToClientTransferException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsActivityPriorToClientTransferException.java index 7c4b7d59a..aba18965d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsActivityPriorToClientTransferException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsActivityPriorToClientTransferException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class SavingsActivityPriorToClientTransferException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsTransferTransactionsCannotBeUndoneException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsTransferTransactionsCannotBeUndoneException.java index 2179302e4..faef461fe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsTransferTransactionsCannotBeUndoneException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsTransferTransactionsCannotBeUndoneException.java @@ -21,8 +21,8 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown an action to transition a - * loan from one state to another violates a domain rule. + * {@link AbstractPlatformDomainRuleException} thrown an action to transition a loan from one state to another violates + * a domain rule. */ public class SavingsTransferTransactionsCannotBeUndoneException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java index 6f6d93a31..56b5b3ca6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java @@ -322,23 +322,20 @@ public class DepositAccountInterestRateChartReadPlatformServiceImpl implements D * * public String schema() { return this.schemaSql; } * - * private DepositAccountInterestRateChartSlabsMapper() { final - * StringBuilder sqlBuilder = new StringBuilder(400); + * private DepositAccountInterestRateChartSlabsMapper() { final StringBuilder sqlBuilder = new + * StringBuilder(400); * * sqlBuilder .append( - * "ircd.id as ircdId, ircd.description as ircdDescription, ircd.period_type_enum ircdPeriodTypeId, " - * ) .append( + * "ircd.id as ircdId, ircd.description as ircdDescription, ircd.period_type_enum ircdPeriodTypeId, " ) .append( * "ircd.from_period as ircdFromPeriod, ircd.to_period as ircdToPeriod, ircd.amount_range_from as ircdAmountRangeFrom, " - * ) .append( - * "ircd.amount_range_to as ircdAmountRangeTo, ircd.annual_interest_rate as ircdAnnualInterestRate, " + * ) .append( "ircd.amount_range_to as ircdAmountRangeTo, ircd.annual_interest_rate as ircdAnnualInterestRate, " * ) .append( * "curr.code as currencyCode, curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, " * ) .append( * "curr.display_symbol as currencyDisplaySymbol, curr.decimal_places as currencyDigits, curr.currency_multiplesof as inMultiplesOf " - * ) .append("from ").append( - * "m_savings_account_interest_rate_slab ircd ") - * .append("left join m_currency curr on ircd.currency_code= curr.code " - * ); this.schemaSql = sqlBuilder.toString(); } + * ) .append("from ").append( "m_savings_account_interest_rate_slab ircd ") + * .append("left join m_currency curr on ircd.currency_code= curr.code " ); this.schemaSql = + * sqlBuilder.toString(); } */ @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java index 8bac0c01d..2fd008008 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java @@ -165,8 +165,7 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositsDropdownReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositsDropdownReadPlatformServiceImpl.java index 84e39f92d..c14f05d98 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositsDropdownReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositsDropdownReadPlatformServiceImpl.java @@ -34,20 +34,14 @@ public class DepositsDropdownReadPlatformServiceImpl implements DepositsDropdown } /* - * @Override public Collection - * retrieveDepositTermTypeOptions() { return - * SavingsEnumerations.recurringDepositFrequencyType - * (SavingsPeriodFrequencyType.values()); } + * @Override public Collection retrieveDepositTermTypeOptions() { return + * SavingsEnumerations.recurringDepositFrequencyType (SavingsPeriodFrequencyType.values()); } * - * @Override public Collection - * retrieveDepositPeriodFrequencyOptions() { return - * SavingsEnumerations.depositPeriodFrequency - * (SavingsPeriodFrequencyType.values()); } + * @Override public Collection retrieveDepositPeriodFrequencyOptions() { return + * SavingsEnumerations.depositPeriodFrequency (SavingsPeriodFrequencyType.values()); } * - * @Override public Collection - * retrieveInMultiplesOfDepositTermTypeOptions() { return - * SavingsEnumerations - * .recurringDepositFrequencyType(SavingsPeriodFrequencyType.values()); } + * @Override public Collection retrieveInMultiplesOfDepositTermTypeOptions() { return + * SavingsEnumerations .recurringDepositFrequencyType(SavingsPeriodFrequencyType.values()); } */ @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java index c79e07807..b120d7480 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java @@ -184,8 +184,7 @@ public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dae) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java index 85adc3294..d53de7aa1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java @@ -184,8 +184,7 @@ public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implem } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dae) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java index 3fc762e9d..941a48196 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java @@ -464,14 +464,11 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead } /* - * final BigDecimal withdrawalFeeAmount = - * rs.getBigDecimal("withdrawalFeeAmount"); + * final BigDecimal withdrawalFeeAmount = rs.getBigDecimal("withdrawalFeeAmount"); * - * EnumOptionData withdrawalFeeType = null; final Integer - * withdrawalFeeTypeValue = JdbcSupport.getInteger(rs, - * "withdrawalFeeTypeEnum"); if (withdrawalFeeTypeValue != null) { - * withdrawalFeeType = - * SavingsEnumerations.withdrawalFeeType(withdrawalFeeTypeValue); } + * EnumOptionData withdrawalFeeType = null; final Integer withdrawalFeeTypeValue = + * JdbcSupport.getInteger(rs, "withdrawalFeeTypeEnum"); if (withdrawalFeeTypeValue != null) { + * withdrawalFeeType = SavingsEnumerations.withdrawalFeeType(withdrawalFeeTypeValue); } */ final boolean withdrawalFeeForTransfers = rs.getBoolean("withdrawalFeeForTransfers"); @@ -487,19 +484,14 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead final boolean enforceMinRequiredBalance = rs.getBoolean("enforceMinRequiredBalance"); /* - * final BigDecimal annualFeeAmount = - * JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, - * "annualFeeAmount"); + * final BigDecimal annualFeeAmount = JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "annualFeeAmount"); * - * MonthDay annualFeeOnMonthDay = null; final Integer - * annualFeeOnMonth = JdbcSupport.getInteger(rs, - * "annualFeeOnMonth"); final Integer annualFeeOnDay = - * JdbcSupport.getInteger(rs, "annualFeeOnDay"); if (annualFeeAmount - * != null && annualFeeOnDay != null) { annualFeeOnMonthDay = new + * MonthDay annualFeeOnMonthDay = null; final Integer annualFeeOnMonth = JdbcSupport.getInteger(rs, + * "annualFeeOnMonth"); final Integer annualFeeOnDay = JdbcSupport.getInteger(rs, "annualFeeOnDay"); if + * (annualFeeAmount != null && annualFeeOnDay != null) { annualFeeOnMonthDay = new * MonthDay(annualFeeOnMonth, annualFeeOnDay); } * - * final LocalDate annualFeeNextDueDate = - * JdbcSupport.getLocalDate(rs, "annualFeeNextDueDate"); + * final LocalDate annualFeeNextDueDate = JdbcSupport.getLocalDate(rs, "annualFeeNextDueDate"); */ final BigDecimal totalDeposits = JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "totalDeposits"); final BigDecimal totalWithdrawals = JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "totalWithdrawals"); @@ -770,14 +762,11 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead } /* - * @Override public Collection - * retrieveAccountsWithAnnualFeeDue() { final String sql = "select " + - * this.annualFeeMapper.schema() + - * " where sa.annual_fee_next_due_date is not null and sa.annual_fee_next_due_date <= NOW()" - * ; + * @Override public Collection retrieveAccountsWithAnnualFeeDue() { final String sql = + * "select " + this.annualFeeMapper.schema() + + * " where sa.annual_fee_next_due_date is not null and sa.annual_fee_next_due_date <= NOW()" ; * - * return this.jdbcTemplate.query(sql, this.annualFeeMapper, new Object[] - * {}); } + * return this.jdbcTemplate.query(sql, this.annualFeeMapper, new Object[] {}); } */ private static final class SavingsAccountTransactionsMapper implements RowMapper { @@ -1033,11 +1022,9 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead // rs.getBigDecimal("withdrawalFeeAmount"); /* - * EnumOptionData withdrawalFeeType = null; final Integer - * withdrawalFeeTypeValue = JdbcSupport.getInteger(rs, - * "withdrawalFeeTypeEnum"); if (withdrawalFeeTypeValue != null) { - * withdrawalFeeType = - * SavingsEnumerations.withdrawalFeeType(withdrawalFeeTypeValue); } + * EnumOptionData withdrawalFeeType = null; final Integer withdrawalFeeTypeValue = + * JdbcSupport.getInteger(rs, "withdrawalFeeTypeEnum"); if (withdrawalFeeTypeValue != null) { + * withdrawalFeeType = SavingsEnumerations.withdrawalFeeType(withdrawalFeeTypeValue); } */ final boolean withdrawalFeeForTransfers = rs.getBoolean("withdrawalFeeForTransfers"); @@ -1058,11 +1045,9 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead // "annualFeeAmount"); /* - * MonthDay annualFeeOnMonthDay = null; final Integer - * annualFeeOnMonth = JdbcSupport.getInteger(rs, - * "annualFeeOnMonth"); final Integer annualFeeOnDay = - * JdbcSupport.getInteger(rs, "annualFeeOnDay"); if (annualFeeAmount - * != null && annualFeeOnDay != null) { annualFeeOnMonthDay = new + * MonthDay annualFeeOnMonthDay = null; final Integer annualFeeOnMonth = JdbcSupport.getInteger(rs, + * "annualFeeOnMonth"); final Integer annualFeeOnDay = JdbcSupport.getInteger(rs, "annualFeeOnDay"); if + * (annualFeeAmount != null && annualFeeOnDay != null) { annualFeeOnMonthDay = new * MonthDay(annualFeeOnMonth, annualFeeOnDay); } */ @@ -1222,17 +1207,13 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead } } /* - * private static final class SavingsAccountAnnualFeeMapper implements - * RowMapper { + * private static final class SavingsAccountAnnualFeeMapper implements RowMapper { * * private final String schemaSql; * - * public SavingsAccountAnnualFeeMapper() { final StringBuilder sqlBuilder = - * new StringBuilder(200); - * sqlBuilder.append("sa.id as id, sa.account_no as accountNo, "); - * sqlBuilder - * .append("sa.annual_fee_next_due_date as annualFeeNextDueDate "); - * sqlBuilder.append("from m_savings_account sa "); + * public SavingsAccountAnnualFeeMapper() { final StringBuilder sqlBuilder = new StringBuilder(200); + * sqlBuilder.append("sa.id as id, sa.account_no as accountNo, "); sqlBuilder + * .append("sa.annual_fee_next_due_date as annualFeeNextDueDate "); sqlBuilder.append("from m_savings_account sa "); * * this.schemaSql = sqlBuilder.toString(); } * @@ -1242,12 +1223,10 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead * * @SuppressWarnings("unused") final int rowNum) throws SQLException { * - * final Long id = rs.getLong("id"); final String accountNo = - * rs.getString("accountNo"); final LocalDate annualFeeNextDueDate = - * JdbcSupport.getLocalDate(rs, "annualFeeNextDueDate"); + * final Long id = rs.getLong("id"); final String accountNo = rs.getString("accountNo"); final LocalDate + * annualFeeNextDueDate = JdbcSupport.getLocalDate(rs, "annualFeeNextDueDate"); * - * return SavingsAccountAnnualFeeData.instance(id, accountNo, - * annualFeeNextDueDate); } } + * return SavingsAccountAnnualFeeData.instance(id, accountNo, annualFeeNextDueDate); } } */ @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java index 8b3afbcf9..04c7cd6e3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java @@ -1526,8 +1526,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi } /** - * Disable all standing instructions linked to the savings account if the - * status is "closed" + * Disable all standing instructions linked to the savings account if the status is "closed" * * @param savingsAccount * -- the savings account object diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java index 56e5fda16..b14b40762 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java @@ -159,8 +159,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java index f59f0dc1a..023d0ea01 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java @@ -82,8 +82,7 @@ public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements Savi } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dae) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/exception/TaxMappingNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/exception/TaxMappingNotFoundException.java index 829ae9722..9f4f21927 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/exception/TaxMappingNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/exception/TaxMappingNotFoundException.java @@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * {@link AbstractPlatformDomainRuleException} thrown when tax group mapping - * does not exist. + * {@link AbstractPlatformDomainRuleException} thrown when tax group mapping does not exist. */ public class TaxMappingNotFoundException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/exception/TransferNotSupportedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/exception/TransferNotSupportedException.java index f6638c91b..317bf1cf6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/exception/TransferNotSupportedException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/exception/TransferNotSupportedException.java @@ -21,8 +21,7 @@ package org.apache.fineract.portfolio.transfer.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; /** - * {@link AbstractPlatformDomainRuleException} thrown when not supported loan - * template type is sent. + * {@link AbstractPlatformDomainRuleException} thrown when not supported loan template type is sent. */ public class TransferNotSupportedException extends AbstractPlatformDomainRuleException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/service/TransferWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/service/TransferWritePlatformServiceJpaRepositoryImpl.java index 6fc887ab1..834694eab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/service/TransferWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/transfer/service/TransferWritePlatformServiceJpaRepositoryImpl.java @@ -153,8 +153,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr * Variables that would make sense
              *
                *
              • inheritDestinationGroupLoanOfficer: Default true
              • - *
              • newStaffId: Optional field with Id of new Loan Officer to be linked - * to this client and all his JLG loans for this group
              • + *
              • newStaffId: Optional field with Id of new Loan Officer to be linked to this client and all his JLG loans for + * this group
              • *
              ***/ @Transactional @@ -171,8 +171,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * TODO: for now we need to ensure that only one collection sheet - * calendar can be linked with a center or group entity
              + * TODO: for now we need to ensure that only one collection sheet calendar can be linked with a center or group + * entity
              **/ final CalendarInstance sourceGroupCalendarInstance = this.calendarInstanceRepository.findByEntityIdAndEntityTypeIdAndCalendarTypeId( sourceGroup.getId(), CalendarEntityType.GROUPS.getValue(), CalendarType.COLLECTION.getValue()); @@ -181,9 +181,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr .findCalendarInstancesForActiveLoansByGroupIdAndClientId(sourceGroup.getId(), client.getId()); /** - * if a calendar is present in the source group along with loans synced - * with it, we should ensure that the destination group also has a - * collection calendar + * if a calendar is present in the source group along with loans synced with it, we should ensure that the + * destination group also has a collection calendar **/ if (sourceGroupCalendarInstance != null && !activeLoanCalendarInstances.isEmpty()) { // get the destination calendar @@ -200,8 +199,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr final Calendar destinationGroupCalendar = destinationGroupCalendarInstance.getCalendar(); /*** - * Ensure that the recurrence pattern are same for collection - * meeting in both the source and the destination calendar + * Ensure that the recurrence pattern are same for collection meeting in both the source and the destination + * calendar ***/ if (!(CalendarUtils.isFrequencySame(sourceGroupCalendar.getRecurrence(), destinationGroupCalendar.getRecurrence()) && CalendarUtils.isIntervalSame(sourceGroupCalendar.getRecurrence(), destinationGroupCalendar.getRecurrence()))) { @@ -219,8 +218,7 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * Now Change the loan officer for this client and all his active JLG - * loans + * Now Change the loan officer for this client and all his active JLG loans **/ final Staff destinationGroupLoanOfficer = destinationGroup.getStaff(); @@ -255,8 +253,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * change client group membership (only if source group and destination - * group are not the same, i.e only Loan officer Transfer) + * change client group membership (only if source group and destination group are not the same, i.e only Loan + * officer Transfer) **/ if (!sourceGroup.getId().equals(destinationGroup.getId())) { client.getGroups().remove(sourceGroup); @@ -265,8 +263,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * This API is meant for transferring clients between branches mainly by - * Organizations following an Individual lending Model
              + * This API is meant for transferring clients between branches mainly by Organizations following an Individual + * lending Model
              * * @param clientId * @param jsonCommand @@ -293,11 +291,10 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * This API is meant for transferring clients between branches mainly by - * Organizations following an Individual lending Model
              - * If the Client is linked to any Groups, we can optionally choose to have - * all the linkages broken and all JLG Loans are converted into Individual - * Loans + * This API is meant for transferring clients between branches mainly by Organizations following an Individual + * lending Model
              + * If the Client is linked to any Groups, we can optionally choose to have all the linkages broken and all JLG Loans + * are converted into Individual Loans * * @param clientId * @param jsonCommand @@ -326,11 +323,10 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * This API is meant for transferring clients between branches mainly by - * Organizations following an Individual lending Model
              - * If the Client is linked to any Groups, we can optionally choose to have - * all the linkages broken and all JLG Loans are converted into Individual - * Loans + * This API is meant for transferring clients between branches mainly by Organizations following an Individual + * lending Model
              + * If the Client is linked to any Groups, we can optionally choose to have all the linkages broken and all JLG Loans + * are converted into Individual Loans * * @param clientId * @param jsonCommand @@ -403,8 +399,7 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr // get each individual loan for the client for (final Loan loan : this.loanRepositoryWrapper.findLoanByClientId(client.getId())) { /** - * We need to create transactions etc only for loans which are - * disbursed and not yet closed + * We need to create transactions etc only for loans which are disbursed and not yet closed **/ if (loan.isDisbursed() && !loan.isClosed()) { switch (transferEventType) { @@ -528,9 +523,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * private void validateGroupAwaitingTransferAcceptance(final Group group) { - * if (!group.isTransferInProgress()) { throw new - * ClientNotAwaitingTransferApprovalException(group.getId()); } } + * private void validateGroupAwaitingTransferAcceptance(final Group group) { if (!group.isTransferInProgress()) { + * throw new ClientNotAwaitingTransferApprovalException(group.getId()); } } **/ private void validateClientAwaitingTransferAcceptanceOnHold(final Client client) { @@ -540,9 +534,9 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr } /** - * private void validateGroupAwaitingTransferAcceptanceOnHold(final Group - * group) { if (!group.isTransferInProgressOrOnHold()) { throw new - * ClientNotAwaitingTransferApprovalException(group.getId()); } } + * private void validateGroupAwaitingTransferAcceptanceOnHold(final Group group) { if + * (!group.isTransferInProgressOrOnHold()) { throw new ClientNotAwaitingTransferApprovalException(group.getId()); } + * } **/ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/template/service/TrustModifier.java b/fineract-provider/src/main/java/org/apache/fineract/template/service/TrustModifier.java index 68bcdff12..c9c6c23a3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/template/service/TrustModifier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/template/service/TrustModifier.java @@ -39,8 +39,7 @@ public class TrustModifier { private static SSLSocketFactory factory; /** - * Call this with any HttpURLConnection, and it will modify the trust - * settings if it is an HTTPS connection. + * Call this with any HttpURLConnection, and it will modify the trust settings if it is an HTTPS connection. */ public static void relaxHostChecking(final HttpURLConnection conn) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java index cabfd4c72..b154e5031 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java @@ -74,8 +74,7 @@ import org.springframework.stereotype.Component; public class UsersApiResource { /** - * The set of parameters that are supported in response for - * {@link AppUserData}. + * The set of parameters that are supported in response for {@link AppUserData}. */ private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "officeId", "officeName", "username", "firstname", "lastname", "email", "allowedOffices", "availableRoles", "selectedRoles", "staff")); diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java index 0eb20f31a..4119f750a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java @@ -338,8 +338,7 @@ public class AppUser extends AbstractPersistableCustom implements PlatformUser { } /** - * Delete is a soft delete. Updates flag so it wont appear in - * query/report results. + * Delete is a soft delete. Updates flag so it wont appear in query/report results. * * Any fields with unique constraints and prepended with id of record. */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PermissionCantBeMakerCheckerableException.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PermissionCantBeMakerCheckerableException.java index 5c7ffd959..9da77658f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PermissionCantBeMakerCheckerableException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PermissionCantBeMakerCheckerableException.java @@ -21,8 +21,7 @@ package org.apache.fineract.useradministration.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; /** - * A {@link RuntimeException} thrown when permission is attempted to be set as - * maker-checker enabled. + * A {@link RuntimeException} thrown when permission is attempted to be set as maker-checker enabled. */ public class PermissionCantBeMakerCheckerableException extends AbstractPlatformResourceNotFoundException { diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UnAuthenticatedUserException.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UnAuthenticatedUserException.java index 5cf2828f6..742dea73b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UnAuthenticatedUserException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UnAuthenticatedUserException.java @@ -21,8 +21,8 @@ package org.apache.fineract.useradministration.exception; import org.springframework.security.core.context.SecurityContext; /** - * A {@link RuntimeException} that is thrown in the case where no authenticated - * user exists within the platform {@link SecurityContext}. + * A {@link RuntimeException} that is thrown in the case where no authenticated user exists within the platform + * {@link SecurityContext}. */ public class UnAuthenticatedUserException extends RuntimeException { // no added behaviour diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/serialization/PermissionsCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/serialization/PermissionsCommandFromApiJsonDeserializer.java index 8b3d2acc0..37b86982b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/serialization/PermissionsCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/serialization/PermissionsCommandFromApiJsonDeserializer.java @@ -34,8 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * Implementation of {@link FromApiJsonDeserializer} for - * {@link PermissionsCommand}'s. + * Implementation of {@link FromApiJsonDeserializer} for {@link PermissionsCommand}'s. */ @Component public final class PermissionsCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer { diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java index fa12ec1f2..f360dbdc8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java @@ -263,8 +263,8 @@ public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWrit } /** - * encode the new submitted password retrieve the last n used password check - * if the current submitted password, match with one of them + * encode the new submitted password retrieve the last n used password check if the current submitted password, + * match with one of them * * @param user * @param command @@ -333,8 +333,7 @@ public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWrit } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { if (realCause.getMessage().contains("'username_org'")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java index a922176b0..c1b57e9c8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java @@ -101,9 +101,8 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform public String makerCheckerablePermissionSchema() { /* - * get all 'Maker-Checkerable' permissions - Maintenance permissions - * (i.e. exclude the 'special' grouping, the READ permissions and - * the CHECKER permissions + * get all 'Maker-Checkerable' permissions - Maintenance permissions (i.e. exclude the 'special' grouping, + * the READ permissions and the CHECKER permissions */ return "select p.grouping, p.code, p.entity_name as entityName, p.action_name as actionName, p.can_maker_checker as selected" diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java index 996bd0442..10086e34f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java @@ -100,8 +100,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf } /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. + * Guaranteed to throw an exception no matter what the data integrity issue is. */ private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) { diff --git a/fineract-provider/src/test/java/org/apache/fineract/batch/BatchBuilder.java b/fineract-provider/src/test/java/org/apache/fineract/batch/BatchBuilder.java index 7acb3a9bf..964015969 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/batch/BatchBuilder.java +++ b/fineract-provider/src/test/java/org/apache/fineract/batch/BatchBuilder.java @@ -29,8 +29,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; /** - * Runs a unit test for BatchApiResource by mocking the BatchRequest and - * BatchApiService objects. + * Runs a unit test for BatchApiResource by mocking the BatchRequest and BatchApiService objects. * * @author Rishabh Shukla */ diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java index 38f9db092..91662eda2 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java @@ -27,10 +27,9 @@ import io.restassured.specification.RequestSpecification; import io.restassured.specification.ResponseSpecification; /** - * REST integration tests helper. Intended to encapsulate the current - * RestAssured-based implementation as private. May be REST integration tests - * should instead be written using e.g. Spring's TestRestTemplate or Square's - * Retrofit (already used in the Mifos X Android client). + * REST integration tests helper. Intended to encapsulate the current RestAssured-based implementation as private. May + * be REST integration tests should instead be written using e.g. Spring's TestRestTemplate or Square's Retrofit + * (already used in the Mifos X Android client). */ public class RestAssuredFixture { diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java index 99d50b58e..f1cf5c260 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java @@ -33,11 +33,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Util for RestAssured tests. This class here in src/test is copy/pasted :( - * from and identical to the one in src/integrationTest; please keep it in sync. - * The cunning plan is that, now that we have Spring Boot + MariaDB4j, - * eventually do completely away with src/integrationTest and have only - * src/test.. can you help? ;) + * Util for RestAssured tests. This class here in src/test is copy/pasted :( from and identical to the one in + * src/integrationTest; please keep it in sync. The cunning plan is that, now that we have Spring Boot + MariaDB4j, + * eventually do completely away with src/integrationTest and have only src/test.. can you help? ;) */ @SuppressWarnings("unchecked") public class Utils { diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/classdupes/ClasspathHellDuplicatesCheckExtension.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/classdupes/ClasspathHellDuplicatesCheckExtension.java index 1e6142adc..ad4f893d1 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/classdupes/ClasspathHellDuplicatesCheckExtension.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/classdupes/ClasspathHellDuplicatesCheckExtension.java @@ -33,13 +33,11 @@ import org.opentest4j.AssertionFailedError; * * *

              - * NB that the basepom/duplicate-finder-maven-plugin already runs as part of - * odlparent. It has a similar purpose, but covers build time instead of runtime - * testing. This JUnit Rule class is thus recommended to be used in particular - * in tests which previously ran into JAR Hell issues, and for which - * non-regression with a clear failure message in case of future similar - * problems is important. (This provides more details at runtime than - * duplicate-finder-maven-plugin does at build time.) + * NB that the basepom/duplicate-finder-maven-plugin already runs as part of odlparent. It has a similar purpose, but + * covers build time instead of runtime testing. This JUnit Rule class is thus recommended to be used in particular in + * tests which previously ran into JAR Hell issues, and for which non-regression with a clear failure message in case of + * future similar problems is important. (This provides more details at runtime than duplicate-finder-maven-plugin does + * at build time.) * * @author Michael Vorburger.ch */ diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/SpringConfigurationTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/SpringConfigurationTest.java index cfb8b3665..a6d23e442 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/SpringConfigurationTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/SpringConfigurationTest.java @@ -26,16 +26,12 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.web.WebAppConfiguration; /** - * This integration test ensure that the "production" Spring XML configuration - * files (appContext.xml & Co.) are valid. It does not need any database for - * that. + * This integration test ensure that the "production" Spring XML configuration files (appContext.xml & Co.) are valid. + * It does not need any database for that. * - * Note: For a simple test like this, contrary to - * AbstractSpringBootWithMariaDB4jIntegrationTest, there is no need to use - * Boot's SpringApplicationConfiguration here, instead the simpler classic Sring - * core ContextConfiguration is sufficient (as long as the - * TestsWithoutDatabaseAndNoJobsConfiguration used extends - * AbstractApplicationConfiguration). + * Note: For a simple test like this, contrary to AbstractSpringBootWithMariaDB4jIntegrationTest, there is no need to + * use Boot's SpringApplicationConfiguration here, instead the simpler classic Sring core ContextConfiguration is + * sufficient (as long as the TestsWithoutDatabaseAndNoJobsConfiguration used extends AbstractApplicationConfiguration). */ @ExtendWith(SpringExtension.class) @WebAppConfiguration @@ -44,11 +40,10 @@ import org.springframework.test.context.web.WebAppConfiguration; public class SpringConfigurationTest { /** - * This tests if "Aal izz well" (i.e. if we can start-up with the [almost] - * "production" Spring XML configuration) by doing nothing - it doesn't have - * to, as the SpringJUnit4ClassRunner with this @ContextConfiguration will - * automatically fail if e.g. there is any invalid Spring XML, an invalid - * bean definition somewhere or anything like that. + * This tests if "Aal izz well" (i.e. if we can start-up with the [almost] "production" Spring XML configuration) by + * doing nothing - it doesn't have to, as the SpringJUnit4ClassRunner with this @ContextConfiguration will + * automatically fail if e.g. there is any invalid Spring XML, an invalid bean definition somewhere or anything like + * that. * * @see https://www.google.ch/search?q=Aal+izz+well */ diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java index dc4c07f3f..4ce3cb8e2 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java @@ -26,17 +26,15 @@ import org.mockito.Mockito; import org.springframework.context.annotation.Bean; /** - * Spring @Configuration which does not require a running database. It also does - * not load any job configuration (as they are in the DB), thus nor starts any - * background jobs. For some integration tests, this may be perfectly sufficient + * Spring @Configuration which does not require a running database. It also does not load any job configuration (as they + * are in the DB), thus nor starts any background jobs. For some integration tests, this may be perfectly sufficient * (and faster to run such tests). */ public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicationConfiguration { /** - * Override TenantDatabaseUpgradeService binding, because the real one has - * a @PostConstruct upgradeAllTenants() which accesses the database on - * start-up. + * Override TenantDatabaseUpgradeService binding, because the real one has a @PostConstruct upgradeAllTenants() + * which accesses the database on start-up. */ @Bean public TenantDatabaseUpgradeService tenantDatabaseUpgradeService() { @@ -50,9 +48,8 @@ public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicat } /** - * Override JobRegisterService binding, because the real - * JobRegisterServiceImpl has a @PostConstruct loadAllJobs() which accesses - * the database on start-up. + * Override JobRegisterService binding, because the real JobRegisterServiceImpl has a @PostConstruct loadAllJobs() + * which accesses the database on start-up. */ @Bean public JobRegisterService jobRegisterServiceImpl() { diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java index aa2cb7721..37413fe8d 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java @@ -55,8 +55,7 @@ public class AdhikarLoanRepaymentScheduleTransactionProcessorTest { } /** - * Scenario 1: Given no overdue installments, current interest due is paid - * before principal. + * Scenario 1: Given no overdue installments, current interest due is paid before principal. */ @Test public void givenNoOverdueInstallmentsOnTimeRepaymentPaysOffInterestDueFirst() { diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java index 2ad253cb9..738c450d7 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java @@ -55,13 +55,11 @@ public class HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest { } /** - * Scenario 1: Single transaction which is less than the interest component - * of the first installment. + * Scenario 1: Single transaction which is less than the interest component of the first installment. * - * Expectation: - First installment shows interest completed equal to that - * of transactions, zero principal completed. (payment order interest, - * principal) - transaction has interest portion equal to transaction - * amount, and zero principal portion + * Expectation: - First installment shows interest completed equal to that of transactions, zero principal + * completed. (payment order interest, principal) - transaction has interest portion equal to transaction amount, + * and zero principal portion */ @Test public void givenSingleOnTimeLoanTransactionShouldPayoffInterestComponentFirst() { diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java index c86eda5a3..273235989 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java @@ -30,9 +30,8 @@ import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail; /** - * This class is used to keep in one place configurations for setting up - * {@link LoanProductRelatedDetail} object used in {@link LoanScheduleGenerator} - * 's + * This class is used to keep in one place configurations for setting up {@link LoanProductRelatedDetail} object used in + * {@link LoanScheduleGenerator} 's */ public class LoanProductRelatedDetailTestHelper { diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanScheduleTestDataHelper.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanScheduleTestDataHelper.java index 3108b5d00..873357904 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanScheduleTestDataHelper.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanScheduleTestDataHelper.java @@ -34,10 +34,9 @@ public class LoanScheduleTestDataHelper { * * For example: with firstDueDate = 02 July 2011 * - * Date Principal Interest Interest Waived - * ================================== - * ================================================ 02 July 2011 1,000 200 0 - * 02 August 2011 1,000 200 0 02 September 2011 1,000 200 0 + * Date Principal Interest Interest Waived ================================== + * ================================================ 02 July 2011 1,000 200 0 02 August 2011 1,000 200 0 02 September + * 2011 1,000 200 0 */ public static List createSimpleLoanSchedule(final LocalDate firstDueDate, final MonetaryCurrency currency) { @@ -58,12 +57,9 @@ public class LoanScheduleTestDataHelper { * * For example: with firstDueDate = 02 July 2011 * - * Date Principal Interest Interest Waived Completed - * ======================== - * ================================================== - * ====================================== 02 July 2011 1,000 200 0 true - * (principal paid, interest paid) 02 August 2011 1,000 200 0 false 02 - * September 2011 1,000 200 0 false + * Date Principal Interest Interest Waived Completed ======================== + * ================================================== ====================================== 02 July 2011 1,000 200 + * 0 true (principal paid, interest paid) 02 August 2011 1,000 200 0 false 02 September 2011 1,000 200 0 false */ public static List createSimpleLoanScheduleWithFirstInstallmentFullyPaid(final LocalDate firstDueDate, final MonetaryCurrency currency) { diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanTransactionBuilder.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanTransactionBuilder.java index 111058685..2658dc1ef 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanTransactionBuilder.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanTransactionBuilder.java @@ -35,8 +35,7 @@ public class LoanTransactionBuilder { * * LoanTransaction transaction = null; * - * if (repayment) { transaction = - * LoanTransaction.repayment(transactionAmount, transactionDate); } + * if (repayment) { transaction = LoanTransaction.repayment(transactionAmount, transactionDate); } * * return transaction; } **/ From e8442a3db909eaf8c1ecb45beb2954fcf3040b48 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 23 Jun 2020 04:21:51 +0000 Subject: [PATCH 005/131] Update dependency gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin to v4.4.3 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 04510a5f0..9d0da6005 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -44,7 +44,7 @@ buildscript { classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0' - classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.4.1" + classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.4.3" classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" From c983e2716159b39bd12c4f4a3a76c22857e8756d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 23 Jun 2020 06:26:57 +0000 Subject: [PATCH 006/131] Update dependency com.github.spotbugs:spotbugs-annotations to v4.0.6 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 9d0da6005..f754b55d6 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -112,7 +112,7 @@ dependencyManagement { dependency 'org.mockito:mockito-junit-jupiter:3.3.3' dependency 'io.github.classgraph:classgraph:4.8.86' dependency 'org.awaitility:awaitility:4.0.3' - dependency 'com.github.spotbugs:spotbugs-annotations:4.0.4' + dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' dependency 'javax.cache:cache-api:1.1.1' dependency 'org.mock-server:mockserver-junit-jupiter:5.10' From a9030171dafc51357051f66ff14eb9bd9a1d39ee Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 23 Jun 2020 06:26:49 +0000 Subject: [PATCH 007/131] Update dependency com.github.spotbugs:spotbugs to v4.0.6 --- fineract-provider/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 9f425531c..911e224c4 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -20,7 +20,7 @@ dependencies { providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") spotbugsPlugins "jp.skypencil.findbugs.slf4j:bug-pattern:1.5.0@jar" - spotbugs 'com.github.spotbugs:spotbugs:4.0.4' + spotbugs 'com.github.spotbugs:spotbugs:4.0.6' // 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. From 8bc37be7cc32e5140b0047e7dd32daf8d6238a7f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 20 Jun 2020 21:51:50 +0000 Subject: [PATCH 008/131] Update dependency org.mock-server:mockserver-junit-jupiter to v5.10.0 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index f754b55d6..f4e2828b3 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -114,7 +114,7 @@ dependencyManagement { dependency 'org.awaitility:awaitility:4.0.3' dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' dependency 'javax.cache:cache-api:1.1.1' - dependency 'org.mock-server:mockserver-junit-jupiter:5.10' + dependency 'org.mock-server:mockserver-junit-jupiter:5.10.0' // If this is upgraded, you need to change path in WebFrontEndConfiguration dependency 'org.webjars.npm:swagger-ui-dist:3.27.0' From d70af43f13af4c7e48787b4c7c262235feff7069 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 23 Jun 2020 17:49:34 +0000 Subject: [PATCH 009/131] Update dependency io.github.classgraph:classgraph to v4.8.87 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index f4e2828b3..26e48fdd0 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -110,7 +110,7 @@ dependencyManagement { dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' dependency 'org.mockito:mockito-core:3.3.3' dependency 'org.mockito:mockito-junit-jupiter:3.3.3' - dependency 'io.github.classgraph:classgraph:4.8.86' + dependency 'io.github.classgraph:classgraph:4.8.87' dependency 'org.awaitility:awaitility:4.0.3' dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' dependency 'javax.cache:cache-api:1.1.1' From f1a06b42d7d4564ea8628a1e976799cd0625b966 Mon Sep 17 00:00:00 2001 From: Percy Ayuk Ashu Date: Tue, 23 Jun 2020 21:36:52 +0100 Subject: [PATCH 010/131] FINERACT-822 Enforce UndefinedEquals check (#1099) --- fineract-provider/build.gradle | 2 +- .../glaccount/domain/TrialBalance.java | 5 +++-- .../service/AccountingProcessorHelper.java | 4 +++- ...yWritePlatformServiceJpaRepositoryImpl.java | 7 +++++-- ...sWritePlatformServiceJpaRepositoryImpl.java | 2 +- .../EntityDataTableChecksTemplateData.java | 4 +++- .../portfolio/calendar/data/CalendarData.java | 7 +++++-- .../portfolio/group/data/CenterData.java | 10 ++++++---- .../portfolio/group/data/GroupGeneralData.java | 18 +++++++++++------- .../portfolio/loanaccount/domain/Loan.java | 12 +++++++----- .../domain/LoanDisbursementDetails.java | 3 ++- .../savings/domain/SavingsAccountCharge.java | 18 +++++++++++------- .../shareaccounts/domain/ShareAccount.java | 13 +++++++------ .../shareproducts/domain/ShareProduct.java | 2 +- 14 files changed, 66 insertions(+), 41 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 26e48fdd0..7d05e71b0 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -385,7 +385,6 @@ tasks.withType(JavaCompile) { "UnusedVariable", "SameNameButDifferent", "TypeParameterUnusedInFormals", - "UndefinedEquals", "JdkObsolete", "EmptyBlockTag", "MissingSummary", @@ -453,6 +452,7 @@ tasks.withType(JavaCompile) { "NarrowingCompoundAssignment", "MissingCasesInEnumSwitch", "ReferenceEquality", + "UndefinedEquals", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java index 11804ca09..f74f35e9a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java @@ -100,8 +100,9 @@ public class TrialBalance extends AbstractPersistableCustom { } TrialBalance other = (TrialBalance) obj; return Objects.equals(other.officeId, officeId) && Objects.equals(other.glAccountId, glAccountId) - && Objects.equals(other.amount, amount) && Objects.equals(other.entryDate, entryDate) - && Objects.equals(other.transactionDate, transactionDate) && Objects.equals(other.closingBalance, closingBalance); + && Objects.equals(other.amount, amount) && other.entryDate.compareTo(entryDate) == 0 ? Boolean.TRUE + : Boolean.FALSE && other.transactionDate.compareTo(transactionDate) == 0 ? Boolean.TRUE + : Boolean.FALSE && Objects.equals(other.closingBalance, closingBalance); } @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java index b555f74b6..5d98dcd98 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java @@ -530,7 +530,9 @@ public class AccountingProcessorHelper { * check if an accounting closure has happened for this branch after the transaction Date **/ if (latestGLClosure != null) { - if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().equals(transactionDate)) { + if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().compareTo(transactionDate) == 0 + ? Boolean.TRUE + : Boolean.FALSE) { throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate(), null, null); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java index 15295e0ab..6700e4c16 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java @@ -346,7 +346,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa final GLClosure latestGLClosureByBranch = this.glClosureRepository.getLatestGLClosureByBranch(officeId); if (latestGLClosureByBranch != null) { if (latestGLClosureByBranch.getClosingDate().after(journalEntriesTransactionDate) - || latestGLClosureByBranch.getClosingDate().equals(journalEntriesTransactionDate)) { + || latestGLClosureByBranch.getClosingDate().compareTo(journalEntriesTransactionDate) == 0 ? Boolean.TRUE + : Boolean.FALSE) { final String accountName = null; final String accountGLCode = null; throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, @@ -597,7 +598,9 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa // shouldn't be before an accounting closure final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(command.getOfficeId()); if (latestGLClosure != null) { - if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().equals(transactionDate)) { + if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().compareTo(transactionDate) == 0 + ? Boolean.TRUE + : Boolean.FALSE) { throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate(), null, null); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java index d708b030a..2ddbf4a58 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java @@ -133,7 +133,7 @@ public class ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl implements private void validateForCreateJournalEntry(ProvisioningEntryData existingEntry, ProvisioningEntry requested) { Date existingDate = existingEntry.getCreatedDate(); Date requestedDate = requested.getCreatedDate(); - if (existingDate.after(requestedDate) || existingDate.equals(requestedDate)) { + if (existingDate.after(requestedDate) || existingDate.compareTo(requestedDate) == 0 ? Boolean.TRUE : Boolean.FALSE) { throw new ProvisioningJournalEntriesCannotbeCreatedException(existingEntry.getCreatedDate(), requestedDate); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java index 34c95c274..79145be8b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java @@ -22,6 +22,7 @@ import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Objects; +import org.apache.commons.collections4.CollectionUtils; import org.apache.fineract.portfolio.loanproduct.data.LoanProductData; import org.apache.fineract.portfolio.savings.data.SavingsProductData; @@ -69,7 +70,8 @@ public class EntityDataTableChecksTemplateData implements Serializable { return Objects.equals(entities, that.entities) && Objects.equals(statusClient, that.statusClient) && Objects.equals(statusGroup, that.statusGroup) && Objects.equals(statusSavings, that.statusSavings) && Objects.equals(statusLoans, that.statusLoans) && Objects.equals(datatables, that.datatables) - && Objects.equals(loanProductDatas, that.loanProductDatas) && Objects.equals(savingsProductDatas, that.savingsProductDatas); + && CollectionUtils.isEqualCollection(loanProductDatas, that.loanProductDatas) + && CollectionUtils.isEqualCollection(savingsProductDatas, that.savingsProductDatas); } @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java index dc70ba6c1..3037ce0b8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java @@ -22,6 +22,7 @@ import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Objects; +import org.apache.commons.collections4.CollectionUtils; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.portfolio.calendar.domain.CalendarFrequencyType; import org.apache.fineract.portfolio.calendar.domain.CalendarRemindBy; @@ -525,8 +526,10 @@ public final class CalendarData implements Serializable { && Objects.equals(frequency, that.frequency) && Objects.equals(interval, that.interval) && Objects.equals(repeatsOnDay, that.repeatsOnDay) && Objects.equals(repeatsOnNthDayOfMonth, that.repeatsOnNthDayOfMonth) && Objects.equals(remindBy, that.remindBy) && Objects.equals(firstReminder, that.firstReminder) - && Objects.equals(secondReminder, that.secondReminder) && Objects.equals(recurringDates, that.recurringDates) - && Objects.equals(nextTenRecurringDates, that.nextTenRecurringDates) && Objects.equals(humanReadable, that.humanReadable) + && Objects.equals(secondReminder, that.secondReminder) + && CollectionUtils.isEqualCollection(recurringDates, that.recurringDates) + && CollectionUtils.isEqualCollection(nextTenRecurringDates, that.nextTenRecurringDates) + && Objects.equals(humanReadable, that.humanReadable) && Objects.equals(recentEligibleMeetingDate, that.recentEligibleMeetingDate) && Objects.equals(createdDate, that.createdDate) && Objects.equals(lastUpdatedDate, that.lastUpdatedDate) && Objects.equals(createdByUserId, that.createdByUserId) && Objects.equals(createdByUsername, that.createdByUsername) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java index 6666d5ada..1da1f59ce 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java @@ -23,6 +23,7 @@ import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Objects; +import org.apache.commons.collections4.CollectionUtils; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.dataqueries.data.DatatableData; @@ -280,11 +281,12 @@ public final class CenterData implements Serializable { && Objects.equals(officeName, that.officeName) && Objects.equals(staffId, that.staffId) && Objects.equals(staffName, that.staffName) && Objects.equals(hierarchy, that.hierarchy) && Objects.equals(status, that.status) && Objects.equals(activationDate, that.activationDate) - && Objects.equals(timeline, that.timeline) && Objects.equals(groupMembers, that.groupMembers) - && Objects.equals(groupMembersOptions, that.groupMembersOptions) + && Objects.equals(timeline, that.timeline) && CollectionUtils.isEqualCollection(groupMembers, that.groupMembers) + && CollectionUtils.isEqualCollection(groupMembersOptions, that.groupMembersOptions) && Objects.equals(collectionMeetingCalendar, that.collectionMeetingCalendar) - && Objects.equals(closureReasons, that.closureReasons) && Objects.equals(officeOptions, that.officeOptions) - && Objects.equals(staffOptions, that.staffOptions) && Objects.equals(totalCollected, that.totalCollected) + && CollectionUtils.isEqualCollection(closureReasons, that.closureReasons) + && CollectionUtils.isEqualCollection(officeOptions, that.officeOptions) + && CollectionUtils.isEqualCollection(staffOptions, that.staffOptions) && Objects.equals(totalCollected, that.totalCollected) && Objects.equals(totalOverdue, that.totalOverdue) && Objects.equals(totaldue, that.totaldue) && Objects.equals(installmentDue, that.installmentDue) && Objects.equals(datatables, that.datatables) && Objects.equals(rowIndex, that.rowIndex) && Objects.equals(dateFormat, that.dateFormat) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java index e9503acb8..cfc3f69a7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java @@ -22,6 +22,7 @@ import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Objects; +import org.apache.commons.collections4.CollectionUtils; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.dataqueries.data.DatatableData; @@ -380,14 +381,17 @@ public class GroupGeneralData implements Serializable { && Objects.equals(officeName, that.officeName) && Objects.equals(centerId, that.centerId) && Objects.equals(centerName, that.centerName) && Objects.equals(staffId, that.staffId) && Objects.equals(staffName, that.staffName) && Objects.equals(hierarchy, that.hierarchy) - && Objects.equals(groupLevel, that.groupLevel) && Objects.equals(clientMembers, that.clientMembers) - && Objects.equals(activeClientMembers, that.activeClientMembers) && Objects.equals(groupRoles, that.groupRoles) - && Objects.equals(calendarsData, that.calendarsData) + && Objects.equals(groupLevel, that.groupLevel) && CollectionUtils.isEqualCollection(clientMembers, that.clientMembers) + && CollectionUtils.isEqualCollection(activeClientMembers, that.activeClientMembers) + && CollectionUtils.isEqualCollection(groupRoles, that.groupRoles) + && CollectionUtils.isEqualCollection(calendarsData, that.calendarsData) && Objects.equals(collectionMeetingCalendar, that.collectionMeetingCalendar) - && Objects.equals(centerOptions, that.centerOptions) && Objects.equals(officeOptions, that.officeOptions) - && Objects.equals(staffOptions, that.staffOptions) && Objects.equals(clientOptions, that.clientOptions) - && Objects.equals(availableRoles, that.availableRoles) && Objects.equals(selectedRole, that.selectedRole) - && Objects.equals(closureReasons, that.closureReasons) && Objects.equals(timeline, that.timeline) + && CollectionUtils.isEqualCollection(centerOptions, that.centerOptions) + && CollectionUtils.isEqualCollection(officeOptions, that.officeOptions) + && CollectionUtils.isEqualCollection(staffOptions, that.staffOptions) + && CollectionUtils.isEqualCollection(clientOptions, that.clientOptions) + && CollectionUtils.isEqualCollection(availableRoles, that.availableRoles) && Objects.equals(selectedRole, that.selectedRole) + && CollectionUtils.isEqualCollection(closureReasons, that.closureReasons) && Objects.equals(timeline, that.timeline) && Objects.equals(datatables, that.datatables) && Objects.equals(rowIndex, that.rowIndex) && Objects.equals(dateFormat, that.dateFormat) && Objects.equals(locale, that.locale) && Objects.equals(submittedOnDate, that.submittedOnDate); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index 369397e98..024ff006e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -2529,7 +2529,7 @@ public class Loan extends AbstractPersistableCustom { Date date = null; for (LoanDisbursementDetails disbursementDetail : this.disbursementDetails) { if (disbursementDetail.actualDisbursementDate() == null) { - if (date == null || disbursementDetail.expectedDisbursementDate().equals(date)) { + if (date == null || disbursementDetail.expectedDisbursementDate().compareTo(date) == 0 ? Boolean.TRUE : Boolean.FALSE) { disbursementDetails.add(disbursementDetail); date = disbursementDetail.expectedDisbursementDate(); } else if (disbursementDetail.expectedDisbursementDate().before(date)) { @@ -2549,7 +2549,7 @@ public class Loan extends AbstractPersistableCustom { for (LoanDisbursementDetails disbursementDetail : this.disbursementDetails) { if (disbursementDetail.actualDisbursementDate() != null) { if (disbursementDetail.actualDisbursementDate().after(date) - || disbursementDetail.actualDisbursementDate().equals(date)) { + || disbursementDetail.actualDisbursementDate().compareTo(date) == 0 ? Boolean.TRUE : Boolean.FALSE) { date = disbursementDetail.actualDisbursementDate(); details = disbursementDetail; } @@ -2752,7 +2752,7 @@ public class Loan extends AbstractPersistableCustom { if (getExpectedFirstRepaymentOnDate() != null && (disbursedOn.isAfter(this.fetchRepaymentScheduleInstallment(1).getDueDate()) || disbursedOn.isAfter(getExpectedFirstRepaymentOnDate())) - && disbursedOn.toDate().equals(this.actualDisbursementDate)) { + && disbursedOn.toDate().compareTo(this.actualDisbursementDate) == 0 ? Boolean.TRUE : Boolean.FALSE) { final String errorMessage = "submittedOnDate cannot be after the loans expectedFirstRepaymentOnDate: " + getExpectedFirstRepaymentOnDate().toString(); throw new InvalidLoanStateTransitionException("disbursal", "cannot.be.after.expected.first.repayment.date", errorMessage, @@ -3970,7 +3970,8 @@ public class Loan extends AbstractPersistableCustom { boolean isRegenerationRequired = false; if (this.loanProduct.isMultiDisburseLoan()) { LoanDisbursementDetails details = fetchLastDisburseDetail(); - if (details != null && !details.expectedDisbursementDate().equals(details.actualDisbursementDate())) { + if (details != null && details.expectedDisbursementDate().compareTo(details.actualDisbursementDate()) == 0 ? Boolean.FALSE + : Boolean.TRUE) { isRegenerationRequired = true; } } @@ -6016,7 +6017,8 @@ public class Loan extends AbstractPersistableCustom { if ((loanTermVariations.getTermType().isDueDateVariation() && loanTermVariations.fetchDateValue().isAfter(actualDisbursementDate)) || (loanTermVariations.getTermType().isEMIAmountVariation() - && loanTermVariations.getTermApplicableFrom().equals(actualDisbursementDate.toDate())) + && loanTermVariations.getTermApplicableFrom().compareTo(actualDisbursementDate.toDate()) == 0 ? Boolean.TRUE + : Boolean.FALSE) || loanTermVariations.getTermApplicableFrom().after(actualDisbursementDate.toDate())) { iterator.remove(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java index 737f5a6f0..d9036b954 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java @@ -72,7 +72,8 @@ public class LoanDisbursementDetails extends AbstractPersistableCustom { } final LoanDisbursementDetails loanDisbursementDetails = (LoanDisbursementDetails) obj; if (loanDisbursementDetails.principal.equals(this.principal) - && loanDisbursementDetails.expectedDisbursementDate.equals(this.expectedDisbursementDate)) { + && loanDisbursementDetails.expectedDisbursementDate.compareTo(this.expectedDisbursementDate) == 0 ? Boolean.TRUE + : Boolean.FALSE) { return true; } return false; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java index 76364a637..9a9f0d7dd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java @@ -706,13 +706,17 @@ public class SavingsAccountCharge extends AbstractPersistableCustom { return Objects.equals(penaltyCharge, that.penaltyCharge) && Objects.equals(paid, that.paid) && Objects.equals(waived, that.waived) && Objects.equals(status, that.status) && Objects.equals(savingsAccount, that.savingsAccount) && Objects.equals(charge, that.charge) && Objects.equals(chargeTime, that.chargeTime) - && Objects.equals(dueDate, that.dueDate) && Objects.equals(feeOnMonth, that.feeOnMonth) - && Objects.equals(feeOnDay, that.feeOnDay) && Objects.equals(feeInterval, that.feeInterval) - && Objects.equals(chargeCalculation, that.chargeCalculation) && Objects.equals(percentage, that.percentage) - && Objects.equals(amountPercentageAppliedTo, that.amountPercentageAppliedTo) && Objects.equals(amount, that.amount) - && Objects.equals(amountPaid, that.amountPaid) && Objects.equals(amountWaived, that.amountWaived) - && Objects.equals(amountWrittenOff, that.amountWrittenOff) && Objects.equals(amountOutstanding, that.amountOutstanding) - && Objects.equals(inactivationDate, that.inactivationDate); + && dueDate.compareTo(that.dueDate) == 0 + ? Boolean.TRUE + : Boolean.FALSE && Objects.equals(feeOnMonth, that.feeOnMonth) && Objects.equals(feeOnDay, that.feeOnDay) + && Objects.equals(feeInterval, that.feeInterval) + && Objects.equals(chargeCalculation, that.chargeCalculation) && Objects.equals(percentage, that.percentage) + && Objects.equals(amountPercentageAppliedTo, that.amountPercentageAppliedTo) + && Objects.equals(amount, that.amount) && Objects.equals(amountPaid, that.amountPaid) + && Objects.equals(amountWaived, that.amountWaived) + && Objects.equals(amountWrittenOff, that.amountWrittenOff) + && Objects.equals(amountOutstanding, that.amountOutstanding) + && inactivationDate.compareTo(that.inactivationDate) == 0 ? Boolean.TRUE : Boolean.FALSE; } @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java index 443ea5dc9..f85dcd2fd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java @@ -215,7 +215,7 @@ public class ShareAccount extends AbstractPersistableCustom { public boolean setSubmittedDate(final Date submittedDate) { boolean toReturn = false; - if (!this.submittedDate.equals(submittedDate)) { + if (this.submittedDate.compareTo(submittedDate) == 0 ? Boolean.FALSE : Boolean.TRUE) { this.submittedDate = submittedDate; toReturn = true; } @@ -224,7 +224,7 @@ public class ShareAccount extends AbstractPersistableCustom { public boolean setApprovedDate(final Date approvedDate) { boolean toReturn = false; - if (!this.approvedDate.equals(approvedDate)) { + if (this.approvedDate.compareTo(approvedDate) == 0 ? Boolean.FALSE : Boolean.TRUE) { this.approvedDate = approvedDate; toReturn = true; } @@ -520,10 +520,11 @@ public class ShareAccount extends AbstractPersistableCustom { public ShareAccountTransaction getShareAccountTransaction(final ShareAccountTransaction transaction) { ShareAccountTransaction returnTrans = null; for (ShareAccountTransaction tran : this.shareAccountTransactions) { - if (tran.getPurchasedDate().equals(transaction.getPurchasedDate()) && tran.getTotalShares().equals(transaction.getTotalShares()) - && tran.getPurchasePrice().compareTo(transaction.getPurchasePrice()) == 0 ? Boolean.TRUE - : Boolean.FALSE && tran.getTransactionStatus().equals(transaction.getTransactionStatus()) - && tran.getTransactionType().equals(transaction.getTransactionType())) { + if (tran.getPurchasedDate().compareTo(transaction.getPurchasedDate()) == 0 ? Boolean.TRUE + : Boolean.FALSE && tran.getTotalShares().equals(transaction.getTotalShares()) + && tran.getPurchasePrice().compareTo(transaction.getPurchasePrice()) == 0 ? Boolean.TRUE + : Boolean.FALSE && tran.getTransactionStatus().equals(transaction.getTransactionStatus()) + && tran.getTransactionType().equals(transaction.getTransactionType())) { returnTrans = tran; break; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java index 7334ff57b..23aa8c86b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java @@ -407,7 +407,7 @@ public class ShareProduct extends AbstractAuditableCustom { if (this.marketPrice != null && !this.marketPrice.isEmpty()) { for (ShareProductMarketPrice data : this.marketPrice) { Date futureDate = data.getStartDate(); - if (currentDate.equals(futureDate) || currentDate.after(futureDate)) { + if (currentDate.compareTo(futureDate) == 0 ? Boolean.TRUE : Boolean.FALSE || currentDate.after(futureDate)) { marketValue = data.getPrice(); } } From eb2b39f160f31fea7c91d3ed1a81c4c442f6553d Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 23 Jun 2020 22:17:00 +0200 Subject: [PATCH 011/131] add @Disabled to 2 old unit tests (which perhaps should be removed) This saves a few seconds ;) in the build, and (more importantly) makes it easier to find all the project's @Disabled (formerly @Ignore) tests. --- .../AdhikarLoanRepaymentScheduleTransactionProcessorTest.java | 4 ++-- ...nsFamilyLoanRepaymentScheduleTransactionProcessorTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java index 37413fe8d..9e303492f 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java @@ -27,6 +27,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleIns import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.RBILoanRepaymentScheduleTransactionProcessor; import org.joda.time.LocalDate; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; @@ -38,14 +39,12 @@ public class AdhikarLoanRepaymentScheduleTransactionProcessorTest { // class under test private RBILoanRepaymentScheduleTransactionProcessor processor; - // private final LocalDate july2nd = new LocalDate(2012, 7, 2); private final MonetaryCurrency usDollars = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build(); private List installments; @BeforeEach public void setUpForEachTestCase() throws Exception { - Field field = MoneyHelper.class.getDeclaredField("roundingMode"); field.setAccessible(true); field.set(null, RoundingMode.HALF_EVEN); @@ -58,6 +57,7 @@ public class AdhikarLoanRepaymentScheduleTransactionProcessorTest { * Scenario 1: Given no overdue installments, current interest due is paid before principal. */ @Test + @Disabled public void givenNoOverdueInstallmentsOnTimeRepaymentPaysOffInterestDueFirst() { // // setup diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java index 738c450d7..3a672ba53 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java @@ -27,6 +27,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleIns import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.HeavensFamilyLoanRepaymentScheduleTransactionProcessor; import org.joda.time.LocalDate; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; @@ -38,14 +39,12 @@ public class HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest { // class under test private HeavensFamilyLoanRepaymentScheduleTransactionProcessor processor; - // private final LocalDate july2nd = new LocalDate(2012, 7, 2); private final MonetaryCurrency usDollars = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build(); private List installments; @BeforeEach public void setUpForEachTestCase() throws Exception { - Field field = MoneyHelper.class.getDeclaredField("roundingMode"); field.setAccessible(true); field.set(null, RoundingMode.HALF_EVEN); @@ -62,6 +61,7 @@ public class HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest { * and zero principal portion */ @Test + @Disabled public void givenSingleOnTimeLoanTransactionShouldPayoffInterestComponentFirst() { // // setup From 24d4c45d9a43928147acf8d6d027ee74ca9b13e2 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 23 Jun 2020 23:09:38 +0200 Subject: [PATCH 012/131] introduce Throwable cause to AbstractPlatformResourceNotFoundException (re. FINERACT-942) --- ...ractPlatformResourceNotFoundException.java | 27 +++++++++++++++++-- .../exception/RoleNotFoundException.java | 5 ++++ .../service/RoleReadPlatformServiceImpl.java | 7 +++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java index 1f0d7c7cb..b6174ce11 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java @@ -18,6 +18,9 @@ */ package org.apache.fineract.infrastructure.core.exception; +import java.util.ArrayList; +import java.util.List; + /** * A {@link RuntimeException} thrown when resources that are queried for are not found. */ @@ -27,11 +30,31 @@ public abstract class AbstractPlatformResourceNotFoundException extends RuntimeE private final String defaultUserMessage; private final Object[] defaultUserMessageArgs; - public AbstractPlatformResourceNotFoundException(final String globalisationMessageCode, final String defaultUserMessage, + protected AbstractPlatformResourceNotFoundException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { + super(findThrowableCause(defaultUserMessageArgs)); this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = defaultUserMessageArgs; + this.defaultUserMessageArgs = filterThrowableCause(defaultUserMessageArgs); + } + + private static Throwable findThrowableCause(Object[] defaultUserMessageArgs) { + for (Object defaultUserMessageArg : defaultUserMessageArgs) { + if (defaultUserMessageArg instanceof Throwable) { + return (Throwable) defaultUserMessageArg; + } + } + return null; + } + + private static Object[] filterThrowableCause(Object[] defaultUserMessageArgs) { + List filteredDefaultUserMessageArgs = new ArrayList<>(defaultUserMessageArgs.length); + for (Object defaultUserMessageArg : defaultUserMessageArgs) { + if (!(defaultUserMessageArg instanceof Throwable)) { + filteredDefaultUserMessageArgs.add(defaultUserMessageArg); + } + } + return filteredDefaultUserMessageArgs.toArray(); } public String getGlobalisationMessageCode() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/RoleNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/RoleNotFoundException.java index ab7d3d6ad..9e5e0cf27 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/RoleNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/RoleNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.useradministration.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when role resources are not found. @@ -32,4 +33,8 @@ public class RoleNotFoundException extends AbstractPlatformResourceNotFoundExcep public RoleNotFoundException(final String name) { super("error.msg.role.name.invalid", "Role with name " + name + " does not exist", name); } + + public RoleNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.role.id.invalid", "Role with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleReadPlatformServiceImpl.java index f4a4a06ca..c9b8edb7f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleReadPlatformServiceImpl.java @@ -68,13 +68,12 @@ public class RoleReadPlatformServiceImpl implements RoleReadPlatformService { @Override public RoleData retrieveOne(final Long id) { - try { final String sql = "select " + this.roleRowMapper.schema() + " where r.id=?"; - return this.jdbcTemplate.queryForObject(sql, this.roleRowMapper, new Object[] { id }); + return this.jdbcTemplate.queryForObject(sql, this.roleRowMapper, id); } catch (final EmptyResultDataAccessException e) { - throw new RoleNotFoundException(id); + throw new RoleNotFoundException(id, e); } } @@ -101,6 +100,6 @@ public class RoleReadPlatformServiceImpl implements RoleReadPlatformService { final String sql = "select " + this.roleRowMapper.schema() + " inner join m_appuser_role" + " ar on ar.role_id = r.id where ar.appuser_id= ?"; - return this.jdbcTemplate.query(sql, this.roleRowMapper, new Object[] { appUserId }); + return this.jdbcTemplate.query(sql, this.roleRowMapper, appUserId); } } From 8884e61103281cb6410ef2e9667ea2c6694fcfa9 Mon Sep 17 00:00:00 2001 From: Percy Ayuk Ashu Date: Fri, 26 Jun 2020 11:34:44 +0100 Subject: [PATCH 013/131] FINERACT-822 Enforce SameNameButDifferent check (#1083) --- fineract-provider/build.gradle | 2 +- .../DocumentManagementApiResourceSwagger.java | 4 ++-- .../api/LoanProductsApiResourceSwagger.java | 16 ++++++++-------- .../api/RolesApiResourceSwagger.java | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 7d05e71b0..9581ce1a6 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -383,7 +383,6 @@ tasks.withType(JavaCompile) { //Todo Remove necessary checks from this list disable( "UnusedVariable", - "SameNameButDifferent", "TypeParameterUnusedInFormals", "JdkObsolete", "EmptyBlockTag", @@ -425,6 +424,7 @@ tasks.withType(JavaCompile) { "StreamResourceLeak", "TruthIncompatibleType", "ByteBufferBackingArray", + "SameNameButDifferent", "OrphanedFormatString", "CatchAndPrintStackTrace", "ObjectToString", diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java index 3cf6b7ca8..94dd1754e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java @@ -90,7 +90,7 @@ final class DocumentManagementApiResourceSwagger { @ApiModelProperty(example = "3") public Long resourceId; - public PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes; + public PutEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes; @ApiModelProperty(example = "3") public String resourceIdentifier; } @@ -112,7 +112,7 @@ final class DocumentManagementApiResourceSwagger { @ApiModelProperty(example = "3") public Long resourceId; - public PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes; + public DeleteEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes; @ApiModelProperty(example = "3") public String resourceIdentifier; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java index abc5decd1..d5a48c4d1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java @@ -272,9 +272,9 @@ final class LoanProductsApiResourceSwagger { public Integer id; @ApiModelProperty(example = "1") public Integer productId; - public GetLoanProductsInterestRecalculationCompoundingType interestRecalculationCompoundingType; + public GetLoanProductsInterestRecalculationData.GetLoanProductsInterestRecalculationCompoundingType interestRecalculationCompoundingType; public GetLoanProductsInterestRecalculationCompoundingFrequencyType interestRecalculationCompoundingFrequencyType; - public GetLoanProductsRescheduleStrategyType rescheduleStrategyType; + public GetLoanProductsInterestRecalculationData.GetLoanProductsRescheduleStrategyType rescheduleStrategyType; public GetLoanProductsInterestRecalculationCompoundingFrequencyType recalculationRestFrequencyType; public GetLoanProductsPreClosureInterestCalculationStrategy preClosureInterestCalculationStrategy; @ApiModelProperty(example = "true") @@ -327,7 +327,7 @@ final class LoanProductsApiResourceSwagger { public GetLoanProductsRepaymentFrequencyType repaymentFrequencyType; @ApiModelProperty(example = "15.000000") public Float interestRatePerPeriod; - public GetLoanProductsInterestRateFrequencyType interestRateFrequencyType; + public GetLoanProductsResponse.GetLoanProductsInterestRateFrequencyType interestRateFrequencyType; @ApiModelProperty(example = "15.000000") public Float annualInterestRate; public GetLoanProductsAmortizationType amortizationType; @@ -348,7 +348,7 @@ final class LoanProductsApiResourceSwagger { @ApiModelProperty(example = "true") public Boolean isInterestRecalculationEnabled; public GetLoanProductsInterestRecalculationData interestRecalculationData; - public GetLoanProductsAccountingRule accountingRule; + public GetLoanProductsResponse.GetLoanProductsAccountingRule accountingRule; @ApiModelProperty(example = "0") public Integer principalThresholdForLastInstalment; } @@ -478,8 +478,8 @@ final class LoanProductsApiResourceSwagger { public String value; } - public GetLoanProductsInterestRecalculationCompoundingType interestRecalculationCompoundingType; - public GetLoanProductsRescheduleStrategyType rescheduleStrategyType; + public GetLoanProductsInterestRecalculationTemplateData.GetLoanProductsInterestRecalculationCompoundingType interestRecalculationCompoundingType; + public GetLoanProductsInterestRecalculationTemplateData.GetLoanProductsRescheduleStrategyType rescheduleStrategyType; public GetLoanProductsResponse.GetLoanProductsInterestRecalculationData.GetLoanProductsPreClosureInterestCalculationStrategy preClosureInterestCalculationStrategy; } @@ -780,7 +780,7 @@ final class LoanProductsApiResourceSwagger { public List interestRateVariationsForBorrowerCycle; @ApiModelProperty(example = "[]") public List numberOfRepaymentVariationsForBorrowerCycle; - public GetLoanProductsAccountingRule accountingRule; + public GetLoanProductsTemplateResponse.GetLoanProductsAccountingRule accountingRule; public GetLoansProductsDaysInMonthTemplateType daysInMonthType; public GetLoanProductsDaysInYearTemplateType daysInYearType; @ApiModelProperty(example = "false") @@ -1041,7 +1041,7 @@ final class LoanProductsApiResourceSwagger { public GetLoanProductsResponse.GetLoanProductsRepaymentFrequencyType repaymentFrequencyType; @ApiModelProperty(example = "5.000000") public Float interestRatePerPeriod; - public GetLoanProductsInterestRateFrequencyType interestRateFrequencyType; + public GetLoanProductsProductIdResponse.GetLoanProductsInterestRateFrequencyType interestRateFrequencyType; @ApiModelProperty(example = "60.000000") public Float annualInterestRate; public GetLoanProductsResponse.GetLoanProductsAmortizationType amortizationType; diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java index 48ececb55..6a5d904a9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java @@ -186,7 +186,7 @@ final class RolesApiResourceSwagger { public String ALL_FUNCTIONS_READ; } - public PostRolesRoleIdPermissionsResponsePermissions permissions; + public PutRolesRoleIdPermissionsRequest.PostRolesRoleIdPermissionsResponsePermissions permissions; } @@ -209,7 +209,7 @@ final class RolesApiResourceSwagger { @ApiModelProperty(example = "8") public Long resourceId; - public PostRolesRoleIdPermissionsResponsePermissions permissions; + public PutRolesRoleIdPermissionsRequest.PostRolesRoleIdPermissionsResponsePermissions permissions; } From a5afb0b833441d37bfab38c7aec26d8e7d6030a4 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Mon, 22 Jun 2020 14:29:07 +0530 Subject: [PATCH 014/131] FINERACT-1047 Integration test for Audit trails(Create) --- .../AuditIntegrationTest.java | 105 ++++++++++++++++++ .../integrationtests/common/AuditHelper.java | 89 +++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java create mode 100644 fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java new file mode 100644 index 000000000..b9570b5b3 --- /dev/null +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java @@ -0,0 +1,105 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.integrationtests; + +import io.restassured.builder.RequestSpecBuilder; +import io.restassured.builder.ResponseSpecBuilder; +import io.restassured.http.ContentType; +import io.restassured.specification.RequestSpecification; +import io.restassured.specification.ResponseSpecification; +import java.util.HashMap; +import java.util.List; +import org.apache.fineract.integrationtests.common.AuditHelper; +import org.apache.fineract.integrationtests.common.ClientHelper; +import org.apache.fineract.integrationtests.common.OfficeHelper; +import org.apache.fineract.integrationtests.common.Utils; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * + * @author Manthan Surkar + * + */ +public class AuditIntegrationTest { + + private ResponseSpecification responseSpec; + private RequestSpecification requestSpec; + private ClientHelper clientHelper; + private AuditHelper auditHelper; + + /** + * Sets up the essential settings for the TEST like contentType, expectedStatusCode. It uses the '@BeforeEach' + * annotation provided by jUnit. + */ + @BeforeEach + public void setup() { + Utils.initializeRESTAssured(); + this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); + this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); + this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); + this.auditHelper = new AuditHelper(this.requestSpec, this.responseSpec); + this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec); + } + + /** + * Here we Create/Update different Entities and verify an audit is generated for each action. This can be further + * extened with more entities and actions in similiar way. + */ + @SuppressWarnings("unchecked") + @Test + public void auditShouldbeCreated() { + // Audits recieved after all actions are performed. + List> auditsRecieved; + + // Audits recieved before any action is performed, needed in special + // cases eg: reactivate client, close client + List> auditsRecievedInitial; + + // When Client is created: Count should be "1" + final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); + Assertions.assertNotNull(clientId); + auditsRecieved = auditHelper.getAuditDetails(clientId, "CREATE", "CLIENT"); + auditHelper.verifyOneAuditOnly(auditsRecieved, clientId, "CREATE", "CLIENT"); + + // Performs multiple close and reactivate on client + + for (int i = 0; i < 4; i++) { + // Close + auditsRecievedInitial = auditHelper.getAuditDetails(clientId, "CLOSE", "CLIENT"); + this.clientHelper.closeClient(clientId); + auditsRecieved = auditHelper.getAuditDetails(clientId, "CLOSE", "CLIENT"); + auditHelper.verifyMultipleAuditsOnserver(auditsRecievedInitial, auditsRecieved, clientId, "CLOSE", "CLIENT"); + + // Activate + auditsRecievedInitial = auditHelper.getAuditDetails(clientId, "REACTIVATE", "CLIENT"); + this.clientHelper.reactivateClient(clientId); + auditsRecieved = auditHelper.getAuditDetails(clientId, "REACTIVATE", "CLIENT"); + auditHelper.verifyMultipleAuditsOnserver(auditsRecievedInitial, auditsRecieved, clientId, "REACTIVATE", "CLIENT"); + } + + // When Office is created + OfficeHelper officeHelper = new OfficeHelper(requestSpec, responseSpec); + int officeId = officeHelper.createOffice("22 June 2020"); + auditsRecieved = auditHelper.getAuditDetails(officeId, "CREATE", "OFFICE"); + auditHelper.verifyOneAuditOnly(auditsRecieved, officeId, "CREATE", "OFFICE"); + } + +} diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java new file mode 100644 index 000000000..cc995c637 --- /dev/null +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java @@ -0,0 +1,89 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.integrationtests.common; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import io.restassured.specification.RequestSpecification; +import io.restassured.specification.ResponseSpecification; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Manthan Surkar + * + */ + +public class AuditHelper { + + private ResponseSpecification responseSpec; + private RequestSpecification requestSpec; + + private static final Logger LOG = LoggerFactory.getLogger(AuditHelper.class); + private static final String AUDIT_BASE_URL = "/fineract-provider/api/v1/audits?" + Utils.TENANT_IDENTIFIER; + + public AuditHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { + this.requestSpec = requestSpec; + this.responseSpec = responseSpec; + } + + public List getAuditDetails(final Integer resourceId, final String actionName, final String entityName) { + final String AUDIT_URL = "/fineract-provider/api/v1/audits/?" + "entityName=" + entityName + "&resourceId=" + resourceId + + "&actionName=" + actionName + "&orderBy=id&sortBy=DSC&" + Utils.TENANT_IDENTIFIER; + List> responseAudits = Utils.performServerGet(requestSpec, responseSpec, AUDIT_URL, ""); + return responseAudits; + } + + /** + * Some audit actions can only be done once Eg: Creation of a client with id 123, hence we verify number of audits + * For such operations is "equal" to 1 always + */ + public void verifyOneAuditOnly(List> auditsToCheck, Integer id, String actionName, String entityType) { + LOG.info("------------------------------CHECK IF AUDIT CREATED------------------------------------\n"); + assertEquals(1, auditsToCheck.size(), "More than one audit created"); + HashMap auditToCheck = auditsToCheck.get(0); + String actual = auditToCheck.get("actionName").toString() + " is done on " + auditToCheck.get("entityName").toString() + " with id " + + auditToCheck.get("resourceId").toString(); + String expected = actionName + " is done on " + entityType + " with id " + id; + assertEquals(expected, actual, "Error in creating audit!"); + } + + public void verifyMultipleAuditsOnserver(List> auditsRecievedInitial, + List> auditsRecieved, Integer id, String actionName, String entityType) { + LOG.info("------------------------------CHECK IF AUDIT CREATED------------------------------------\n"); + assertEquals(auditsRecievedInitial.size() + 1, auditsRecieved.size(), "Audit is not Created"); + + Comparator> compareById = (HashMap a, HashMap b) -> a.get("id").toString() + .compareTo(b.get("id").toString()); + Collections.sort(auditsRecieved, compareById.reversed()); + + // First element is new audit created(Sorted DESC by Id) + HashMap auditToCheck = auditsRecieved.get(0); + String actual = auditToCheck.get("actionName").toString() + " is done on " + auditToCheck.get("entityName").toString() + " with id " + + auditToCheck.get("resourceId").toString(); + String expected = actionName + " is done on " + entityType + " with id " + id; + assertEquals(expected, actual, "Error in creating audit!"); + } + +} From 6c6839a70f75c593cd2fa22c19e37ffb1b8c3508 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 24 Jun 2020 13:43:15 +0000 Subject: [PATCH 015/131] Update dependency com.github.librepdf:openpdf to v1.3.20 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 9581ce1a6..fdfda28c8 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -92,7 +92,7 @@ dependencyManagement { dependency 'org.apache.commons:commons-email:1.5' dependency 'commons-io:commons-io:2.7' dependency 'org.drizzle.jdbc:drizzle-jdbc:1.4' - dependency 'com.github.librepdf:openpdf:1.3.19' + dependency 'com.github.librepdf:openpdf:1.3.20' dependency 'org.mnode.ical4j:ical4j:3.0.19' dependency 'org.flywaydb:flyway-core:6.4.4' dependency 'org.quartz-scheduler:quartz:2.3.2' From 885d2e9a57d8a120f43a6b93b35f278e1b5447ae Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Thu, 25 Jun 2020 19:55:41 +0530 Subject: [PATCH 016/131] Fixes Invalid Regex in Exception Messege(SQL builder) --- .../fineract/infrastructure/security/utils/SQLBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java index bc4a1382b..ae5f1343a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java @@ -76,7 +76,8 @@ public class SQLBuilder { } String columnName = trimmedCriteria.substring(0, columnOperatorIndex).trim().toLowerCase(Locale.ROOT); if (!ATOZ.matcher(columnName).matches()) { - throw new IllegalArgumentException("criteria column name must match [a-z]: " + trimmedCriteria); + throw new IllegalArgumentException( + "criteria column name must match [a-zA-Z_][a-zA-Z0-9_-]*\\.)?[a-zA-Z_-][a-zA-Z0-9_-]* : " + trimmedCriteria); } String operator = trimmedCriteria.substring(columnOperatorIndex).trim(); if (operator.indexOf(' ') > -1) { From d9911bd7714adbb382cd87aefecde5c339136af0 Mon Sep 17 00:00:00 2001 From: kiran-vsm Date: Thu, 25 Jun 2020 12:08:55 +0530 Subject: [PATCH 017/131] FINERACT-1043: Unable to create client due to invalid error message about required address field --- .../client/domain/ClientAddressRepository.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java index a17074deb..478d8ed92 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java @@ -21,14 +21,15 @@ package org.apache.fineract.portfolio.client.domain; import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; public interface ClientAddressRepository extends JpaRepository, JpaSpecificationExecutor { - ClientAddress findByClientId(String clientId); + @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id = :clientId AND clientAddress.addressType = :addressType AND clientAddress.isActive = :isActive ") + ClientAddress findByClientIdAndAddressTypeAndIsActive(@Param("clientId") final long clientId, final CodeValue addressType, + @Param("isActive") final boolean isActive); - // ClientAddress findByAddressId(long addressId); - - ClientAddress findByClientIdAndAddressTypeAndIsActive(final long clientId, final CodeValue addressTypeId, final boolean isActive); - - ClientAddress findByClientIdAndAddressId(final long clientId, final long addressId); + @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id = :clientId AND clientAddress.address.id = :addressId ") + ClientAddress findByClientIdAndAddressId(@Param("clientId") final long clientId, @Param("addressId") final long addressId); } From 66c3bfdd4f5b16e50e2a606762773e2a8d22ec2f Mon Sep 17 00:00:00 2001 From: percyashu Date: Wed, 24 Jun 2020 22:16:37 +0100 Subject: [PATCH 018/131] FINERACT-822 Enforce PublicConstructorForAbstractClass check --- fineract-provider/build.gradle | 4 ++-- .../core/exception/AbstractPlatformDomainRuleException.java | 2 +- .../AbstractPlatformServiceUnavailableException.java | 2 +- .../service/DepositAccountReadPlatformServiceImpl.java | 4 ++-- .../service/DepositProductReadPlatformServiceImpl.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index fdfda28c8..31629766d 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -215,7 +215,7 @@ jacocoTestReport{ spotless { format 'misc', { target '**/*.md', '**/*.properties', '**/*.gradle', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql' - targetExclude '**/build/**', '**/bin/**', '**/.settings/**' + targetExclude '**/build/**', '**/bin/**', '**/.settings/**','**/.idea/**' indentWithSpaces(4) endWithNewline() trimTrailingWhitespace() @@ -391,7 +391,6 @@ tasks.withType(JavaCompile) { "InvalidParam", "ReturnFromVoid", "AlmostJavadoc", - "PublicConstructorForAbstractClass", "ProtectedMembersInFinalClass", "StaticAssignmentInConstructor", "UnescapedEntity", @@ -453,6 +452,7 @@ tasks.withType(JavaCompile) { "MissingCasesInEnumSwitch", "ReferenceEquality", "UndefinedEquals", + "PublicConstructorForAbstractClass", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java index 5d830ef29..0499488f3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java @@ -27,7 +27,7 @@ public abstract class AbstractPlatformDomainRuleException extends RuntimeExcepti private final String defaultUserMessage; private final Object[] defaultUserMessageArgs; - public AbstractPlatformDomainRuleException(final String globalisationMessageCode, final String defaultUserMessage, + protected AbstractPlatformDomainRuleException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java index cf905ec20..bfdba2cfb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java @@ -27,7 +27,7 @@ public abstract class AbstractPlatformServiceUnavailableException extends Runtim private final String defaultUserMessage; private final Object[] defaultUserMessageArgs; - public AbstractPlatformServiceUnavailableException(final String globalisationMessageCode, final String defaultUserMessage, + protected AbstractPlatformServiceUnavailableException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java index 5c1bc58bd..69b5864be 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java @@ -547,7 +547,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead @Override public abstract DepositAccountData mapRow(ResultSet rs, int rowNum) throws SQLException; - public DepositAccountMapper() { + protected DepositAccountMapper() { final StringBuilder selectFieldsSqlBuilder = new StringBuilder(400); selectFieldsSqlBuilder.append("sa.id as id, sa.account_no as accountNo, sa.external_id as externalId, "); selectFieldsSqlBuilder.append("c.id as clientId, c.display_name as clientName, "); @@ -1083,7 +1083,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead private final ClientData client; private final GroupGeneralData group; - public DepositAccountTemplateMapper(final ClientData client, final GroupGeneralData group) { + protected DepositAccountTemplateMapper(final ClientData client, final GroupGeneralData group) { this.client = client; this.group = group; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java index 7042bb368..f44046308 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java @@ -133,7 +133,7 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead @Override public abstract DepositProductData mapRow(ResultSet rs, int rowNum) throws SQLException; - public DepositProductMapper() { + protected DepositProductMapper() { final StringBuilder sqlBuilder = new StringBuilder(400); sqlBuilder.append("sp.id as id, sp.name as name, sp.short_name as shortName, sp.description as description, "); sqlBuilder.append( From 4ede116861d811df700f3d5d6a7e17421bc65caf Mon Sep 17 00:00:00 2001 From: percyashu Date: Wed, 24 Jun 2020 23:14:15 +0100 Subject: [PATCH 019/131] FINERACT-822 Enforce UnescapedEntity check --- fineract-provider/build.gradle | 2 +- .../apache/fineract/integrationtests/common/BatchHelper.java | 4 ++-- .../apache/fineract/batch/service/BatchApiServiceImpl.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 31629766d..1ea6b72f2 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -393,7 +393,6 @@ tasks.withType(JavaCompile) { "AlmostJavadoc", "ProtectedMembersInFinalClass", "StaticAssignmentInConstructor", - "UnescapedEntity", "InvalidBlockTag", "ModifyCollectionInEnhancedForLoop", "NonCanonicalType", @@ -453,6 +452,7 @@ tasks.withType(JavaCompile) { "ReferenceEquality", "UndefinedEquals", "PublicConstructorForAbstractClass", + "UnescapedEntity", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java index bc70fbae3..bf009588a 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/BatchHelper.java @@ -73,7 +73,7 @@ public final class BatchHelper { * Returns the converted string response into JSON. * * @param json - * @return List + * @return {@code List} */ private static List fromJsonString(final String json) { return new Gson().fromJson(json, new TypeToken>() {}.getType()); @@ -113,7 +113,7 @@ public final class BatchHelper { * Returns a BatchResponse based on the given BatchRequest, by posting the request to the server. * * @param BatchRequest - * @return List + * @return {@code List} */ public static List postWithSingleRequest(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final BatchRequest br) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java index b04d7397b..3bc605ba7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java @@ -82,7 +82,7 @@ public class BatchApiServiceImpl implements BatchApiService { * * @param requestList * @param uriInfo - * @return List + * @return {@code List} */ private List handleBatchRequests(final List requestList, final UriInfo uriInfo) { From dff6109c81ac9f71a0bebc0e6154c6dc94888d11 Mon Sep 17 00:00:00 2001 From: percyashu Date: Thu, 25 Jun 2020 05:47:05 +0100 Subject: [PATCH 020/131] FINERACT-822 Enforce ModifyCollectionInEnhancedForLoop check --- fineract-provider/build.gradle | 2 +- .../EmailCampaignWritePlatformCommandHandlerImpl.java | 7 +++++-- .../service/SmsCampaignWritePlatformServiceJpaImpl.java | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 1ea6b72f2..1723001ae 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -394,7 +394,6 @@ tasks.withType(JavaCompile) { "ProtectedMembersInFinalClass", "StaticAssignmentInConstructor", "InvalidBlockTag", - "ModifyCollectionInEnhancedForLoop", "NonCanonicalType", "InvalidInlineTag", ) @@ -453,6 +452,7 @@ tasks.withType(JavaCompile) { "UndefinedEquals", "PublicConstructorForAbstractClass", "UnescapedEntity", + "ModifyCollectionInEnhancedForLoop", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java index 4165aaea2..e5848c214 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -444,8 +445,10 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai final String response = this.genericDataService.generateJsonFromGenericResultsetData(results); resultList = new ObjectMapper().readValue(response, new TypeReference>>() {}); // loop changes array date to string date - for (HashMap entry : resultList) { - for (Map.Entry map : entry.entrySet()) { + for (Iterator> it = resultList.iterator(); it.hasNext();) { + HashMap entry = it.next(); + for (Iterator> iter = entry.entrySet().iterator(); iter.hasNext();) { + Map.Entry map = iter.next(); String key = map.getKey(); Object ob = map.getValue(); if (ob instanceof ArrayList && ((ArrayList) ob).size() == 3) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java index b243e6c29..c215ce721 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -543,8 +544,10 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP return resultList; } // loop changes array date to string date - for (HashMap entry : resultList) { - for (Map.Entry map : entry.entrySet()) { + for (Iterator> iter = resultList.iterator(); iter.hasNext();) { + HashMap entry = iter.next(); + for (Iterator> it = entry.entrySet().iterator(); it.hasNext();) { + Map.Entry map = it.next(); String key = map.getKey(); Object ob = map.getValue(); if (ob instanceof ArrayList && ((ArrayList) ob).size() == 3) { From d9df7fe245d49d4542ddf4d331bd846828d7ed22 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Fri, 26 Jun 2020 14:32:14 +0300 Subject: [PATCH 021/131] FINERACT-835: Upgrade Swagger Annotations to Annotations 2.0 (#1101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michael Vorburger ⛑️ --- .travis.yml | 2 +- Dockerfile | 4 +- fineract-provider/build.gradle | 6 +- fineract-provider/dependencies.gradle | 6 +- .../api/AccrualAccountingApiResource.java | 31 +- .../AccrualAccountingApiResourceSwagger.java | 11 +- .../closure/api/GLClosuresApiResource.java | 71 +- .../api/GLClosuresApiResourceSwagger.java | 65 +- .../FinancialActivityAccountsApiResource.java | 63 +- ...ialActivityAccountsApiResourceSwagger.java | 33 +- .../glaccount/api/GLAccountsApiResource.java | 104 +-- .../api/GLAccountsApiResourceSwagger.java | 67 +- .../api/JournalEntriesApiResource.java | 103 +-- .../api/JournalEntriesApiResourceSwagger.java | 17 +- .../api/ProvisioningEntriesApiResource.java | 69 +- ...ProvisioningEntriesApiResourceSwagger.java | 25 +- .../rule/api/AccountingRuleApiResource.java | 80 +-- .../api/AccountingRuleApiResourceSwagger.java | 41 +- .../adhocquery/api/AdHocApiResource.java | 15 +- .../fineract/batch/api/BatchApiResource.java | 45 +- .../batch/api/BatchApiResourceSwagger.java | 31 +- .../commands/api/AuditsApiResource.java | 82 +-- .../api/MakercheckersApiResource.java | 64 +- .../api/MakercheckersApiResourceSwagger.java | 11 +- .../api/AccountNumberFormatsApiResource.java | 66 +- ...ccountNumberFormatsApiResourceSwagger.java | 35 +- .../cache/api/CacheApiResource.java | 39 +- .../cache/api/CacheApiResourceSwagger.java | 13 +- .../sms/api/SmsCampaignApiResource.java | 53 +- .../codes/api/CodeValuesApiResource.java | 78 +-- .../api/CodeValuesApiResourceSwagger.java | 47 +- .../codes/api/CodesApiResource.java | 67 +- .../codes/api/CodesApiResourceSwagger.java | 33 +- ...ernalServicesConfigurationApiResource.java | 44 +- ...rvicesConfigurationApiResourceSwagger.java | 9 +- .../api/GlobalConfigurationApiResource.java | 62 +- ...GlobalConfigurationApiResourceSwagger.java | 19 +- .../api/CreditBureauConfigurationAPI.java | 2 - .../api/DatatablesApiResource.java | 169 +++-- .../api/DatatablesApiResourceSwagger.java | 119 ++-- .../api/EntityDatatableChecksApiResource.java | 56 +- ...tityDatatableChecksApiResourceSwagger.java | 25 +- .../dataqueries/api/ReportsApiResource.java | 70 +- .../api/ReportsApiResourceSwagger.java | 55 +- .../api/RunreportsApiResource.java | 26 +- .../api/RunreportsApiResourceSwagger.java | 4 +- .../api/DocumentManagementApiResource.java | 105 ++- .../DocumentManagementApiResourceSwagger.java | 43 +- .../api/ImagesApiResource.java | 3 +- .../api/FineractEntityApiResource.java | 3 +- .../hooks/api/HookApiResource.java | 71 +- .../hooks/api/HookApiResourceSwagger.java | 59 +- .../jobs/api/SchedulerApiResource.java | 30 +- .../jobs/api/SchedulerApiResourceSwagger.java | 7 +- .../jobs/api/SchedulerJobApiResource.java | 67 +- .../api/SchedulerJobApiResourceSwagger.java | 41 +- .../api/ReportMailingJobApiResource.java | 77 +-- .../ReportMailingJobApiResourceSwagger.java | 89 ++- ...ReportMailingJobRunHistoryApiResource.java | 33 +- ...ailingJobRunHistoryApiResourceSwagger.java | 19 +- .../api/AuthenticationApiResource.java | 23 +- .../api/AuthenticationApiResourceSwagger.java | 23 +- .../security/api/UserDetailsApiResource.java | 26 +- .../api/UserDetailsApiResourceSwagger.java | 23 +- .../sms/api/SmsApiResource.java | 3 +- .../survey/api/LikelihoodApiResource.java | 3 +- .../survey/api/PovertyLineApiResource.java | 3 +- .../survey/api/SurveyApiResource.java | 42 +- .../survey/api/SurveyApiResourceSwagger.java | 47 +- .../api/InteropApiResource.java | 186 ++--- .../mix/api/MixReportApiResource.java | 8 +- .../mix/api/MixTaxonomyApiResource.java | 8 +- .../api/MixTaxonomyMappingApiResource.java | 8 +- .../api/NotificationApiResource.java | 8 +- .../holiday/api/HolidaysApiResource.java | 95 +-- .../api/HolidaysApiResourceSwagger.java | 63 +- .../monetary/api/CurrenciesApiResource.java | 37 +- .../api/CurrenciesApiResourceSwagger.java | 17 +- .../api/OfficeTransactionsApiResource.java | 3 +- .../office/api/OfficesApiResource.java | 69 +- .../office/api/OfficesApiResourceSwagger.java | 57 +- .../api/ProvisioningCategoryApiResource.java | 8 +- .../api/ProvisioningCriteriaApiResource.java | 58 +- ...rovisioningCriteriaApiResourceSwagger.java | 41 +- .../staff/api/StaffApiResource.java | 68 +- .../staff/api/StaffApiResourceSwagger.java | 69 +- .../teller/api/CashierApiResource.java | 8 +- .../teller/api/TellerApiResource.java | 202 +++--- .../teller/api/TellerApiResourceSwagger.java | 281 ++++---- .../teller/api/TellerJournalApiResource.java | 8 +- .../api/WorkingDaysApiResource.java | 43 +- .../api/WorkingDaysApiResourceSwagger.java | 27 +- .../api/AccountTransfersApiResource.java | 110 ++- .../AccountTransfersApiResourceSwagger.java | 315 +++++---- .../api/StandingInstructionApiResource.java | 115 ++-- ...StandingInstructionApiResourceSwagger.java | 309 +++++---- ...StandingInstructionHistoryApiResource.java | 52 +- ...gInstructionHistoryApiResourceSwagger.java | 51 +- .../accounts/api/AccountsApiResource.java | 93 ++- .../api/AccountsApiResourceSwagger.java | 313 +++++---- .../EntityFieldConfigurationApiResources.java | 30 +- ...FieldConfigurationApiResourcesSwagger.java | 19 +- .../charge/api/ChargesApiResource.java | 78 ++- .../charge/api/ChargesApiResourceSwagger.java | 125 ++-- .../client/api/ClientAddressApiResources.java | 58 +- .../api/ClientAddressApiResourcesSwagger.java | 75 +- .../client/api/ClientChargesApiResource.java | 81 +-- .../api/ClientChargesApiResourceSwagger.java | 111 ++- .../api/ClientIdentifiersApiResource.java | 77 +-- .../ClientIdentifiersApiResourceSwagger.java | 65 +- .../api/ClientTransactionsApiResource.java | 51 +- .../ClientTransactionsApiResourceSwagger.java | 65 +- .../client/api/ClientsApiResource.java | 129 ++-- .../client/api/ClientsApiResourceSwagger.java | 277 ++++---- .../api/CollateralsApiResource.java | 76 +- .../api/CollateralsApiResourceSwagger.java | 61 +- .../CollectionSheetApiResourceSwagger.java | 35 +- .../api/CollectionSheetApiResourse.java | 27 +- .../api/FloatingRatesApiResource.java | 55 +- .../api/FloatingRatesApiResourceSwagger.java | 89 ++- .../portfolio/fund/api/FundsApiResource.java | 53 +- .../fund/api/FundsApiResourceSwagger.java | 25 +- .../group/api/CentersApiResource.java | 128 ++-- .../group/api/CentersApiResourceSwagger.java | 181 +++-- .../group/api/GroupsApiResource.java | 147 ++-- .../group/api/GroupsApiResourceSwagger.java | 285 ++++---- .../InterestRateChartSlabsApiResource.java | 69 +- ...erestRateChartSlabsApiResourceSwagger.java | 99 ++- .../api/InterestRateChartsApiResource.java | 67 +- .../InterestRateChartsApiResourceSwagger.java | 73 +- .../api/LoanChargesApiResource.java | 100 ++- .../api/LoanChargesApiResourceSwagger.java | 165 +++-- .../api/LoanScheduleApiResource.java | 34 +- .../api/LoanScheduleApiResourceSwagger.java | 11 +- .../api/LoanTransactionsApiResource.java | 72 +- .../LoanTransactionsApiResourceSwagger.java | 109 ++- .../loanaccount/api/LoansApiResource.java | 234 +++---- .../api/LoansApiResourceSwagger.java | 471 +++++++------ .../api/LoanProductsApiResource.java | 65 +- .../api/LoanProductsApiResourceSwagger.java | 647 +++++++++--------- .../portfolio/note/api/NotesApiResource.java | 82 ++- .../note/api/NotesApiResourceSwagger.java | 81 ++- .../api/PaymentTypeApiResource.java | 61 +- .../api/PaymentTypeApiResourceSwagger.java | 59 +- .../products/api/ProductsApiResource.java | 75 +- .../api/ProductsApiResourceSwagger.java | 335 +++++---- .../api/FixedDepositAccountsApiResource.java | 101 ++- ...ixedDepositAccountsApiResourceSwagger.java | 313 +++++---- .../api/FixedDepositProductsApiResource.java | 69 +- ...ixedDepositProductsApiResourceSwagger.java | 319 +++++---- ...DepositAccountTransactionsApiResource.java | 68 +- ...AccountTransactionsApiResourceSwagger.java | 177 +++-- .../RecurringDepositAccountsApiResource.java | 101 ++- ...ringDepositAccountsApiResourceSwagger.java | 313 +++++---- .../RecurringDepositProductsApiResource.java | 69 +- ...ringDepositProductsApiResourceSwagger.java | 341 +++++---- .../api/SavingsAccountChargesApiResource.java | 102 ++- ...vingsAccountChargesApiResourceSwagger.java | 201 +++--- .../api/SavingsAccountsApiResource.java | 102 ++- .../SavingsAccountsApiResourceSwagger.java | 189 +++-- .../api/SavingsProductsApiResource.java | 71 +- .../SavingsProductsApiResourceSwagger.java | 367 +++++----- .../search/api/SearchApiResource.java | 46 +- .../search/api/SearchApiResourceSwagger.java | 55 +- .../api/SelfAccountTransferApiResource.java | 33 +- ...SelfAccountTransferApiResourceSwagger.java | 71 +- .../api/SelfBeneficiariesTPTApiResource.java | 71 +- ...elfBeneficiariesTPTApiResourceSwagger.java | 63 +- .../client/api/SelfClientsApiResource.java | 110 +-- .../api/SelfClientsApiResourceSwagger.java | 279 ++++---- .../loanaccount/api/SelfLoansApiResource.java | 108 +-- .../api/SelfLoansApiResourceSwagger.java | 573 ++++++++-------- .../self/pockets/api/PocketApiResource.java | 31 +- .../pockets/api/PocketApiResourceSwagger.java | 35 +- .../api/SelfLoanProductsApiResource.java | 166 +++-- .../SelfServiceRegistrationApiResource.java | 8 +- .../runreport/SelfRunReportApiResource.java | 41 +- .../SelfRunReportApiResourceSwagger.java | 17 +- .../savings/api/SelfSavingsApiResource.java | 57 +- .../api/SelfSavingsApiResourceSwagger.java | 221 +++--- .../api/SelfAuthenticationApiResource.java | 18 +- .../SelfAuthenticationApiResourceSwagger.java | 41 +- .../security/api/SelfUserApiResource.java | 31 +- .../api/SelfUserApiResourceSwagger.java | 17 +- .../api/SelfUserDetailsApiResource.java | 25 +- .../SelfUserDetailsApiResourceSwagger.java | 41 +- .../api/SelfShareAccountsApiResource.java | 40 +- .../SelfShareAccountsApiResourceSwagger.java | 339 +++++---- .../spm/api/SelfScorecardApiResource.java | 8 +- .../self/spm/api/SelfSpmApiResource.java | 8 +- .../api/ShareDividendApiResource.java | 8 +- .../tax/api/TaxComponentApiResource.java | 54 +- .../api/TaxComponentApiResourceSwagger.java | 69 +- .../tax/api/TaxGroupApiResource.java | 58 +- .../tax/api/TaxGroupApiResourceSwagger.java | 59 +- .../spm/api/LookupTableApiResource.java | 41 +- .../spm/api/ScorecardApiResource.java | 38 +- .../fineract/spm/api/SpmApiResource.java | 43 +- .../template/api/TemplatesApiResource.java | 82 +-- .../api/TemplatesApiResourcesSwagger.java | 75 +- .../api/PasswordPreferencesApiResource.java | 41 +- ...PasswordPreferencesApiResourceSwagger.java | 17 +- .../api/PermissionsApiResource.java | 41 +- .../api/PermissionsApiResourceSwagger.java | 19 +- .../api/RolesApiResource.java | 95 +-- .../api/RolesApiResourceSwagger.java | 75 +- .../api/UsersApiResource.java | 71 +- .../api/UsersApiResourceSwagger.java | 91 ++- .../resources/META-INF/spring/appContext.xml | 2 - .../resources/META-INF/spring/swagger.xml | 74 -- .../resources/static/swagger-ui/index.html | 2 +- gradle.properties | 7 +- 212 files changed, 8625 insertions(+), 8912 deletions(-) delete mode 100644 fineract-provider/src/main/resources/META-INF/spring/swagger.xml diff --git a/.travis.yml b/.travis.yml index 244228b4d..184a4516d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,6 @@ script: # and Docker test does not run if integration test fails, which makes PR failure easier to understand. # @see https://docs.travis-ci.com/user/job-lifecycle/#customizing-the-build-phase # NOTE: Sleep after docker-compose increased to 60 seconds as often Travis would fail to get Docker up in 30 seconds - - ./gradlew --console=plain licenseMain licenseTest licenseIntegrationTest check && ./gradlew --console=plain integrationTest --fail-fast && sudo service mysql stop && docker-compose build && docker-compose up -d && sleep 30s && http --verify=no --timeout 240 --check-status get https://localhost:8443/fineract-provider/actuator/health && (( $(http --verify=no --timeout 30 --check-status --body get https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 )) + - ./gradlew --console=plain -q licenseMain licenseTest licenseIntegrationTest check && ./gradlew --console=plain integrationTest --fail-fast && sudo service mysql stop && docker-compose build && docker-compose up -d && sleep 60s && http --verify=no --timeout 240 --check-status get https://localhost:8443/fineract-provider/actuator/health && (( $(http --verify=no --timeout 30 --check-status --body get https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 )) # We stop the mysql system service when running the Docker test to avoid port 3306 conflicts (unless we run the mysql in docker-compose on another port; req. FINERACT-773) # The fany /actuator/info test makes sure that has more than 100 characters of JSON to test that the git.properties worked (see FINERACT-983) diff --git a/Dockerfile b/Dockerfile index 4b411643b..fa32a21d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get update -qq && apt-get install -y wget COPY . fineract WORKDIR /fineract -RUN ./gradlew --no-daemon -x rat -x test bootJar +RUN ./gradlew --no-daemon -q -x rat -x test bootJar WORKDIR /fineract/target RUN jar -xf /fineract/build/libs/fineract-provider.jar @@ -33,7 +33,7 @@ RUN jar -xf /fineract/build/libs/fineract-provider.jar # allowing implementations to switch the driver used by changing start-up parameters (for both tenants and each tenant DB) # The commented out lines in the docker-compose.yml illustrate how to do this. WORKDIR /fineract/target/BOOT-INF/lib -RUN wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.20/mysql-connector-java-8.0.20.jar +RUN wget -q https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.20/mysql-connector-java-8.0.20.jar # ========================================= diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 1723001ae..f6e1a4cfd 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -102,7 +102,7 @@ dependencyManagement { dependency 'com.jayway.jsonpath:json-path:2.4.0' dependency 'org.apache.tika:tika-core:1.24.1' dependency 'org.apache.httpcomponents:httpclient:4.5.12' - dependency 'io.swagger:swagger-jersey-jaxrs:1.6.1' + dependency 'io.swagger.core.v3:swagger-annotations:2.1.2' dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4' dependency 'jakarta.jms:jakarta.jms-api:2.0.3' dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' @@ -179,6 +179,8 @@ eclipse } } +System.setProperty("openjpa.Log", "commons") + openjpa { includes = ['**/AbstractPersistableCustom.class', '**/domain/*.class'] enhance { @@ -189,6 +191,7 @@ openjpa { // Configuration for Swagger documentation generation task // https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin resolve { + logging.captureStandardOutput LogLevel.INFO outputFileName = 'fineract' outputFormat = 'JSON' prettyPrint = 'TRUE' @@ -626,6 +629,7 @@ cargoRunLocal.dependsOn bootWar cargoStartLocal.dependsOn bootWar cargoStartLocal.mustRunAfter "integrationTestClasses" cargoStartLocal.mustRunAfter "enhance" +cargoStartLocal.mustRunAfter "resolve" /* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */ sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 911e224c4..3fa3e44ab 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -76,11 +76,9 @@ dependencies { 'javax.cache:cache-api', - 'com.github.spotbugs:spotbugs-annotations' + 'com.github.spotbugs:spotbugs-annotations', + 'io.swagger.core.v3:swagger-annotations' ) - implementation ('io.swagger:swagger-jersey-jaxrs') { - exclude group: 'javax.validation' - } implementation ('org.apache.activemq:activemq-broker') { exclude group: 'org.apache.geronimo.specs' } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResource.java index 073ec0826..906a59fa9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResource.java @@ -18,15 +18,12 @@ */ package org.apache.fineract.accounting.accrual.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -44,9 +41,7 @@ import org.springframework.stereotype.Component; @Path("/runaccruals") @Component @Scope("singleton") -@Api(tags = { "Periodic Accrual Accounting" }) -@SwaggerDefinition(tags = { - @Tag(name = "Periodic Accrual Accounting", description = "Periodic Accrual is to accrue the loan income till the specific date or till batch job scheduled time.\n") }) +@Tag(name = "Periodic Accrual Accounting", description = "Periodic Accrual is to accrue the loan income till the specific date or till batch job scheduled time.\n") public class AccrualAccountingApiResource { private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService; @@ -63,13 +58,11 @@ public class AccrualAccountingApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Executes Periodic Accrual Accounting", httpMethod = "POST", notes = "Mandatory Fields\n" + "\n" + "tillDate\n") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", required = true, type = "body", dataTypeClass = AccrualAccountingApiResourceSwagger.PostRunaccrualsRequest.class, value = "Request Body\n" - + "\n" + "Field Descriptions: \n" + "tillDate: \n" - + "which specifies periodic accruals should happen till the given Date") }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) - public String executePeriodicAccrualAccounting(@ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(summary = "Executes Periodic Accrual Accounting", method = "POST", description = "Mandatory Fields\n" + "\n" + "tillDate\n") + @Parameter(required = true, schema = @Schema(implementation = AccrualAccountingApiResourceSwagger.PostRunaccrualsRequest.class, description = "Request Body\n" + + "\n" + "Field Descriptions: \n" + "tillDate: \n" + "which specifies periodic accruals should happen till the given Date")) + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + public String executePeriodicAccrualAccounting(@Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().excuteAccrualAccounting().withJson(jsonRequestBody).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResourceSwagger.java index 3b1b3e41e..c18a55b90 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.accrual.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 24/7/17. @@ -30,18 +29,18 @@ final class AccrualAccountingApiResourceSwagger { // don't allow to instantiate; use only for live API documentation } - @ApiModel(value = "runaccrualsRequest") + @Schema(description = "runaccrualsRequest") public static final class PostRunaccrualsRequest { private PostRunaccrualsRequest() { // don't allow to instantiate; use only for live API documentation } - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "04 June 2014", notes = "which specifies periodic accruals should happen till the given Date", required = true) + @Schema(example = "04 June 2014", description = "which specifies periodic accruals should happen till the given Date", required = true) public String tillDate; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java index 33ca125e8..3d13cb441 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.accounting.closure.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -61,12 +61,11 @@ import org.springframework.stereotype.Component; @Path("/glclosures") @Component @Scope("singleton") -@Api(tags = { "Accounting Closure" }) -@SwaggerDefinition(tags = { - @Tag(name = "Accounting Closure", description = "An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date\n" - + "\n" + "Field Descriptions\n" + "closingDate\n" + "The date for which the accounting closure is defined\n" + "officeId\n" - + "The identifer of the branch for which accounting has been closed\n" + "comments\n" - + "Description associated with an Accounting closure") }) +@Tag(name = "Accounting Closure", description = "An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date\n" + + "\n" + "Field Descriptions\n" + "closingDate\n" + "The date for which the accounting closure is defined\n" + "officeId\n" + + "The identifer of the branch for which accounting has been closed\n" + "comments\n" + + "Description associated with an Accounting closure") + public class GLClosuresApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -98,11 +97,11 @@ public class GLClosuresApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Accounting closures", notes = "Example Requests:\n" + "\n" + "glclosures") + @Operation(summary = "List Accounting closures", description = "Example Requests:\n" + "\n" + "glclosures") @ApiResponses({ - @ApiResponse(code = 200, response = GLClosuresApiResourceSwagger.GetGlClosureResponse.class, message = "", responseContainer = "list") }) + @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class, description = "")))) }) public String retrieveAllClosures(@Context final UriInfo uriInfo, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId) { + @QueryParam("officeId") @Parameter(name = "officeId") final Long officeId) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); final List glClosureDatas = this.glClosureReadPlatformService.retrieveAllGLClosures(officeId); @@ -115,10 +114,11 @@ public class GLClosuresApiResource { @Path("{glClosureId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve an Accounting Closure", notes = "Example Requests:\n" + "\n" + "glclosures/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve an Accounting Closure", description = "Example Requests:\n" + "\n" + "glclosures/1\n" + "\n" + "\n" + "/glclosures/1?fields=officeName,closingDate") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.GetGlClosureResponse.class) }) - public String retreiveClosure(@PathParam("glClosureId") @ApiParam(value = "glClosureId") final Long glClosureId, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))) }) + public String retreiveClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -137,11 +137,11 @@ public class GLClosuresApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create an Accounting Closure", notes = "Mandatory Fields\n" + "officeId,closingDate") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", required = true, type = "body", dataTypeClass = GLClosuresApiResourceSwagger.PostGlClosuresRequest.class, value = "Request Body") }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.PostGlClosuresResponse.class) }) - public String createGLClosure(@ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(summary = "Create an Accounting Closure", description = "Mandatory Fields\n" + "officeId,closingDate") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PostGlClosuresRequest.class, description = "Request Body"))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PostGlClosuresResponse.class))) }) + public String createGLClosure(@Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createGLClosure().withJson(jsonRequestBody).build(); @@ -154,12 +154,12 @@ public class GLClosuresApiResource { @Path("{glClosureId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update an Accounting closure", notes = "Once an accounting closure is created, only the comments associated with it may be edited") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "Request body", dataType = "body", dataTypeClass = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class, required = true) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class) }) - public String updateGLClosure(@PathParam("glClosureId") @ApiParam(value = "glClosureId") final Long glClosureId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited") + @RequestBody(content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class, required = true))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class))) }) + public String updateGLClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLClosure(glClosureId).withJson(jsonRequestBody).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); @@ -171,9 +171,10 @@ public class GLClosuresApiResource { @Path("{glClosureId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete an accounting closure", notes = "Note: Only the latest accounting closure associated with a branch may be deleted.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class) }) - public String deleteGLClosure(@PathParam("glClosureId") @ApiParam(value = "glclosureId") final Long glClosureId) { + @Operation(summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class))) }) + public String deleteGLClosure(@PathParam("glClosureId") @Parameter(description = "glclosureId") final Long glClosureId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLClosure(glClosureId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java index 99345a13c..781085864 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.closure.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.joda.time.LocalDate; final class GLClosuresApiResourceSwagger { @@ -33,108 +32,108 @@ final class GLClosuresApiResourceSwagger { */ // Check !! - @ApiModel(value = "GetGLClosureResponse") + @Schema(description = "GetGLClosureResponse") public static final class GetGlClosureResponse { private GetGlClosureResponse() { // dont allow to initiatiate } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Long id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "2013,1,2") + @Schema(example = "2013,1,2") public LocalDate closingDate; - @ApiModelProperty(example = "false") + @Schema(example = "false") public boolean deleted; - @ApiModelProperty(example = "2013,1,3") + @Schema(example = "2013,1,3") public LocalDate createdDate; - @ApiModelProperty(example = "2013,1,3") + @Schema(example = "2013,1,3") public LocalDate lastUpdatedDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long createdByUserId; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdByUsername; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long lastUpdatedByUserId; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String lastUpdatedByUsername; - @ApiModelProperty(example = "closed") + @Schema(example = "closed") public String comments; } - @ApiModel(value = "PostGLCLosuresRequest") + @Schema(description = "PostGLCLosuresRequest") public static final class PostGlClosuresRequest { private PostGlClosuresRequest() { // don't allow to instantiate; use only for live API documentation } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "06 December 2012") + @Schema(example = "06 December 2012") public LocalDate closingDate; - @ApiModelProperty(example = "The accountants are heading for a carribean vacation") + @Schema(example = "The accountants are heading for a carribean vacation") public String comments; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; } - @ApiModel(value = "PostGlClosuresResponse") + @Schema(description = "PostGlClosuresResponse") public static final class PostGlClosuresResponse { private PostGlClosuresResponse() { // don't allow to instantiate; use only for live API documentation } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "9") + @Schema(example = "9") public Long resourceId; } - @ApiModel(value = "PutGlClosuresRequest") + @Schema(description = "PutGlClosuresRequest") public static final class PutGlClosuresRequest { private PutGlClosuresRequest() { // don't allow to instantiate; use only for live API documentation } - @ApiModelProperty(example = "All transactions verified by Johnny Cash") + @Schema(example = "All transactions verified by Johnny Cash") public String comments; } - @ApiModel(value = "PutGlClosuresResponse") + @Schema(description = "PutGlClosuresResponse") public static final class PutGlClosuresResponse { private PutGlClosuresResponse() { // don't allow to instantiate; use only for live API documentation } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "9") + @Schema(example = "9") public Long resourceId; - @ApiModelProperty(example = "All transactions verified by Johnny Cash") + @Schema(example = "All transactions verified by Johnny Cash") public String comments; } - @ApiModel(value = "DeleteGlClosuresResponse") + @Schema(description = "DeleteGlClosuresResponse") public static final class DeleteGlClosuresResponse { private DeleteGlClosuresResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "9") + @Schema(example = "9") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java index 4fd498cbc..5aa7cd6ea 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.accounting.financialactivityaccount.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -56,11 +56,9 @@ import org.springframework.stereotype.Component; @Path("/financialactivityaccounts") @Component @Scope("singleton") -@Api(tags = { "Mapping Financial Activities to Accounts" }) -@SwaggerDefinition(tags = { - @Tag(name = "Mapping Financial Activities to Accounts", description = "Organization Level Financial Activities like Asset and Liability Transfer can be mapped to GL Account. Integrated accounting takes these accounts into consideration when an Account transfer is made between a savings to loan/savings account and vice-versa\n" - + "\n" + "Field Descriptions\n" + "financialActivityId\n" + "The identifier of the Financial Activity\n" + "glAccountId\n" - + "The identifier of a GL Account ( Ledger Account) which shall be used as the default account for the selected Financial Activity") }) +@Tag(name = "Mapping Financial Activities to Accounts", description = "Organization Level Financial Activities like Asset and Liability Transfer can be mapped to GL Account. Integrated accounting takes these accounts into consideration when an Account transfer is made between a savings to loan/savings account and vice-versa\n" + + "\n" + "Field Descriptions\n" + "financialActivityId\n" + "The identifier of the Financial Activity\n" + "glAccountId\n" + + "The identifier of a GL Account ( Ledger Account) which shall be used as the default account for the selected Financial Activity") public class FinancialActivityAccountsApiResource { private final FinancialActivityAccountReadPlatformService financialActivityAccountReadPlatformService; @@ -101,10 +99,10 @@ public class FinancialActivityAccountsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Financial Activities to Accounts Mappings", notes = "Example Requests:\n" + "\n" + @Operation(summary = "List Financial Activities to Accounts Mappings", description = "Example Requests:\n" + "\n" + "financialactivityaccounts") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.resourceNameForPermission); @@ -119,11 +117,12 @@ public class FinancialActivityAccountsApiResource { @Path("{mappingId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Financial Activity to Account Mapping\n", notes = "Example Requests:\n" + "\n" + @Operation(summary = "Retrieve a Financial Activity to Account Mapping\n", description = "Example Requests:\n" + "\n" + "financialactivityaccounts/1") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class) }) - public String retreive(@PathParam("mappingId") @ApiParam(value = "mappingId") final Long mappingId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.GetFinancialActivityAccountsResponse.class))) }) + public String retreive(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(FinancialActivityAccountsConstants.resourceNameForPermission); @@ -141,13 +140,12 @@ public class FinancialActivityAccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a new Financial Activity to Accounts Mapping", notes = "Mandatory Fields\n" + @Operation(summary = "Create a new Financial Activity to Accounts Mapping", description = "Mandatory Fields\n" + "financialActivityId, glAccountId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "Request body", paramType = "body", dataType = "body", dataTypeClass = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class) }) + @RequestBody(content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsResponse.class) }) - public String createGLAccount(@ApiParam(hidden = true) final String jsonRequestBody) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsResponse.class))) }) + public String createGLAccount(@Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createOfficeToGLAccountMapping().withJson(jsonRequestBody) .build(); @@ -161,13 +159,12 @@ public class FinancialActivityAccountsApiResource { @Path("{mappingId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Financial Activity to Account Mapping", notes = "the API updates the Ledger account linked to a Financial Activity \n") - @ApiImplicitParams({ - @ApiImplicitParam(value = "Request body", dataType = "body", paramType = "body", dataTypeClass = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class) }) + @Operation(summary = "Update a Financial Activity to Account Mapping", description = "the API updates the Ledger account linked to a Financial Activity \n") + @RequestBody(content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = FinancialActivityAccountsApiResourceSwagger.PutFinancialActivityAccountsResponse.class) }) - public String updateGLAccount(@PathParam("mappingId") @ApiParam(value = "mappingId") final Long mappingId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PutFinancialActivityAccountsResponse.class))) }) + public String updateGLAccount(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateOfficeToGLAccountMapping(mappingId) .withJson(jsonRequestBody).build(); @@ -181,10 +178,10 @@ public class FinancialActivityAccountsApiResource { @Path("{mappingId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Financial Activity to Account Mapping") + @Operation(summary = "Delete a Financial Activity to Account Mapping") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FinancialActivityAccountsApiResourceSwagger.DeleteFinancialActivityAccountsResponse.class) }) - public String deleteGLAccount(@PathParam("mappingId") @ApiParam(value = "mappingId") final Long mappingId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.DeleteFinancialActivityAccountsResponse.class))) }) + public String deleteGLAccount(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteOfficeToGLAccountMapping(mappingId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResourceSwagger.java index 44a8b4b0a..2b0f9e984 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.financialactivityaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.apache.fineract.accounting.financialactivityaccount.data.FinancialActivityData; import org.apache.fineract.accounting.glaccount.data.GLAccountData; @@ -30,58 +29,58 @@ final class FinancialActivityAccountsApiResourceSwagger { private FinancialActivityAccountsApiResourceSwagger() {} - @ApiModel(value = "GetFinancialActivityAccountsResponse") + @Schema(description = "GetFinancialActivityAccountsResponse") public static final class GetFinancialActivityAccountsResponse { private GetFinancialActivityAccountsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; public FinancialActivityData financialActivityData; public GLAccountData glAccountData; } - @ApiModel(value = "PostFinancialActivityAccountsRequest") + @Schema(description = "PostFinancialActivityAccountsRequest") public static final class PostFinancialActivityAccountsRequest { private PostFinancialActivityAccountsRequest() { } - @ApiModelProperty(example = "200") + @Schema(example = "200") public Long financialActivityId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long glAccountId; } - @ApiModel(value = "PostFinancialActivityAccountsResponse") + @Schema(description = "PostFinancialActivityAccountsResponse") public static final class PostFinancialActivityAccountsResponse { private PostFinancialActivityAccountsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PutFinancialActivityAccountsRequest") + @Schema(description = "PutFinancialActivityAccountsRequest") public static final class PutFinancialActivityAccountsRequest { private PutFinancialActivityAccountsRequest() { } - @ApiModelProperty(example = "200") + @Schema(example = "200") public Long financialActivityId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long glAccountId; } - @ApiModel(value = "PutFinancialActivityAccountsResponse") + @Schema(description = "PutFinancialActivityAccountsResponse") public static final class PutFinancialActivityAccountsResponse { private PutFinancialActivityAccountsResponse() { @@ -92,23 +91,23 @@ final class FinancialActivityAccountsApiResourceSwagger { private PutFinancialActivityAccountscommentsSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long glAccountId; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutFinancialActivityAccountscommentsSwagger comments; } - @ApiModel(value = "DeleteFinancialActivityAccountsResponse") + @Schema(description = "DeleteFinancialActivityAccountsResponse") public static final class DeleteFinancialActivityAccountsResponse { private DeleteFinancialActivityAccountsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java index e0491d364..00504471a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java @@ -20,15 +20,15 @@ package org.apache.fineract.accounting.glaccount.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -75,10 +75,8 @@ import org.springframework.stereotype.Component; @Path("/glaccounts") @Component @Scope("singleton") -@Api(tags = { "General Ledger Account" }) -@SwaggerDefinition(tags = { - @Tag(name = "General Ledger Account", description = "Ledger accounts represent an Individual account within an Organizations Chart Of Accounts(COA) and are assigned a name and unique number by which they can be identified. \n" - + "All transactions relating to a company's assets, liabilities, owners' equity, revenue and expenses are recorded against these accounts") }) +@Tag(name = "General Ledger Account", description = "Ledger accounts represent an Individual account within an Organizations Chart Of Accounts(COA) and are assigned a name and unique number by which they can be identified. \n" + + "All transactions relating to a company's assets, liabilities, owners' equity, revenue and expenses are recorded against these accounts") public class GLAccountsApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "parentId", "glCode", "disabled", @@ -121,13 +119,15 @@ public class GLAccountsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve GL Accounts Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "glaccounts/template\n" - + "glaccounts/template?type=1\n" + "\n" + "type is optional and integer value from 1 to 5.\n" + "\n" + "1.Assets \n" - + "2.Liabilities \n" + "3.Equity \n" + "4.Income \n" + "5.Expenses") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.GetGLAccountsTemplateResponse.class) }) + @Operation(tags = { + "General Ledger Account" }, summary = "Retrieve GL Accounts Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "glaccounts/template\n" + + "glaccounts/template?type=1\n" + "\n" + "type is optional and integer value from 1 to 5.\n" + "\n" + "1.Assets \n" + + "2.Liabilities \n" + "3.Equity \n" + "4.Income \n" + "5.Expenses") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.GetGLAccountsTemplateResponse.class))) }) public String retrieveNewAccountDetails(@Context final UriInfo uriInfo, - @QueryParam("type") @ApiParam(value = "type") final Integer type) { + @QueryParam("type") @Parameter(description = "type") final Integer type) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -141,18 +141,19 @@ public class GLAccountsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List General Ledger Accounts", notes = "ARGUMENTS\n" + @Operation(tags = { "General Ledger Account" }, summary = "List General Ledger Accounts", description = "ARGUMENTS\n" + "type Integer optional manualEntriesAllowed boolean optional usage Integer optional disabled boolean optional parentId Long optional tagId Long optional\n" + "Example Requests:\n" + "\n" + "glaccounts\n" + "\n" + "\n" + "glaccounts?type=1&manualEntriesAllowed=true&usage=1&disabled=false\n" + "\n" + "glaccounts?fetchRunningBalance=true") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class, responseContainer = "list") }) - public String retrieveAllAccounts(@Context final UriInfo uriInfo, @QueryParam("type") @ApiParam(value = "type") final Integer type, - @QueryParam("searchParam") @ApiParam(value = "searchParam") final String searchParam, - @QueryParam("usage") @ApiParam(value = "usage") final Integer usage, - @QueryParam("manualEntriesAllowed") @ApiParam(value = "manualEntriesAllowed") final Boolean manualEntriesAllowed, - @QueryParam("disabled") @ApiParam(value = "disabled") final Boolean disabled, - @QueryParam("fetchRunningBalance") @ApiParam(value = "fetchRunningBalance") final boolean runningBalance) { + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class)))) }) + public String retrieveAllAccounts(@Context final UriInfo uriInfo, + @QueryParam("type") @Parameter(description = "type") final Integer type, + @QueryParam("searchParam") @Parameter(description = "searchParam") final String searchParam, + @QueryParam("usage") @Parameter(description = "usage") final Integer usage, + @QueryParam("manualEntriesAllowed") @Parameter(description = "manualEntriesAllowed") final Boolean manualEntriesAllowed, + @QueryParam("disabled") @Parameter(description = "disabled") final Boolean disabled, + @QueryParam("fetchRunningBalance") @Parameter(description = "fetchRunningBalance") final boolean runningBalance) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(false, runningBalance); @@ -167,13 +168,14 @@ public class GLAccountsApiResource { @Path("{glAccountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a General Ledger Account", notes = "Example Requests:\n" + "\n" + "glaccounts/1\n" + "\n" + "\n" - + "glaccounts/1?template=true\n" + "\n" + "\n" + "glaccounts/1?fields=name,glCode\n" + "\n" + "\n" - + "glaccounts/1?fetchRunningBalance=true") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class) }) - public String retreiveAccount(@PathParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId, + @Operation(tags = { "General Ledger Account" }, summary = "Retrieve a General Ledger Account", description = "Example Requests:\n" + + "\n" + "glaccounts/1\n" + "\n" + "\n" + "glaccounts/1?template=true\n" + "\n" + "\n" + "glaccounts/1?fields=name,glCode\n" + + "\n" + "\n" + "glaccounts/1?fetchRunningBalance=true") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.GetGLAccountsResponse.class))) }) + public String retreiveAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId, @Context final UriInfo uriInfo, - @QueryParam("fetchRunningBalance") @ApiParam(value = "fetchRunningBalance") final boolean runningBalance) { + @QueryParam("fetchRunningBalance") @Parameter(description = "fetchRunningBalance") final boolean runningBalance) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -190,12 +192,13 @@ public class GLAccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a General Ledger Account", notes = "Note: You may optionally create Hierarchical Chart of Accounts by using the \"parentId\" property of an Account\n" - + "Mandatory Fields: \n" + "name, glCode, type, usage and manualEntriesAllowed") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = GLAccountsApiResourceSwagger.PostGLAccountsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.PostGLAccountsResponse.class) }) - public String createGLAccount(@ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(tags = { + "General Ledger Account" }, summary = "Create a General Ledger Account", description = "Note: You may optionally create Hierarchical Chart of Accounts by using the \"parentId\" property of an Account\n" + + "Mandatory Fields: \n" + "name, glCode, type, usage and manualEntriesAllowed") + @RequestBody(content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PostGLAccountsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PostGLAccountsResponse.class))) }) + public String createGLAccount(@Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createGLAccount().withJson(jsonRequestBody).build(); @@ -208,13 +211,14 @@ public class GLAccountsApiResource { @Path("{glAccountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update an Accounting closure", notes = "Once an accounting closure is created, only the comments associated with it may be edited\n" - + "\n") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = GLAccountsApiResourceSwagger.PutGLAccountsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.PutGLAccountsResponse.class) }) - public String updateGLAccount(@PathParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(tags = { + "General Ledger Account" }, summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited\n" + + "\n") + @RequestBody(content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PutGLAccountsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PutGLAccountsResponse.class))) }) + public String updateGLAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLAccount(glAccountId).withJson(jsonRequestBody).build(); @@ -227,9 +231,11 @@ public class GLAccountsApiResource { @Path("{glAccountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete an accounting closure", notes = "Note: Only the latest accounting closure associated with a branch may be deleted.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = GLAccountsApiResourceSwagger.DeleteGLAccountsRequest.class) }) - public String deleteGLAccount(@PathParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId) { + @Operation(tags = { + "General Ledger Account" }, summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.DeleteGLAccountsRequest.class))) }) + public String deleteGLAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLAccount(glAccountId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResourceSwagger.java index d32fc3df7..7a1d54236 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.glaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import java.util.List; import org.apache.fineract.accounting.glaccount.data.GLAccountData; @@ -35,57 +34,57 @@ final class GLAccountsApiResourceSwagger { } - @ApiModel(value = "GetGLAccountsResponse") + @Schema(description = "GetGLAccountsResponse") public static final class GetGLAccountsResponse { private GetGLAccountsResponse() { } - @ApiModelProperty(example = "16") + @Schema(example = "16") public Long id; - @ApiModelProperty(example = "Cash") + @Schema(example = "Cash") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long parentId; - @ApiModelProperty(example = "100001") + @Schema(example = "100001") public String glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public EnumOptionData type; public EnumOptionData usage; - @ApiModelProperty(example = "Desc") + @Schema(example = "Desc") public String description; - @ApiModelProperty(example = "....Cash") + @Schema(example = "....Cash") public String nameDecorated; public CodeValueData tagId; - @ApiModelProperty(example = "118437") + @Schema(example = "118437") public Long organizationRunningBalance; } - @ApiModel(value = "GetGLAccountsTemplateResponse") + @Schema(description = "GetGLAccountsTemplateResponse") public static final class GetGLAccountsTemplateResponse { private GetGLAccountsTemplateResponse() { } - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public EnumOptionData type; @@ -104,83 +103,83 @@ final class GLAccountsApiResourceSwagger { } - @ApiModel(value = "PostGLAccountsRequest") + @Schema(description = "PostGLAccountsRequest") public static final class PostGLAccountsRequest { private PostGLAccountsRequest() { } - @ApiModelProperty(example = "Cash at Bangalore") + @Schema(example = "Cash at Bangalore") public String name; - @ApiModelProperty(example = "100001") + @Schema(example = "100001") public String glCode; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; - @ApiModelProperty(example = "1") + @Schema(example = "1") public String type; - @ApiModelProperty(example = "10") + @Schema(example = "10") public String tagId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long parentId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public EnumOptionData usage; - @ApiModelProperty(example = "Desc") + @Schema(example = "Desc") public String description; } - @ApiModel(value = "PostGLAccountsResponse") + @Schema(description = "PostGLAccountsResponse") public static final class PostGLAccountsResponse { private PostGLAccountsResponse() { } - @ApiModelProperty(example = "22") + @Schema(example = "22") public int resourceId; } - @ApiModel(value = "PutGLAccountsRequest") + @Schema(description = "PutGLAccountsRequest") public static final class PutGLAccountsRequest { private PutGLAccountsRequest() { } - @ApiModelProperty(example = "Cash at Bangalore") + @Schema(example = "Cash at Bangalore") public String name; } - @ApiModel(value = "PutGLAccountsResponse") + @Schema(description = "PutGLAccountsResponse") public static final class PutGLAccountsResponse { private PutGLAccountsResponse() { } - @ApiModel + @Schema public static final class PutGLAccountsResponsechangesSwagger { private PutGLAccountsResponsechangesSwagger() {} - @ApiModelProperty(example = "Cash at Bangalore") + @Schema(example = "Cash at Bangalore") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public int resourceId; public PutGLAccountsResponsechangesSwagger changes; } - @ApiModel(value = "DeleteGLAccountsRequest") + @Schema(description = "DeleteGLAccountsRequest") public static final class DeleteGLAccountsRequest { private DeleteGLAccountsRequest() { @@ -193,7 +192,7 @@ final class GLAccountsApiResourceSwagger { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public int resourceId; private DeleteGLAccountsRequestchangesSwagger changes; diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResource.java index ccbe09569..dd6e84d7f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResource.java @@ -20,15 +20,16 @@ package org.apache.fineract.accounting.journalentry.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Date; @@ -73,10 +74,8 @@ import org.springframework.stereotype.Component; @Path("/journalentries") @Component @Scope("singleton") -@Api(tags = { "Journal Entries" }) -@SwaggerDefinition(tags = { - @Tag(name = "Journal Entries", description = "A journal entry refers to the logging of transactions against general ledger accounts. A journal entry may consist of several line items, each of which is either a \"debit\" or a \"credit\". The total amount of the debits must equal the total amount of the credits or the journal entry is said to be \"unbalanced\" \n" - + "\n" + "A journal entry directly changes the account balances on the general ledger") }) +@Tag(name = "Journal Entries", description = "A journal entry refers to the logging of transactions against general ledger accounts. A journal entry may consist of several line items, each of which is either a \"debit\" or a \"credit\". The total amount of the debits must equal the total amount of the credits or the journal entry is said to be \"unbalanced\" \n" + + "\n" + "A journal entry directly changes the account balances on the general ledger") public class JournalEntriesApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -113,30 +112,32 @@ public class JournalEntriesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Journal Entries", notes = "The list capability of journal entries can support pagination and sorting.\n\n" + @Operation(summary = "List Journal Entries", description = "The list capability of journal entries can support pagination and sorting.\n\n" + "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n" + "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n" + "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + "journalentries?offset=10&limit=50\n" + "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n" + "journalentries?runningBalance=true\n" + "\n" + "journalentries?transactionDetails=true\n" + "\n" + "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = JournalEntryData.class, responseContainer = "list") }) - public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @QueryParam("glAccountId") @ApiParam(value = "glAccountId") final Long glAccountId, - @QueryParam("manualEntriesOnly") @ApiParam(value = "manualEntriesOnly") final Boolean onlyManualEntries, - @QueryParam("fromDate") @ApiParam(value = "fromDate") final DateParam fromDateParam, - @QueryParam("toDate") @ApiParam(value = "toDate") final DateParam toDateParam, - @QueryParam("transactionId") @ApiParam(value = "transactionId") final String transactionId, - @QueryParam("entityType") @ApiParam(value = "entityType") final Integer entityType, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("locale") @ApiParam(value = "locale") final String locale, - @QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat, - @QueryParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("savingsId") @ApiParam(value = "savingsId") final Long savingsId, - @QueryParam("runningBalance") @ApiParam(value = "runningBalance") final boolean runningBalance, - @QueryParam("transactionDetails") @ApiParam(value = "transactionDetails") final boolean transactionDetails) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = JournalEntryData.class)))) }) + public String retrieveAll(@Context final UriInfo uriInfo, + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @QueryParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId, + @QueryParam("manualEntriesOnly") @Parameter(description = "manualEntriesOnly") final Boolean onlyManualEntries, + @QueryParam("fromDate") @Parameter(description = "fromDate") final DateParam fromDateParam, + @QueryParam("toDate") @Parameter(description = "toDate") final DateParam toDateParam, + @QueryParam("transactionId") @Parameter(description = "transactionId") final String transactionId, + @QueryParam("entityType") @Parameter(description = "entityType") final Integer entityType, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("locale") @Parameter(description = "locale") final String locale, + @QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat, + @QueryParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("savingsId") @Parameter(description = "savingsId") final Long savingsId, + @QueryParam("runningBalance") @Parameter(description = "runningBalance") final boolean runningBalance, + @QueryParam("transactionDetails") @Parameter(description = "transactionDetails") final boolean transactionDetails) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -164,13 +165,16 @@ public class JournalEntriesApiResource { @Path("{journalEntryId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a single Entry", notes = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n" + @Operation(summary = "Retrieve a single Entry", description = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n" + "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + "journalentries/1?runningBalance=true\n" + "\n" + "journalentries/1?transactionDetails=true") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = JournalEntryData.class) }) - public String retreiveJournalEntryById(@PathParam("journalEntryId") @ApiParam(value = "journalEntryId") final Long journalEntryId, - @Context final UriInfo uriInfo, @QueryParam("runningBalance") @ApiParam(value = "runningBalance") final boolean runningBalance, - @QueryParam("transactionDetails") @ApiParam(value = "transactionDetails") final boolean transactionDetails) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = JournalEntryData.class))) }) + public String retreiveJournalEntryById( + @PathParam("journalEntryId") @Parameter(description = "journalEntryId") final Long journalEntryId, + @Context final UriInfo uriInfo, + @QueryParam("runningBalance") @Parameter(description = "runningBalance") final boolean runningBalance, + @QueryParam("transactionDetails") @Parameter(description = "transactionDetails") final boolean transactionDetails) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData(transactionDetails, @@ -185,16 +189,16 @@ public class JournalEntriesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create \"Balanced\" Journal Entries", notes = "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \n" + @Operation(summary = "Create \"Balanced\" Journal Entries", description = "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \n" + "Compound Journal entries may have \"n\" debits and \"m\" credits where both \"m\" and \"n\" are greater than 0 and the net sum or all debits and credits are equal \n\n" + "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n " + "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n" + "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = JournalEntryCommand.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = JournalEntriesApiResourceSwagger.PostJournalEntriesResponse.class) }) - public String createGLJournalEntry(@ApiParam(hidden = true) final String jsonRequestBody, - @QueryParam("command") @ApiParam(value = "command") final String commandParam) { + @Parameters({ @Parameter(content = @Content(schema = @Schema(implementation = JournalEntryCommand.class))) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesResponse.class))) }) + public String createGLJournalEntry(@Parameter(hidden = true) final String jsonRequestBody, + @QueryParam("command") @Parameter(description = "command") final String commandParam) { CommandProcessingResult result = null; if (is(commandParam, "updateRunningBalance")) { @@ -216,15 +220,14 @@ public class JournalEntriesApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Running balances for Journal Entries", notes = "This API calculates the running balances for office. If office ID not provided this API calculates running balances for all offices. \n" + @Operation(summary = "Update Running balances for Journal Entries", description = "This API calculates the running balances for office. If office ID not provided this API calculates running balances for all offices. \n" + "Mandatory Fields\n" + "officeId") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class) }) + @RequestBody(content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class) }) - public String createReversalJournalEntry(@ApiParam(hidden = true) final String jsonRequestBody, - @PathParam("transactionId") @ApiParam(value = "transactionId") final String transactionId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class))) }) + public String createReversalJournalEntry(@Parameter(hidden = true) final String jsonRequestBody, + @PathParam("transactionId") @Parameter(description = "transactionId") final String transactionId, + @QueryParam("command") @Parameter(description = "command") final String commandParam) { CommandProcessingResult result = null; if (is(commandParam, "reverse")) { final CommandWrapper commandRequest = new CommandWrapperBuilder().reverseJournalEntry(transactionId).withJson(jsonRequestBody) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResourceSwagger.java index 86b09db53..a1cea3d0b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.journalentry.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 25/7/17. @@ -28,39 +27,39 @@ final class JournalEntriesApiResourceSwagger { private JournalEntriesApiResourceSwagger() {} - @ApiModel(value = "PostJournalEntriesResponse") + @Schema(description = "PostJournalEntriesResponse") public static final class PostJournalEntriesResponse { private PostJournalEntriesResponse() { } - @ApiModelProperty(value = "1") + @Schema(description = "1") public Long officeId; - @ApiModelProperty(value = "RS9MCISID4WK1ZM") + @Schema(description = "RS9MCISID4WK1ZM") public String transactionId; } - @ApiModel(value = "PostJournalEntriesTransactionIdRequest") + @Schema(description = "PostJournalEntriesTransactionIdRequest") public static final class PostJournalEntriesTransactionIdRequest { private PostJournalEntriesTransactionIdRequest() { } - @ApiModelProperty(value = "1") + @Schema(description = "1") public Long officeId; } - @ApiModel(value = "PostJournalEntriesTransactionIdResponse") + @Schema(description = "PostJournalEntriesTransactionIdResponse") public static final class PostJournalEntriesTransactionIdResponse { private PostJournalEntriesTransactionIdResponse() { } - @ApiModelProperty(value = "1") + @Schema(description = "1") public Long officeId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java index 205254422..3ee7f4734 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.accounting.provisioning.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -62,11 +62,9 @@ import org.springframework.stereotype.Component; @Path("/provisioningentries") @Component @Scope("singleton") -@Api(tags = { "Provisioning Entries" }) -@SwaggerDefinition(tags = { - @Tag(name = "Provisioning Entries", description = "This defines the Provisioning Entries for all active loan products\n" + "\n" - + "Field Descriptions\n" + "date\n" + "Date on which day provisioning entries should be created\n" - + "createjournalentries\n" + "Boolean variable whether to add journal entries for generated provisioning entries\n") }) +@Tag(name = "Provisioning Entries", description = "This defines the Provisioning Entries for all active loan products\n" + "\n" + + "Field Descriptions\n" + "date\n" + "Date on which day provisioning entries should be created\n" + "createjournalentries\n" + + "Boolean variable whether to add journal entries for generated provisioning entries\n") public class ProvisioningEntriesApiResource { private final PlatformSecurityContext platformSecurityContext; @@ -97,13 +95,12 @@ public class ProvisioningEntriesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create new Provisioning Entries", notes = "Creates a new Provisioning Entries\n" + "\n" + "Mandatory Fields\n" - + "date\n" + "dateFormat\n" + "locale\n" + "Optional Fields\n" + "createjournalentries") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesRequest.class) }) + @Operation(summary = "Create new Provisioning Entries", description = "Creates a new Provisioning Entries\n" + "\n" + + "Mandatory Fields\n" + "date\n" + "dateFormat\n" + "locale\n" + "Optional Fields\n" + "createjournalentries") + @RequestBody(content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesResponse.class) }) - public String createProvisioningEntries(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PostProvisioningEntriesResponse.class))) }) + public String createProvisioningEntries(@Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = null; this.platformSecurityContext.authenticatedUser(); commandWrapper = new CommandWrapperBuilder().createProvisioningEntries().withJson(apiRequestBodyAsJson).build(); @@ -115,14 +112,13 @@ public class ProvisioningEntriesApiResource { @Path("{entryId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Recreates Provisioning Entry", notes = "Recreates Provisioning Entry | createjournalentry.") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesRequest.class) }) + @Operation(summary = "Recreates Provisioning Entry", description = "Recreates Provisioning Entry | createjournalentry.") + @RequestBody(content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesResponse.class) }) - public String modifyProvisioningEntry(@PathParam("entryId") @ApiParam(value = "entryId") final Long entryId, - @QueryParam("command") @ApiParam(value = "command=createjournalentry\ncommand=recreateprovisioningentry") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningEntriesApiResourceSwagger.PutProvisioningEntriesResponse.class))) }) + public String modifyProvisioningEntry(@PathParam("entryId") @Parameter(description = "entryId") final Long entryId, + @QueryParam("command") @Parameter(description = "command=createjournalentry\ncommand=recreateprovisioningentry") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = null; this.platformSecurityContext.authenticatedUser(); if ("createjournalentry".equals(commandParam)) { @@ -143,9 +139,10 @@ public class ProvisioningEntriesApiResource { @Path("{entryId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieves a Provisioning Entry", notes = "Returns the details of a generated Provisioning Entry.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ProvisioningEntryData.class) }) - public String retrieveProvisioningEntry(@PathParam("entryId") @ApiParam(value = "entryId") final Long entryId, + @Operation(summary = "Retrieves a Provisioning Entry", description = "Returns the details of a generated Provisioning Entry.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningEntryData.class))) }) + public String retrieveProvisioningEntry(@PathParam("entryId") @Parameter(description = "entryId") final Long entryId, @Context final UriInfo uriInfo) { platformSecurityContext.authenticatedUser(); ProvisioningEntryData data = this.provisioningEntriesReadPlatformService.retrieveProvisioningEntryData(entryId); @@ -157,7 +154,8 @@ public class ProvisioningEntriesApiResource { @Path("entries") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = LoanProductProvisioningEntryData.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = LoanProductProvisioningEntryData.class))) }) public String retrieveProviioningEntries(@QueryParam("entryId") final Long entryId, @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("officeId") final Long officeId, @QueryParam("productId") final Long productId, @QueryParam("categoryId") final Long categoryId, @@ -172,10 +170,11 @@ public class ProvisioningEntriesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List all Provisioning Entries") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ProvisioningEntryData.class, responseContainer = "list") }) - public String retrieveAllProvisioningEntries(@QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, @Context final UriInfo uriInfo) { + @Operation(summary = "List all Provisioning Entries") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProvisioningEntryData.class)))) }) + public String retrieveAllProvisioningEntries(@QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, @Context final UriInfo uriInfo) { platformSecurityContext.authenticatedUser(); Page data = this.provisioningEntriesReadPlatformService.retrieveAllProvisioningEntries(offset, limit); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResourceSwagger.java index 1b413563a..86a139d60 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.provisioning.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 25/7/17. @@ -30,23 +29,23 @@ final class ProvisioningEntriesApiResourceSwagger { // only for Swagger Documentation } - @ApiModel(value = "PostProvisioningEntriesRequest") + @Schema(description = "PostProvisioningEntriesRequest") public static final class PostProvisioningEntriesRequest { private PostProvisioningEntriesRequest() { } - @ApiModelProperty(example = "16 October 2015") + @Schema(example = "16 October 2015") public String date; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "true") + @Schema(example = "true") public String createjournalentries; public String provisioningentry; @@ -54,36 +53,36 @@ final class ProvisioningEntriesApiResourceSwagger { public String entries; } - @ApiModel(value = "PostProvisioningEntriesResponse") + @Schema(description = "PostProvisioningEntriesResponse") public static final class PostProvisioningEntriesResponse { private PostProvisioningEntriesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PutProvisioningEntriesRequest") + @Schema(description = "PutProvisioningEntriesRequest") public static final class PutProvisioningEntriesRequest { private PutProvisioningEntriesRequest() { } - @ApiModelProperty(example = "recreateprovisioningentry") + @Schema(example = "recreateprovisioningentry") public String command; } - @ApiModel(value = "PutProvisioningEntriesResponse") + @Schema(description = "PutProvisioningEntriesResponse") public static final class PutProvisioningEntriesResponse { private PutProvisioningEntriesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java index 3f9570e66..23424b4c9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.accounting.rule.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -73,15 +73,13 @@ import org.springframework.stereotype.Component; @Path("/accountingrules") @Component @Scope("singleton") -@Api(tags = { "Accounting Rules" }) -@SwaggerDefinition(tags = { - @Tag(name = "Accounting Rules", description = "It is typical scenario in MFI's that non accountants pass journal entries on a regular basis. For Ex: A branch office might deposit their entire cash at hand to their Bank account at the end of a working day. The branch office users might not understand enough of accounting to figure out which account needs to get credited and which account needs to be debited to represent this transaction.\n" - + "\n" - + "Enter accounting rules, an abstraction on top of manual Journal entires for enabling simpler data entry. An accounting rule can define any of the following abstractions\n" - + "\n" + "A Simple journal entry where both the credit and debit account have been preselected\n" - + "A Simple journal entry where either credit or debit accounts have been limited to a pre-selected list of accounts (Ex: Debit account should be one of \"Bank of America\" of \"JP Morgan\" and credit account should be \"Cash\")\n" - + "A Compound journal entry where multiple debits and / or multiple credits may be made amongst a set of preselected list of accounts (Ex: Credit account should be either \"Bank Of America\" or \"Cash\" and debit account can be \"Employee Salary\" and/or \"Miscellenous Expenses\")\n" - + "An accounting rule can also be optionally associated with a branch, so that only a particular Branch's users have access to the rule") }) +@Tag(name = "Accounting Rules", description = "It is typical scenario in MFI's that non accountants pass journal entries on a regular basis. For Ex: A branch office might deposit their entire cash at hand to their Bank account at the end of a working day. The branch office users might not understand enough of accounting to figure out which account needs to get credited and which account needs to be debited to represent this transaction.\n" + + "\n" + + "Enter accounting rules, an abstraction on top of manual Journal entires for enabling simpler data entry. An accounting rule can define any of the following abstractions\n" + + "\n" + "A Simple journal entry where both the credit and debit account have been preselected\n" + + "A Simple journal entry where either credit or debit accounts have been limited to a pre-selected list of accounts (Ex: Debit account should be one of \"Bank of America\" of \"JP Morgan\" and credit account should be \"Cash\")\n" + + "A Compound journal entry where multiple debits and / or multiple credits may be made amongst a set of preselected list of accounts (Ex: Credit account should be either \"Bank Of America\" or \"Cash\" and debit account can be \"Employee Salary\" and/or \"Miscellenous Expenses\")\n" + + "An accounting rule can also be optionally associated with a branch, so that only a particular Branch's users have access to the rule") public class AccountingRuleApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -121,10 +119,10 @@ public class AccountingRuleApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Accounting Rule Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Accounting Rule Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "accountingrules/template") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.GetAccountRulesTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.GetAccountRulesTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -139,10 +137,10 @@ public class AccountingRuleApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Accounting Rules", notes = "Returns the list of defined accounting rules.\n" + "\n" + @Operation(summary = "Retrieve Accounting Rules", description = "Returns the list of defined accounting rules.\n" + "\n" + "Example Requests:\n" + "\n" + "accountingrules") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.GetAccountRulesResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.GetAccountRulesResponse.class)))) }) public String retrieveAllAccountingRules(@Context final UriInfo uriInfo) { final AppUser currentUser = this.context.authenticatedUser(); @@ -171,10 +169,12 @@ public class AccountingRuleApiResource { @Path("{accountingRuleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Accounting rule", notes = "Returns the details of a defined Accounting rule.\n" + "\n" + @Operation(summary = "Retrieve a Accounting rule", description = "Returns the details of a defined Accounting rule.\n" + "\n" + "Example Requests:\n" + "\n" + "accountingrules/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = AccountingRuleData.class) }) - public String retreiveAccountingRule(@PathParam("accountingRuleId") @ApiParam(value = "accountingRuleId") final Long accountingRuleId, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleData.class))) }) + public String retreiveAccountingRule( + @PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -191,13 +191,13 @@ public class AccountingRuleApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create/Define a Accounting rule", notes = "Define a new Accounting rule.\n" + "\n" + "Mandatory Fields\n" + @Operation(summary = "Create/Define a Accounting rule", description = "Define a new Accounting rule.\n" + "\n" + "Mandatory Fields\n" + "name, officeId,\n" + "accountToDebit OR debitTags,\n" + "accountToCredit OR creditTags.\n" + "\n" + "Optional Fields\n" + "description") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = AccountingRuleApiResourceSwagger.PostAccountingRulesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.PostAccountingRulesResponse.class) }) - public String createAccountingRule(@ApiParam(hidden = true) final String jsonRequestBody) { + @RequestBody(content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PostAccountingRulesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PostAccountingRulesResponse.class))) }) + public String createAccountingRule(@Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createAccountingRule().withJson(jsonRequestBody).build(); @@ -210,12 +210,13 @@ public class AccountingRuleApiResource { @Path("{accountingRuleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Accounting Rule", notes = "Updates the details of a Accounting rule.") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", value = "body", dataType = "body", dataTypeClass = AccountingRuleApiResourceSwagger.PutAccountingRulesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.PutAccountingRulesResponse.class) }) - public String updateAccountingRule(@PathParam("accountingRuleId") @ApiParam(value = "accountingRuleId") final Long accountingRuleId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(summary = "Update a Accounting Rule", description = "Updates the details of a Accounting rule.") + @RequestBody(content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PutAccountingRulesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.PutAccountingRulesResponse.class))) }) + public String updateAccountingRule( + @PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateAccountingRule(accountingRuleId).withJson(jsonRequestBody) .build(); @@ -228,10 +229,11 @@ public class AccountingRuleApiResource { @Path("{accountingRuleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Accounting Rule", notes = "Deletes a Accounting rule.") + @Operation(summary = "Delete a Accounting Rule", description = "Deletes a Accounting rule.") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountingRuleApiResourceSwagger.DeleteAccountingRulesResponse.class) }) - public String deleteAccountingRule(@PathParam("accountingRuleId") @ApiParam(value = "accountingRuleId") final Long accountingRuleId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountingRuleApiResourceSwagger.DeleteAccountingRulesResponse.class))) }) + public String deleteAccountingRule( + @PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteAccountingRule(accountingRuleId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResourceSwagger.java index a29bb382a..019ff7eda 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.accounting.rule.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; import org.apache.fineract.accounting.glaccount.data.GLAccountData; @@ -35,7 +34,7 @@ final class AccountingRuleApiResourceSwagger { // For Swagger Documentation } - @ApiModel(value = "GetAccountRulesResponse") + @Schema(description = "GetAccountRulesResponse") public static final class GetAccountRulesResponse { private GetAccountRulesResponse() { @@ -54,63 +53,63 @@ final class AccountingRuleApiResourceSwagger { public List debitTags; } - @ApiModel(value = "GetAccountRulesTemplateResponse") + @Schema(description = "GetAccountRulesTemplateResponse") public static final class GetAccountRulesTemplateResponse { private GetAccountRulesTemplateResponse() { } - @ApiModelProperty(example = "false") + @Schema(example = "false") public boolean systemDefined; public List allowedOffices = new ArrayList(); public List allowedAccounts = new ArrayList(); } - @ApiModel(value = "PostAccountingRulesRequest") + @Schema(description = "PostAccountingRulesRequest") public static final class PostAccountingRulesRequest { private PostAccountingRulesRequest() { } - @ApiModelProperty(example = "test") + @Schema(example = "test") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "21") + @Schema(example = "21") public Long accountToDebit; - @ApiModelProperty(example = "9") + @Schema(example = "9") public Long accountToCredit; - @ApiModelProperty(example = "Employee salary") + @Schema(example = "Employee salary") public String description; } - @ApiModel(value = "PostAccountingRulesResponse") + @Schema(description = "PostAccountingRulesResponse") public static final class PostAccountingRulesResponse { private PostAccountingRulesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PutAccountingRulesRequest") + @Schema(description = "PutAccountingRulesRequest") public static final class PutAccountingRulesRequest { private PutAccountingRulesRequest() { } - @ApiModelProperty(example = "Employee Salary posting rule") + @Schema(example = "Employee Salary posting rule") public String name; } - @ApiModel(value = "PutAccountingRulesResponse") + @Schema(description = "PutAccountingRulesResponse") public static final class PutAccountingRulesResponse { private PutAccountingRulesResponse() { @@ -121,23 +120,23 @@ final class AccountingRuleApiResourceSwagger { public PutAccountingRulesResponsechangesSwagger() {} - @ApiModelProperty(example = "Employee Salary posting rule") + @Schema(example = "Employee Salary posting rule") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutAccountingRulesResponsechangesSwagger changes; } - @ApiModel(value = "DeleteAccountingRulesResponse") + @Schema(description = "DeleteAccountingRulesResponse") public static final class DeleteAccountingRulesResponse { private DeleteAccountingRulesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java index 5daf44e6c..ca57e31de 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/api/AdHocApiResource.java @@ -18,10 +18,8 @@ */ package org.apache.fineract.adhocquery.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -54,8 +52,7 @@ import org.springframework.stereotype.Component; @Path("/adhocquery") @Component @Scope("singleton") -@Api(tags = { "AdhocQuery Api" }) -@SwaggerDefinition(tags = { @Tag(name = "AdhocQuery Api", description = "") }) +@Tag(name = "AdhocQuery Api", description = "") public class AdHocApiResource { /** @@ -122,7 +119,7 @@ public class AdHocApiResource { @Path("{adHocId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String retrieveAdHocQuery(@PathParam("adHocId") @ApiParam(value = "adHocId") final Long adHocId, + public String retrieveAdHocQuery(@PathParam("adHocId") @Parameter(description = "adHocId") final Long adHocId, @Context final UriInfo uriInfo) { this.context.authenticatedUser(); @@ -138,7 +135,7 @@ public class AdHocApiResource { @Path("{adHocId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String update(@PathParam("adHocId") @ApiParam(value = "adHocId") final Long adHocId, final String apiRequestBodyAsJson) { + public String update(@PathParam("adHocId") @Parameter(description = "adHocId") final Long adHocId, final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateAdHoc(adHocId) // @@ -160,7 +157,7 @@ public class AdHocApiResource { @Path("{adHocId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String deleteAdHocQuery(@PathParam("adHocId") @ApiParam(value = "adHocId") final Long adHocId) { + public String deleteAdHocQuery(@PathParam("adHocId") @Parameter(description = "adHocId") final Long adHocId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteAdHoc(adHocId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java index 2cf855314..18d47e028 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.batch.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.List; import javax.ws.rs.Consumes; @@ -64,15 +63,13 @@ import org.springframework.stereotype.Component; @Path("/batches") @Component @Scope("singleton") -@Api(tags = { "Batch API" }) -@SwaggerDefinition(tags = { - @Tag(name = "Batch API", description = "The Apache Fineract Batch API enables a consumer to access significant amounts of data in a single call or to make changes to several objects at once. Batching allows a consumer to pass instructions for several operations in a single HTTP request. A consumer can also specify dependencies between related operations. Once all operations have been completed, a consolidated response will be passed back and the HTTP connection will be closed.\n" - + "\n" - + "The Batch API takes in an array of logical HTTP requests represented as JSON arrays - each request has a requestId (the id of a request used to specify the sequence and as a dependency between requests), a method (corresponding to HTTP method GET/PUT/POST/DELETE etc.), a relativeUrl (the portion of the URL after https://example.org/api/v2/), optional headers array (corresponding to HTTP headers), optional reference parameter if a request is dependent on another request and an optional body (for POST and PUT requests). The Batch API returns an array of logical HTTP responses represented as JSON arrays - each response has a requestId, a status code, an optional headers array and an optional body (which is a JSON encoded string).\n" - + "\n" - + "Batch API uses Json Path to handle dependent parameters. For example, if request '2' is referencing request '1' and in the \"body\" or in \"relativeUrl\" of request '2', there is a dependent parameter (which will look like \"$.parameter_name\"), then Batch API will internally substitute this dependent parameter from the response body of request '1'.\n" - + "\n" - + "Batch API is able to handle deeply nested dependent requests as well nested parameters. As shown in the example, requests are dependent on each other as, 1<--2<--6, i.e a nested dependency, where request '6' is not directly dependent on request '1' but still it is one of the nested child of request '1'. In the same way Batch API could handle a deeply nested dependent value, such as {..[..{..,$.parameter_name,..}..]}.") }) +@Tag(name = "Batch API", description = "The Apache Fineract Batch API enables a consumer to access significant amounts of data in a single call or to make changes to several objects at once. Batching allows a consumer to pass instructions for several operations in a single HTTP request. A consumer can also specify dependencies between related operations. Once all operations have been completed, a consolidated response will be passed back and the HTTP connection will be closed.\n" + + "\n" + + "The Batch API takes in an array of logical HTTP requests represented as JSON arrays - each request has a requestId (the id of a request used to specify the sequence and as a dependency between requests), a method (corresponding to HTTP method GET/PUT/POST/DELETE etc.), a relativeUrl (the portion of the URL after https://example.org/api/v2/), optional headers array (corresponding to HTTP headers), optional reference parameter if a request is dependent on another request and an optional body (for POST and PUT requests). The Batch API returns an array of logical HTTP responses represented as JSON arrays - each response has a requestId, a status code, an optional headers array and an optional body (which is a JSON encoded string).\n" + + "\n" + + "Batch API uses Json Path to handle dependent parameters. For example, if request '2' is referencing request '1' and in the \"body\" or in \"relativeUrl\" of request '2', there is a dependent parameter (which will look like \"$.parameter_name\"), then Batch API will internally substitute this dependent parameter from the response body of request '1'.\n" + + "\n" + + "Batch API is able to handle deeply nested dependent requests as well nested parameters. As shown in the example, requests are dependent on each other as, 1<--2<--6, i.e a nested dependency, where request '6' is not directly dependent on request '1' but still it is one of the nested child of request '1'. In the same way Batch API could handle a deeply nested dependent value, such as {..[..{..,$.parameter_name,..}..]}.") public class BatchApiResource { private final PlatformSecurityContext context; @@ -109,15 +106,15 @@ public class BatchApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Batch requests in a single transaction", httpMethod = "POST", notes = "The Apache Fineract Batch API is also capable of executing all the requests in a single transaction, by setting a Query Parameter, \"enclosingTransaction=true\". So, if one or more of the requests in a batch returns an erroneous response all of the Data base transactions made by other successful requests will be rolled back.\n" + @Operation(summary = "Batch requests in a single transaction", description = "The Apache Fineract Batch API is also capable of executing all the requests in a single transaction, by setting a Query Parameter, \"enclosingTransaction=true\". So, if one or more of the requests in a batch returns an erroneous response all of the Data base transactions made by other successful requests will be rolled back.\n" + "\n" + "If there has been a rollback in a transaction then a single response will be provided, with a '400' status code and a body consisting of the error details of the first failed request.") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", dataType = "BatchRequest", required = true, type = "body", dataTypeClass = BatchApiResourceSwagger.PostBatchesRequest.class, value = "request body") }) - @ApiResponses({ @ApiResponse(code = 200, message = "Success", response = BatchResponse.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = BatchApiResourceSwagger.PostBatchesRequest.class, description = "request body"))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Success", content = @Content(schema = @Schema(implementation = BatchResponse.class))) }) public String handleBatchRequests( - @DefaultValue("false") @QueryParam("enclosingTransaction") @ApiParam(value = "enclosingTransaction", defaultValue = "false") final boolean enclosingTransaction, - @ApiParam(hidden = true) final String jsonRequestString, @Context UriInfo uriInfo) { + @DefaultValue("false") @QueryParam("enclosingTransaction") @Parameter(description = "enclosingTransaction", required = false) final boolean enclosingTransaction, + @Parameter(hidden = true) final String jsonRequestString, @Context UriInfo uriInfo) { // Handles user authentication this.context.authenticatedUser(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResourceSwagger.java index c016c3bcc..3d62f1000 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/api/BatchApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.batch.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; import org.apache.fineract.batch.domain.Header; @@ -32,7 +31,7 @@ final class BatchApiResourceSwagger { } - @ApiModel(value = "PostBatchesRequest") + @Schema(description = "PostBatchesRequest") public static final class PostBatchesRequest { private PostBatchesRequest() { @@ -45,35 +44,35 @@ final class BatchApiResourceSwagger { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "\"Petra\"") + @Schema(example = "\"Petra\"") public String firstname; - @ApiModelProperty(example = "\"Yton\"") + @Schema(example = "\"Yton\"") public String lastname; - @ApiModelProperty(example = "\"ex_externalId1\"") + @Schema(example = "\"ex_externalId1\"") public String externalId; - @ApiModelProperty(example = "\"dd MMMM yyyy\"") + @Schema(example = "\"dd MMMM yyyy\"") public String dateFormat; - @ApiModelProperty(example = "\"en\"") + @Schema(example = "\"en\"") public String locale; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean active; - @ApiModelProperty(example = "\"04 March 2009\"") + @Schema(example = "\"04 March 2009\"") public String activationDate; - @ApiModelProperty(example = "\"04 March 2009\"") + @Schema(example = "\"04 March 2009\"") public String submittedOnDate; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long requestId; - @ApiModelProperty(example = "clients") + @Schema(example = "clients") public String relativeUrl; - @ApiModelProperty(example = "POST") + @Schema(example = "POST") public String method; public Set
              headers; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long reference; public PostBodyRequestSwagger body; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java index f5934b934..06e0276c2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.commands.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -55,13 +56,11 @@ import org.springframework.stereotype.Component; @Path("/audits") @Component @Scope("singleton") -@Api(tags = { "Audits" }) -@SwaggerDefinition(tags = { - @Tag(name = "Audits", description = "Every non-read Mifos API request is audited. A fully processed request can not be changed or deleted. See maker checker api for situations where an audit is not fully processed.\n" - + "\n" - + "Permissions: To search and look at audit entries a user needs to be attached to a role that has one of the ALL_FUNCTIONS, ALL_FUNCTIONS_READ or READ_AUDIT permissions.\n" - + "\n" - + "Data Scope: A user can only see audits that are within their data scope. However, 'head office' users can see all audits including those that aren't office/branch related e.g. Loan Product changes.\")") }) +@Tag(name = "Audits", description = "Every non-read Mifos API request is audited. A fully processed request can not be changed or deleted. See maker checker api for situations where an audit is not fully processed.\n" + + "\n" + + "Permissions: To search and look at audit entries a user needs to be attached to a role that has one of the ALL_FUNCTIONS, ALL_FUNCTIONS_READ or READ_AUDIT permissions.\n" + + "\n" + + "Data Scope: A user can only see audits that are within their data scope. However, 'head office' users can see all audits including those that aren't office/branch related e.g. Loan Product changes.\")") public class AuditsApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId", @@ -90,33 +89,33 @@ public class AuditsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Audits", notes = "Get a 200 list of audits that match the criteria supplied and sorted by audit id in descending order, and are within the requestors' data scope. Also it supports pagination and sorting\n" + @Operation(summary = "List Audits", description = "Get a 200 list of audits that match the criteria supplied and sorted by audit id in descending order, and are within the requestors' data scope. Also it supports pagination and sorting\n" + "\n" + "Example Requests:\n" + "\n" + "audits\n" + "\n" + "audits?fields=madeOnDate,maker,processingResult\n" + "\n" + "audits?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n" + "\n" + "audits?officeId=1\n" + "\n" + "audits?officeId=1&includeJson=true") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class)))) }) public String retrieveAuditEntries(@Context final UriInfo uriInfo, - @QueryParam("actionName") @ApiParam(value = "actionName") final String actionName, - @QueryParam("entityName") @ApiParam(value = "entityName") final String entityName, - @QueryParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, - @QueryParam("makerId") @ApiParam(value = "makerId") final Long makerId, - @QueryParam("makerDateTimeFrom") @ApiParam(value = "makerDateTimeFrom") final String makerDateTimeFrom, - @QueryParam("makerDateTimeTo") @ApiParam(value = "makerDateTimeTo") final String makerDateTimeTo, - @QueryParam("checkerId") @ApiParam(value = "checkerId") final Long checkerId, - @QueryParam("checkerDateTimeFrom") @ApiParam(value = "checkerDateTimeFrom") final String checkerDateTimeFrom, - @QueryParam("checkerDateTimeTo") @ApiParam(value = "checkerDateTimeTo") final String checkerDateTimeTo, - @QueryParam("processingResult") @ApiParam(value = "processingResult") final Integer processingResult, - @QueryParam("officeId") @ApiParam(value = "officeId") final Integer officeId, - @QueryParam("groupId") @ApiParam(value = "groupId") final Integer groupId, - @QueryParam("clientId") @ApiParam(value = "clientId") final Integer clientId, - @QueryParam("loanid") @ApiParam(value = "loanid") final Integer loanId, - @QueryParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Integer savingsAccountId, - @QueryParam("paged") @ApiParam(value = "paged") final Boolean paged, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @QueryParam("actionName") @Parameter(description = "actionName") final String actionName, + @QueryParam("entityName") @Parameter(description = "entityName") final String entityName, + @QueryParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, + @QueryParam("makerId") @Parameter(description = "makerId") final Long makerId, + @QueryParam("makerDateTimeFrom") @Parameter(description = "makerDateTimeFrom") final String makerDateTimeFrom, + @QueryParam("makerDateTimeTo") @Parameter(description = "makerDateTimeTo") final String makerDateTimeTo, + @QueryParam("checkerId") @Parameter(description = "checkerId") final Long checkerId, + @QueryParam("checkerDateTimeFrom") @Parameter(description = "checkerDateTimeFrom") final String checkerDateTimeFrom, + @QueryParam("checkerDateTimeTo") @Parameter(description = "checkerDateTimeTo") final String checkerDateTimeTo, + @QueryParam("processingResult") @Parameter(description = "processingResult") final Integer processingResult, + @QueryParam("officeId") @Parameter(description = "officeId") final Integer officeId, + @QueryParam("groupId") @Parameter(description = "groupId") final Integer groupId, + @QueryParam("clientId") @Parameter(description = "clientId") final Integer clientId, + @QueryParam("loanid") @Parameter(description = "loanid") final Integer loanId, + @QueryParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Integer savingsAccountId, + @QueryParam("paged") @Parameter(description = "paged") final Boolean paged, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); final PaginationParameters parameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder); @@ -141,10 +140,11 @@ public class AuditsApiResource { @Path("{auditId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve an Audit Entry", notes = "Example Requests:\n" + "\n" + "audits/20\n" + @Operation(summary = "Retrieve an Audit Entry", description = "Example Requests:\n" + "\n" + "audits/20\n" + "audits/20?fields=madeOnDate,maker,processingResult") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class) }) - public String retrieveAuditEntry(@PathParam("auditId") @ApiParam(value = "auditId") final Long auditId, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class))) }) + public String retrieveAuditEntry(@PathParam("auditId") @Parameter(description = "auditId") final Long auditId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -159,10 +159,10 @@ public class AuditsApiResource { @Path("/searchtemplate") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Audit Search Template", notes = "This is a convenience resource. It can be useful when building an Audit Search UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with.\n" + @Operation(summary = "Audit Search Template", description = "This is a convenience resource. It can be useful when building an Audit Search UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with.\n" + "\n" + "Example Requests:\n" + "\n" + "audits/searchtemplate\n" + "audits/searchtemplate?fields=actionNames") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class))) }) public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java index 14edbc945..8b7c45b43 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.commands.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -58,8 +59,7 @@ import org.springframework.stereotype.Component; @Path("/makercheckers") @Component @Scope("singleton") -@Api(tags = { "Maker Checker (or 4-eye) functionality" }) -@SwaggerDefinition(tags = { @Tag(name = "Maker Checker (or 4-eye) functionality") }) +@Tag(name = "Maker Checker (or 4-eye) functionality") public class MakercheckersApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId", @@ -88,24 +88,24 @@ public class MakercheckersApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Maker Checker Entries", notes = "Get a list of entries that can be checked by the requestor that match the criteria supplied.\n" + @Operation(summary = "List Maker Checker Entries", description = "Get a list of entries that can be checked by the requestor that match the criteria supplied.\n" + "\n" + "Example Requests:\n" + "\n" + "makercheckers\n" + "\n" + "makercheckers?fields=madeOnDate,maker,processingResult\n" + "\n" + "makercheckers?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n" + "\n" + "makercheckers?officeId=1\n" + "\n" + "makercheckers?officeId=1&includeJson=true") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckerResponse.class)))) }) public String retrieveCommands(@Context final UriInfo uriInfo, - @QueryParam("actionName") @ApiParam(value = "actionName") final String actionName, - @QueryParam("entityName") @ApiParam(value = "entityName") final String entityName, - @QueryParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, - @QueryParam("makerId") @ApiParam(value = "makerId") final Long makerId, - @QueryParam("makerDateTimeFrom") @ApiParam(value = "makerDateTimeFrom") final String makerDateTimeFrom, - @QueryParam("makerDateTimeTo") @ApiParam(value = "makerDateTimeTo") final String makerDateTimeTo, - @QueryParam("officeId") @ApiParam(value = "officeId") final Integer officeId, - @QueryParam("groupId") @ApiParam(value = "groupId") final Integer groupId, - @QueryParam("clientId") @ApiParam(value = "clientId") final Integer clientId, - @QueryParam("loanid") @ApiParam(value = "loanid") final Integer loanId, - @QueryParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Integer savingsAccountId) { + @QueryParam("actionName") @Parameter(description = "actionName") final String actionName, + @QueryParam("entityName") @Parameter(description = "entityName") final String entityName, + @QueryParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, + @QueryParam("makerId") @Parameter(description = "makerId") final Long makerId, + @QueryParam("makerDateTimeFrom") @Parameter(description = "makerDateTimeFrom") final String makerDateTimeFrom, + @QueryParam("makerDateTimeTo") @Parameter(description = "makerDateTimeTo") final String makerDateTimeTo, + @QueryParam("officeId") @Parameter(description = "officeId") final Integer officeId, + @QueryParam("groupId") @Parameter(description = "groupId") final Integer groupId, + @QueryParam("clientId") @Parameter(description = "clientId") final Integer clientId, + @QueryParam("loanid") @Parameter(description = "loanid") final Integer loanId, + @QueryParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Integer savingsAccountId) { final SQLBuilder extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo, officeId, groupId, clientId, loanId, savingsAccountId); @@ -122,10 +122,10 @@ public class MakercheckersApiResource { @Path("/searchtemplate") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Maker Checker Search Template", notes = "This is a convenience resource. It can be useful when building a Checker Inbox UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with. \"actionNames\" and \"entityNames\" returned are those that the requestor has Checker approval permissions for.\n" + @Operation(summary = "Maker Checker Search Template", description = "This is a convenience resource. It can be useful when building a Checker Inbox UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with. \"actionNames\" and \"entityNames\" returned are those that the requestor has Checker approval permissions for.\n" + "\n" + "Example Requests:\n" + "\n" + "makercheckers/searchtemplate\n" + "makercheckers/searchtemplate?fields=entityNames") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.GetMakerCheckersSearchTemplateResponse.class))) }) public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) { final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -141,10 +141,11 @@ public class MakercheckersApiResource { @Path("{auditId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve Maker Checker Entry | Reject Maker Checker Entry") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class) }) - public String approveMakerCheckerEntry(@PathParam("auditId") @ApiParam(value = "auditId") final Long auditId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam) { + @Operation(summary = "Approve Maker Checker Entry | Reject Maker Checker Entry") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class))) }) + public String approveMakerCheckerEntry(@PathParam("auditId") @Parameter(description = "auditId") final Long auditId, + @QueryParam("command") @Parameter(description = "command") final String commandParam) { CommandProcessingResult result = null; if (is(commandParam, "approve")) { @@ -166,9 +167,10 @@ public class MakercheckersApiResource { @Path("{auditId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete Maker Checker Entry") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class) }) - public String deleteMakerCheckerEntry(@PathParam("auditId") @ApiParam(value = "auditId") final Long auditId) { + @Operation(summary = "Delete Maker Checker Entry") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = MakercheckersApiResourceSwagger.PostMakerCheckersResponse.class))) }) + public String deleteMakerCheckerEntry(@PathParam("auditId") @Parameter(description = "auditId") final Long auditId) { final Long id = this.writePlatformService.deleteEntry(auditId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResourceSwagger.java index 39b8c9d86..c5e30f746 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.commands.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import java.util.List; import org.apache.fineract.commands.data.ProcessingResultLookup; @@ -35,7 +34,7 @@ final class MakercheckersApiResourceSwagger { // only to initialize swagger documentation } - @ApiModel(value = "GetMakerCheckerResponse") + @Schema(description = "GetMakerCheckerResponse") public static final class GetMakerCheckerResponse { private GetMakerCheckerResponse() { @@ -65,7 +64,7 @@ final class MakercheckersApiResourceSwagger { } - @ApiModel(value = "GetMakerCheckersSearchTemplateResponse") + @Schema(description = "GetMakerCheckersSearchTemplateResponse") public static final class GetMakerCheckersSearchTemplateResponse { private GetMakerCheckersSearchTemplateResponse() { @@ -78,14 +77,14 @@ final class MakercheckersApiResourceSwagger { public Collection processingResults; } - @ApiModel(value = "PostMakerCheckersResponse") + @Schema(description = "PostMakerCheckersResponse") public static final class PostMakerCheckersResponse { private PostMakerCheckersResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long auditId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java index b8cda753e..73f8bf16a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.accountnumberformat.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -61,9 +61,7 @@ import org.springframework.stereotype.Component; @Path(AccountNumberFormatConstants.resourceRelativeURL) @Component @Scope("singleton") -@Api(tags = { "Account number format" }) -@SwaggerDefinition(tags = { - @Tag(name = "Account number format", description = "Account number preferences are used to describe custom formats for account numbers associated with Customer, Loan and Savings accounts.") }) +@Tag(name = "Account number format", description = "Account number preferences are used to describe custom formats for account numbers associated with Customer, Loan and Savings accounts.") public class AccountNumberFormatsApiResource { private final PlatformSecurityContext context; @@ -93,10 +91,10 @@ public class AccountNumberFormatsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Account number format Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Account number format Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "\n" + "Example Request:\n" + "\n" + "accountnumberformats/template") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsResponseTemplate.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsResponseTemplate.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME); @@ -111,10 +109,10 @@ public class AccountNumberFormatsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Account number formats", notes = "Example Requests:\n" + "\n" + "accountnumberformats\n" + "\n" + "\n" - + "accountnumberformats?fields=accountType,prefixType", responseContainer = "List") + @Operation(summary = "List Account number formats", description = "Example Requests:\n" + "\n" + "accountnumberformats\n" + "\n" + "\n" + + "accountnumberformats?fields=accountType,prefixType") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME); @@ -130,12 +128,12 @@ public class AccountNumberFormatsApiResource { @Path("{accountNumberFormatId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve an Account number format", notes = "Example Requests:\n" + "\n" + "accountnumberformats/1\n" + "\n" + @Operation(summary = "Retrieve an Account number format", description = "Example Requests:\n" + "\n" + "accountnumberformats/1\n" + "\n" + "\n" + "accountnumberformats/1?template=true\n" + "\n" + "\n" + "accountnumberformats/1?fields=accountType,prefixType") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class))) }) public String retrieveOne(@Context final UriInfo uriInfo, - @PathParam("accountNumberFormatId") @ApiParam(value = "accountNumberFormatId") final Long accountNumberFormatId) { + @PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId) { this.context.authenticatedUser().validateHasReadPermission(AccountNumberFormatConstants.ENTITY_NAME); @@ -155,13 +153,12 @@ public class AccountNumberFormatsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create an Account number format", notes = "Note: You may associate a single Account number format for a given account type\n" + @Operation(summary = "Create an Account number format", description = "Note: You may associate a single Account number format for a given account type\n" + "Mandatory Fields for Account number formats\n" + "accountType") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsRequest.class) }) + @RequestBody(content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createAccountNumberFormat() // @@ -177,13 +174,13 @@ public class AccountNumberFormatsApiResource { @Path("{accountNumberFormatId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update an Account number format") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsRequest.class) }) + @Operation(summary = "Update an Account number format") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsResponse.class) }) - public String update(@PathParam("accountNumberFormatId") @ApiParam(value = "accountNumberFormatId") final Long accountNumberFormatId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsResponse.class))) }) + public String update( + @PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateAccountNumberFormat(accountNumberFormatId) // @@ -199,10 +196,11 @@ public class AccountNumberFormatsApiResource { @Path("{accountNumberFormatId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete an Account number format", notes = "Note: Account numbers created while this format was active would remain unchanged.") + @Operation(summary = "Delete an Account number format", description = "Note: Account numbers created while this format was active would remain unchanged.") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = AccountNumberFormatsApiResourceSwagger.DeleteAccountNumberFormatsResponse.class) }) - public String delete(@PathParam("accountNumberFormatId") @ApiParam(value = "accountNumberFormatId") final Long accountNumberFormatId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.DeleteAccountNumberFormatsResponse.class))) }) + public String delete( + @PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteAccountNumberFormat(accountNumberFormatId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResourceSwagger.java index 2de81f9cf..d1dfaeca3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.accountnumberformat.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import java.util.Map; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -33,7 +32,7 @@ final class AccountNumberFormatsApiResourceSwagger { // this class is only for Swagger implementation for Live Documentation } - @ApiModel(value = "GetAccountNumberFormatsResponse") + @Schema(description = "GetAccountNumberFormatsResponse") public static final class GetAccountNumberFormatsResponse { private GetAccountNumberFormatsResponse() { @@ -43,14 +42,14 @@ final class AccountNumberFormatsApiResourceSwagger { } - @ApiModel(value = "GetAccountNumberFormatsIdResponse") + @Schema(description = "GetAccountNumberFormatsIdResponse") public static final class GetAccountNumberFormatsIdResponse { private GetAccountNumberFormatsIdResponse() { } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long id; public EnumOptionData accountType; @@ -58,7 +57,7 @@ final class AccountNumberFormatsApiResourceSwagger { } - @ApiModel(value = "GetAccountNumberFormatsResponseTemplate") + @Schema(description = "GetAccountNumberFormatsResponseTemplate") public static final class GetAccountNumberFormatsResponseTemplate { private GetAccountNumberFormatsResponseTemplate() { @@ -70,45 +69,45 @@ final class AccountNumberFormatsApiResourceSwagger { } - @ApiModel(value = "PostAccountNumberFormatsRequest") + @Schema(description = "PostAccountNumberFormatsRequest") public static final class PostAccountNumberFormatsRequest { private PostAccountNumberFormatsRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long accountType; - @ApiModelProperty(example = "101") + @Schema(example = "101") public Long prefixType; } - @ApiModel(value = "PostAccountNumberFormatsResponse") + @Schema(description = "PostAccountNumberFormatsResponse") public static final class PostAccountNumberFormatsResponse { private PostAccountNumberFormatsResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } - @ApiModel(value = "PutAccountNumberFormatsRequest") + @Schema(description = "PutAccountNumberFormatsRequest") public static final class PutAccountNumberFormatsRequest { private PutAccountNumberFormatsRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long prefixType; } - @ApiModel(value = "PutAccountNumberFormatsResponse") + @Schema(description = "PutAccountNumberFormatsResponse") public static final class PutAccountNumberFormatsResponse { private PutAccountNumberFormatsResponse() { @@ -121,24 +120,24 @@ final class AccountNumberFormatsApiResourceSwagger { } - @ApiModelProperty(example = "OFFICE_NAME") + @Schema(example = "OFFICE_NAME") public Long prefixType; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long resourceId; public PutAccountNumberFormatschangesSwagger changes; } - @ApiModel(value = "DeleteAccountNumberFormatsResponse") + @Schema(description = "DeleteAccountNumberFormatsResponse") public static final class DeleteAccountNumberFormatsResponse { private DeleteAccountNumberFormatsResponse() { } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long resourceId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java index 2d2973185..95ee3e238 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.cache.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -59,11 +59,9 @@ import org.springframework.stereotype.Component; @Produces({ MediaType.APPLICATION_JSON }) @Component @Scope("singleton") -@Api(tags = { "Cache" }) -@SwaggerDefinition(tags = { @Tag(name = "Cache", description = "The following settings are possible for cache:\n" + "\n" - + "No Caching: caching turned off\n" +@Tag(name = "Cache", description = "The following settings are possible for cache:\n" + "\n" + "No Caching: caching turned off\n" + "Single node: caching on for single instance deployments of platorm (works for multiple tenants but only one tomcat)\n" - + "By default caching is set to No Caching. Switching between caches results in the cache been clear e.g. from Single node to No cache and back again would clear down the single node cache.") }) + + "By default caching is set to No Caching. Switching between caches results in the cache been clear e.g. from Single node to No cache and back again would clear down the single node cache.") public class CacheApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id")); @@ -88,9 +86,10 @@ public class CacheApiResource { } @GET - @ApiOperation(value = "Retrieve Cache Types", notes = "Returns the list of caches.\n" + "\n" + "Example Requests:\n" + "\n" + "caches") + @Operation(summary = "Retrieve Cache Types", description = "Returns the list of caches.\n" + "\n" + "Example Requests:\n" + "\n" + + "caches") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = CacheApiResourceSwagger.GetCachesResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CacheApiResourceSwagger.GetCachesResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -102,11 +101,11 @@ public class CacheApiResource { } @PUT - @ApiOperation(value = "Switch Cache", notes = "Switches the cache to chosen one.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CacheApiResourceSwagger.PutCachesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CacheApiResourceSwagger.PutCachesResponse.class) }) - public String switchCache(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Switch Cache", description = "Switches the cache to chosen one.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CacheApiResourceSwagger.PutCachesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CacheApiResourceSwagger.PutCachesResponse.class))) }) + public String switchCache(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCache().withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResourceSwagger.java index 7e0382229..8bce43c65 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.cache.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.apache.fineract.infrastructure.core.data.EnumOptionData; /** @@ -31,7 +30,7 @@ final class CacheApiResourceSwagger { } - @ApiModel(value = "GetCachesResponse") + @Schema(description = "GetCachesResponse") public static final class GetCachesResponse { private GetCachesResponse() { @@ -42,19 +41,19 @@ final class CacheApiResourceSwagger { public boolean enabled; } - @ApiModel(value = "PutCachesRequest") + @Schema(description = "PutCachesRequest") public static final class PutCachesRequest { private PutCachesRequest() { } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long cacheType; } - @ApiModel(value = "PutCachesResponse") + @Schema(description = "PutCachesResponse") public static final class PutCachesResponse { private PutCachesResponse() { @@ -67,7 +66,7 @@ final class CacheApiResourceSwagger { } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long cacheType; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/api/SmsCampaignApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/api/SmsCampaignApiResource.java index 00001057e..257580587 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/api/SmsCampaignApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/api/SmsCampaignApiResource.java @@ -19,12 +19,12 @@ package org.apache.fineract.infrastructure.campaigns.sms.api; import com.google.gson.JsonElement; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.util.HashSet; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -64,7 +64,6 @@ import org.springframework.stereotype.Component; @Path("/smscampaigns") @Component @Scope("singleton") -@Api(value = "SMS Campaigns") public class SmsCampaignApiResource { private final PlatformSecurityContext platformSecurityContext; @@ -100,9 +99,9 @@ public class SmsCampaignApiResource { @GET @Path("template") - @ApiOperation(value = "Retrieve a SMS Campaign", notes = "Example Requests:\n" + "\n" + "smscampaigns/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a SMS Campaign", description = "Example Requests:\n" + "\n" + "smscampaigns/1\n" + "\n" + "\n" + "smscampaigns/1?template=true\n" + "\n" + "\n" + "smscampaigns/template") - @ApiResponse(code = 200, message = "", response = SmsCampaignData.class) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SmsCampaignData.class))) public String template(@Context final UriInfo uriInfo) { this.platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME); final SmsCampaignData smsCampaignData = this.smsCampaignReadPlatformService.retrieveTemplate(CampaignType.SMS.name()); @@ -113,13 +112,12 @@ public class SmsCampaignApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a SMS Campaign", notes = "Mandatory Fields\n" + @Operation(summary = "Create a SMS Campaign", description = "Mandatory Fields\n" + "campaignName, campaignType, triggerType, providerId, runReportId, message\n" + "\n" + "Mandatory Fields for Cash based on selected report id\n" + "paramValue in json format") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CommandWrapper.class) }) - @ApiResponse(code = 200, message = "", response = CommandProcessingResult.class) - public String createCampaign(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CommandWrapper.class))) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) + public String createCampaign(@Parameter(hidden = true) final String apiRequestBodyAsJson) { this.platformSecurityContext.authenticatedUser(); final CommandWrapper commandRequest = new CommandWrapperBuilder().createSmsCampaign().withJson(apiRequestBodyAsJson).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); @@ -129,8 +127,8 @@ public class SmsCampaignApiResource { @GET @Path("{resourceId}") @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a SMS Campaign", notes = "Example Requests:\n" + "\n" + "smscampaigns/1\n") - @ApiResponse(code = 200, message = "", response = SmsCampaignData.class) + @Operation(summary = "Retrieve a SMS Campaign", description = "Example Requests:\n" + "\n" + "smscampaigns/1\n") + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SmsCampaignData.class))) public String retrieveCampaign(@PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) { this.platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME); SmsCampaignData smsCampaignData = this.smsCampaignReadPlatformService.retrieveOne(resourceId); @@ -141,8 +139,8 @@ public class SmsCampaignApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List SMS Campaigns", notes = "Example Requests:\n" + "\n" + "smscampaigns") - @ApiResponse(code = 200, message = "", response = SmsCampaignData.class) + @Operation(summary = "List SMS Campaigns", description = "Example Requests:\n" + "\n" + "smscampaigns") + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SmsCampaignData.class))) public String retrieveAllEmails(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) { @@ -157,12 +155,11 @@ public class SmsCampaignApiResource { @Path("{campaignId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Campaign") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CommandWrapper.class) }) - @ApiResponse(code = 200, message = "", response = CommandProcessingResult.class) + @Operation(summary = "Update a Campaign") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CommandWrapper.class))) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public String updateCampaign(@PathParam("campaignId") final Long campaignId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateSmsCampaign(campaignId).withJson(apiRequestBodyAsJson) .build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); @@ -173,10 +170,10 @@ public class SmsCampaignApiResource { @Path("{campaignId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "SMS Campaign", notes = "Activates | Deactivates | Reactivates") - @ApiResponse(code = 200, message = "", response = CommandProcessingResult.class) + @Operation(summary = "SMS Campaign", description = "Activates | Deactivates | Reactivates") + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public String handleCommands(@PathParam("campaignId") final Long campaignId, @QueryParam("command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); CommandProcessingResult result = null; CommandWrapper commandRequest = null; @@ -211,8 +208,8 @@ public class SmsCampaignApiResource { @DELETE @Path("{campaignId}") - @ApiOperation(value = "Delete a SMS Campaign", notes = "Note: Only closed SMS Campaigns can be deleted") - @ApiResponse(code = 200, message = "", response = CommandProcessingResult.class) + @Operation(summary = "Delete a SMS Campaign", description = "Note: Only closed SMS Campaigns can be deleted") + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public String delete(@PathParam("campaignId") final Long campaignId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSmsCampaign(campaignId).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java index 75c162ce4..caa95f9f3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.codes.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -61,11 +61,9 @@ import org.springframework.stereotype.Component; @Path("/codes/{codeId}/codevalues") @Component @Scope("singleton") -@Api(tags = { "Code Values" }) -@SwaggerDefinition(tags = { - @Tag(name = "Code Values", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n" - + "\n" - + "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc") }) +@Tag(name = "Code Values", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n" + + "\n" + + "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc") public class CodeValuesApiResource { /** @@ -96,12 +94,12 @@ public class CodeValuesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Code Values", notes = "Returns the list of Code Values for a given Code\n" + "\n" + "Example Requests:\n" - + "\n" + "codes/1/codevalues") + @Operation(summary = "List Code Values", description = "Returns the list of Code Values for a given Code\n" + "\n" + + "Example Requests:\n" + "\n" + "codes/1/codevalues") @ApiResponses({ - @ApiResponse(code = 200, message = "A List of Given response", response = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "A List of code values for a given code", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class)))) }) public String retrieveAllCodeValues(@Context final UriInfo uriInfo, - @PathParam("codeId") @ApiParam(value = "codeId") final Long codeId) { + @PathParam("codeId") @Parameter(description = "codeId") final Long codeId) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -115,11 +113,12 @@ public class CodeValuesApiResource { @Path("{codeValueId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Code Value", notes = "Returns the details of a Code Value\n" + "\n" + "Example Requests:\n" + "\n" - + "codes/1/codevalues/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class) }) + @Operation(summary = "Retrieve a Code description", description = "Returns the details of a Code Value\n" + "\n" + "Example Requests:\n" + + "\n" + "codes/1/codevalues/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.GetCodeValuesDataResponse.class))) }) public String retrieveCodeValue(@Context final UriInfo uriInfo, - @PathParam("codeValueId") @ApiParam(value = "codeValueId") final Long codeValueId) { + @PathParam("codeValueId") @Parameter(description = "codeValueId") final Long codeValueId) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -132,12 +131,12 @@ public class CodeValuesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Code Value", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodeValuesApiResourceSwagger.PostCodeValuesDataRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.PostCodeValueDataResponse.class) }) - public String createCodeValue(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a Code description", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PostCodeValuesDataRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PostCodeValueDataResponse.class))) }) + public String createCodeValue(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createCodeValue(codeId).withJson(apiRequestBodyAsJson).build(); @@ -151,13 +150,13 @@ public class CodeValuesApiResource { @Path("{codeValueId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Code Value", notes = "Updates the details of a code value.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodeValuesApiResourceSwagger.PutCodeValuesDataRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.PutCodeValueDataResponse.class) }) - public String updateCodeValue(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId, - @PathParam("codeValueId") @ApiParam(value = "codeValueId") final Long codeValueId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Code description", description = "Updates the details of a code description.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PutCodeValuesDataRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.PutCodeValueDataResponse.class))) }) + public String updateCodeValue(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, + @PathParam("codeValueId") @Parameter(description = "codeValueId") final Long codeValueId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCodeValue(codeId, codeValueId) .withJson(apiRequestBodyAsJson).build(); @@ -171,10 +170,11 @@ public class CodeValuesApiResource { @Path("{codeValueId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Code Value", notes = "Deletes a code value") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodeValuesApiResourceSwagger.DeleteCodeValueDataResponse.class) }) - public String deleteCodeValue(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId, - @PathParam("codeValueId") @ApiParam(value = "codeValueId") final Long codeValueId) { + @Operation(summary = "Delete a Code description", description = "Deletes a code description") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodeValuesApiResourceSwagger.DeleteCodeValueDataResponse.class))) }) + public String deleteCodeValue(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, + @PathParam("codeValueId") @Parameter(description = "codeValueId") final Long codeValueId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCodeValue(codeId, codeValueId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResourceSwagger.java index 7684a8149..ee8e48af1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.codes.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 30/7/17. @@ -30,65 +29,65 @@ final class CodeValuesApiResourceSwagger { } - @ApiModel(value = "GetCodeValuesDataResponse") + @Schema(description = "GetCodeValuesDataResponse") public static final class GetCodeValuesDataResponse { private GetCodeValuesDataResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Passport") + @Schema(example = "Passport") public String name; - @ApiModelProperty(example = "Passport information") + @Schema(example = "Passport information") public String description; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } - @ApiModel(value = "PostCodeValuesDataRequest") + @Schema(description = "PostCodeValuesDataRequest") public static final class PostCodeValuesDataRequest { private PostCodeValuesDataRequest() { } - @ApiModelProperty(example = "Passport") + @Schema(example = "Passport") public String name; - @ApiModelProperty(example = "Passport information") + @Schema(example = "Passport information") public String description; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } - @ApiModel(value = "PostCodeValueDataResponse") + @Schema(description = "PostCodeValueDataResponse") public static final class PostCodeValueDataResponse { private PostCodeValueDataResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } - @ApiModel(value = "PutCodeValuesDataRequest") + @Schema(description = "PutCodeValuesDataRequest") public static final class PutCodeValuesDataRequest { private PutCodeValuesDataRequest() { } - @ApiModelProperty(example = "Passport") + @Schema(example = "Passport") public String name; - @ApiModelProperty(example = "Passport information") + @Schema(example = "Passport information") public String description; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } - @ApiModel(value = "PutCodeValueDataResponse") + @Schema(description = "PutCodeValueDataResponse") public static final class PutCodeValueDataResponse { private PutCodeValueDataResponse() { @@ -99,27 +98,27 @@ final class CodeValuesApiResourceSwagger { private PutCodeValuechangesSwagger() {} - @ApiModelProperty(example = "Passport") + @Schema(example = "Passport") public String name; - @ApiModelProperty(example = "Passport information") + @Schema(example = "Passport information") public String description; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; public PutCodeValuechangesSwagger changes; } - @ApiModel(value = "DeleteCodeValueDataResponse") + @Schema(description = "DeleteCodeValueDataResponse") public static final class DeleteCodeValueDataResponse { private DeleteCodeValueDataResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResource.java index 5f59030ee..761a77ae4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.codes.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -59,11 +59,9 @@ import org.springframework.stereotype.Component; @Path("/codes") @Component @Scope("singleton") -@Api(tags = { "Codes" }) -@SwaggerDefinition(tags = { - @Tag(name = "Codes", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n" - + "\n" - + "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc") }) +@Tag(name = "Codes", description = "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n" + + "\n" + + "Codes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc") public class CodesApiResource { /** @@ -92,9 +90,9 @@ public class CodesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Codes", notes = "Returns the list of codes.\n" + "\n" + "Example Requests:\n" + "\n" + "codes") + @Operation(summary = "Retrieve Codes", description = "Returns the list of codes.\n" + "\n" + "Example Requests:\n" + "\n" + "codes") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.GetCodesResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class)))) }) public String retrieveCodes(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -108,11 +106,11 @@ public class CodesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Code", notes = "Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodesApiResourceSwagger.PostCodesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.PostCodesResponse.class) }) - public String createCode(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a Code", description = "Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PostCodesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PostCodesResponse.class))) }) + public String createCode(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createCode().withJson(apiRequestBodyAsJson).build(); @@ -125,9 +123,11 @@ public class CodesApiResource { @Path("{codeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Code", notes = "Returns the details of a Code.\n" + "\n" + "Example Requests:\n" + "\n" + "codes/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.GetCodesResponse.class) }) - public String retrieveCode(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId, @Context final UriInfo uriInfo) { + @Operation(summary = "Retrieve a Code", description = "Returns the details of a Code.\n" + "\n" + "Example Requests:\n" + "\n" + + "codes/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class))) }) + public String retrieveCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, @Context final UriInfo uriInfo) { final CodeData code = this.readPlatformService.retrieveCode(codeId); @@ -139,12 +139,12 @@ public class CodesApiResource { @Path("{codeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Code", notes = "Updates the details of a code if it is not system defined.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CodesApiResourceSwagger.PutCodesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.PutCodesResponse.class) }) - public String updateCode(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Code", description = "Updates the details of a code if it is not system defined.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PutCodesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.PutCodesResponse.class))) }) + public String updateCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCode(codeId).withJson(apiRequestBodyAsJson).build(); @@ -157,9 +157,10 @@ public class CodesApiResource { @Path("{codeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Code", notes = "Deletes a code if it is not system defined.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CodesApiResourceSwagger.DeleteCodesResponse.class) }) - public String deleteCode(@PathParam("codeId") @ApiParam(value = "codeId") final Long codeId) { + @Operation(summary = "Delete a Code", description = "Deletes a code if it is not system defined.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.DeleteCodesResponse.class))) }) + public String deleteCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCode(codeId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResourceSwagger.java index 924196685..92dbfe026 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.codes.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 29/7/17. @@ -30,55 +29,55 @@ final class CodesApiResourceSwagger { // this class is only for Swagger Live Documentation } - @ApiModel(value = "GetCodesResponse") + @Schema(description = "GetCodesResponse") public static final class GetCodesResponse { private GetCodesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Education") + @Schema(example = "Education") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean systemDefined; } - @ApiModel(value = "PostCodesRequest") + @Schema(description = "PostCodesRequest") public static final class PostCodesRequest { private PostCodesRequest() { } - @ApiModelProperty(example = "MyNewCode") + @Schema(example = "MyNewCode") public String name; } - @ApiModel(value = "PostCodesResponse") + @Schema(description = "PostCodesResponse") public static final class PostCodesResponse { private PostCodesResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } - @ApiModel(value = "PutCodesRequest") + @Schema(description = "PutCodesRequest") public static final class PutCodesRequest { private PutCodesRequest() { } - @ApiModelProperty(example = "MyNewCode(changed)") + @Schema(example = "MyNewCode(changed)") public String name; } - @ApiModel(value = "PutCodesResponse") + @Schema(description = "PutCodesResponse") public static final class PutCodesResponse { private PutCodesResponse() { @@ -89,23 +88,23 @@ final class CodesApiResourceSwagger { private PutCodesApichangesSwagger() {} - @ApiModelProperty(example = "MyNewCode(changed)") + @Schema(example = "MyNewCode(changed)") public String name; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; public PutCodesApichangesSwagger changes; } - @ApiModel(value = "DeleteCodesResponse") + @Schema(description = "DeleteCodesResponse") public static final class DeleteCodesResponse { private DeleteCodesResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResource.java index bddbbc2bb..a27a6aa1d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.infrastructure.configuration.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -54,11 +53,9 @@ import org.springframework.stereotype.Component; @Path("/externalservice") @Component @Scope("singleton") -@Api(tags = { "External Services" }) -@SwaggerDefinition(tags = { - @Tag(name = "External Services", description = "External Services Configuration related to set of supported configurations for third party services like Amazon S3 and SMTP:\n" - + "\n" + "S3 (Amazon S3):\n" + "s3_access_key -\n" + "s3_bucket_name -\n" + "s3_secret_key -\n" + "\n" + "\n" - + "SMTP (Email Service):\n" + "username -\n" + "password -\n" + "host -\n" + "port -\n" + "useTLS -") }) +@Tag(name = "External Services", description = "External Services Configuration related to set of supported configurations for third party services like Amazon S3 and SMTP:\n" + + "\n" + "S3 (Amazon S3):\n" + "s3_access_key -\n" + "s3_bucket_name -\n" + "s3_secret_key -\n" + "\n" + "\n" + + "SMTP (Email Service):\n" + "username -\n" + "password -\n" + "host -\n" + "port -\n" + "useTLS -") public class ExternalServicesConfigurationApiResource { private final PlatformSecurityContext context; @@ -87,10 +84,11 @@ public class ExternalServicesConfigurationApiResource { @Path("{servicename}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve External Services Configuration", notes = "Returns a external Service configurations based on the Service Name.\n" + @Operation(summary = "Retrieve External Services Configuration", description = "Returns a external Service configurations based on the Service Name.\n" + "\n" + "Service Names supported are S3 and SMTP.\n" + "\n" + "Example Requests:\n" + "\n" + "externalservice/SMTP") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ExternalServicesPropertiesData.class) }) - public String retrieveOne(@PathParam("servicename") @ApiParam(value = "servicename") final String serviceName, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ExternalServicesPropertiesData.class))) }) + public String retrieveOne(@PathParam("servicename") @Parameter(description = "servicename") final String serviceName, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(ExternalServiceConfigurationApiConstant.EXTERNAL_SERVICE_RESOURCE_NAME); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -104,13 +102,13 @@ public class ExternalServicesConfigurationApiResource { @Path("{servicename}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update External Service", notes = "Updates the external Service Configuration for a Service Name.\n" + "\n" + @Operation(summary = "Update External Service", description = "Updates the external Service Configuration for a Service Name.\n" + "\n" + "Example: \n" + "\n" + "externalservice/S3") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ExternalServicesConfigurationApiResourceSwagger.PutExternalServiceRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "") }) - public String updateExternalServiceProperties(@PathParam("servicename") @ApiParam(value = "servicename") final String serviceName, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ExternalServicesConfigurationApiResourceSwagger.PutExternalServiceRequest.class))) + @ApiResponses({ @ApiResponse(responseCode = "200", description = "") }) + public String updateExternalServiceProperties( + @PathParam("servicename") @Parameter(description = "servicename") final String serviceName, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { // ExternalServicesData external = // this.externalServiceReadPlatformService.getExternalServiceDetailsByServiceName(serviceName); final CommandWrapper commandRequest = new CommandWrapperBuilder().updateExternalServiceProperties(serviceName) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResourceSwagger.java index e43519104..60b4fc764 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/ExternalServicesConfigurationApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.configuration.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 30/7/17. @@ -30,16 +29,16 @@ final class ExternalServicesConfigurationApiResourceSwagger { } - @ApiModel(value = "PutExternalServiceRequest") + @Schema(description = "PutExternalServiceRequest") public static final class PutExternalServiceRequest { private PutExternalServiceRequest() { } - @ApiModelProperty(example = "test@mifos.org") + @Schema(example = "test@mifos.org") public String username; - @ApiModelProperty(example = "XXXX") + @Schema(example = "XXXX") public String password; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResource.java index 6d65348eb..50017769e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.configuration.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -59,17 +59,15 @@ import org.springframework.stereotype.Component; @Path("/configurations") @Component @Scope("singleton") -@Api(tags = { "Global Configuration" }) -@SwaggerDefinition(tags = { - @Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n" - + "\n" + "maker-checker - defaults to false - if true turns on maker-checker functionality\n" - + "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n" - + "allow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\n" - + "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n" - + "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n" - + "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n" - + "financial-year-beginning-month - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.\n" - + "meetings-mandatory-for-jlg-loans - if set to true, enforces all JLG loans to follow a meeting schedule belonging to either the parent group or Center.") }) +@Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n" + "\n" + + "maker-checker - defaults to false - if true turns on maker-checker functionality\n" + + "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n" + + "allow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\n" + + "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n" + + "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n" + + "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n" + + "financial-year-beginning-month - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.\n" + + "meetings-mandatory-for-jlg-loans - if set to true, enforces all JLG loans to follow a meeting schedule belonging to either the parent group or Center.") public class GlobalConfigurationApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("globalConfiguration")); @@ -100,14 +98,14 @@ public class GlobalConfigurationApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Global Configuration | Retrieve Global Configuration for surveys", notes = "Returns the list global enable/disable configurations.\n" + @Operation(summary = "Retrieve Global Configuration | Retrieve Global Configuration for surveys", description = "Returns the list global enable/disable configurations.\n" + "\n" + "Example Requests:\n" + "\n" + "configurations\n\n" + "\n" + "Returns the list global enable/disable survey configurations.\n" + "\n" + "Example Requests:\n" + "\n" + "configurations/survey") @ApiResponses({ - @ApiResponse(code = 200, message = "List of example \n response \nsurveys response \ngiven below", response = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "List of example \\n response \\nsurveys response \\ngiven below", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class)))) }) public String retrieveConfiguration(@Context final UriInfo uriInfo, - @DefaultValue("false") @QueryParam("survey") @ApiParam(value = "survey") final boolean survey) { + @DefaultValue("false") @QueryParam("survey") @Parameter(description = "survey") final boolean survey) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -121,11 +119,12 @@ public class GlobalConfigurationApiResource { @Path("{configId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Global Configuration", notes = "Returns a global enable/disable configurations.\n" + "\n" + @Operation(summary = "Retrieve Global Configuration", description = "Returns a global enable/disable configurations.\n" + "\n" + "Example Requests:\n" + "\n" + "configurations/1") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class) }) - public String retrieveOne(@PathParam("configId") @ApiParam(value = "configId") final Long configId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.GetGlobalConfigurationsResponse.class))) }) + public String retrieveOne(@PathParam("configId") @Parameter(description = "configId") final Long configId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -139,13 +138,12 @@ public class GlobalConfigurationApiResource { @Path("{configId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Global Configuration", notes = "Updates an enable/disable global configuration item.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class) }) + @Operation(summary = "Update Global Configuration", description = "Updates an enable/disable global configuration item.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class) }) - public String updateConfiguration(@PathParam("configId") @ApiParam(value = "configId") final Long configId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class))) }) + public String updateConfiguration(@PathParam("configId") @Parameter(description = "configId") final Long configId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateGlobalConfiguration(configId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResourceSwagger.java index bb50dd86a..cd1cdd2c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.configuration.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData; @@ -32,7 +31,7 @@ final class GlobalConfigurationApiResourceSwagger { } - @ApiModel(value = "GetGlobalConfigurationsResponse") + @Schema(description = "GetGlobalConfigurationsResponse") public static final class GetGlobalConfigurationsResponse { private GetGlobalConfigurationsResponse() {} @@ -40,18 +39,18 @@ final class GlobalConfigurationApiResourceSwagger { public List globalConfiguration; } - @ApiModel(value = "PutGlobalConfigurationsRequest") + @Schema(description = "PutGlobalConfigurationsRequest") public static final class PutGlobalConfigurationsRequest { private PutGlobalConfigurationsRequest() {} - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean enabled; - @ApiModelProperty(example = "2") - public Long value; + @Schema(example = "2") + public Long description; } - @ApiModel(value = "PutGlobalConfigurationsResponse") + @Schema(description = "PutGlobalConfigurationsResponse") public static final class PutGlobalConfigurationsResponse { private PutGlobalConfigurationsResponse() {} @@ -60,11 +59,11 @@ final class GlobalConfigurationApiResourceSwagger { private PutGlobalConfigurationsResponsechangesSwagger() {} - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean enabled; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; public PutGlobalConfigurationsResponsechangesSwagger changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/api/CreditBureauConfigurationAPI.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/api/CreditBureauConfigurationAPI.java index a7993969d..f5c1e24b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/api/CreditBureauConfigurationAPI.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/api/CreditBureauConfigurationAPI.java @@ -19,7 +19,6 @@ package org.apache.fineract.infrastructure.creditbureau.api; -import io.swagger.annotations.Api; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -57,7 +56,6 @@ import org.springframework.stereotype.Component; @Path("/CreditBureauConfiguration") @Component @Scope("singleton") -@Api(value = "CreditBureau Configuration") public class CreditBureauConfigurationAPI { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java index c4829a099..c5759d9c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -57,16 +57,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; -//import org.slf4j.Logger; - @Path("/datatables") @Component @Scope("singleton") -@Api(tags = { "Data Tables" }) -@SwaggerDefinition(tags = { - @Tag(name = "Data Tables", description = "The datatables API allows you to plug-in your own tables (MySql) that have a relationship to a Apache Fineract core table. For example, you might want to add some extra client fields and record information about each of the clients' family members. Via the API you can create, read, update and delete entries for each 'plugged-in' table. The API checks for permission and for 'data scoping' (only data within the users' office hierarchy can be managed by the user).\n" - + "\n" - + "The Apache Fineract Reference App uses a JQuery plug-in called stretchydatatables (which in turn uses this datatables resource) to provide a pretty flexible CRUD (Create, Read, Update, Delete) User Interface.") }) +@Tag(name = "Data Tables", description = "The datatables API allows you to plug-in your own tables (MySql) that have a relationship to a Apache Fineract core table. For example, you might want to add some extra client fields and record information about each of the clients' family members. Via the API you can create, read, update and delete entries for each 'plugged-in' table. The API checks for permission and for 'data scoping' (only data within the users' office hierarchy can be managed by the user).\n" + + "\n" + + "The Apache Fineract Reference App uses a JQuery plug-in called stretchydatatables (which in turn uses this datatables resource) to provide a pretty flexible CRUD (Create, Read, Update, Delete) User Interface.") public class DatatablesApiResource { private final PlatformSecurityContext context; @@ -91,13 +87,12 @@ public class DatatablesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Data Tables", notes = "Lists registered data tables and the Apache Fineract Core application table they are registered to.\n" + @Operation(summary = "List Data Tables", description = "Lists registered data tables and the Apache Fineract Core application table they are registered to.\n" + "\n" + "ARGUMENTS\n" + "\n" + "apptable - optional" + "\n" + "The Apache Fineract core application table.\n" + "\n" - + "Example Requests:\n" + "\n" + "datatables?apptable=m_client\n" + "\n" + "\n" - + "datatables", responseContainer = "List", response = DatatablesApiResourceSwagger.GetDataTablesResponse.class) + + "Example Requests:\n" + "\n" + "datatables?apptable=m_client\n" + "\n" + "\n" + "datatables") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.GetDataTablesResponse.class, responseContainer = "list") }) - public String getDatatables(@QueryParam("apptable") @ApiParam(value = "apptable") final String apptable, + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DatatablesApiResourceSwagger.GetDataTablesResponse.class)))) }) + public String getDatatables(@QueryParam("apptable") @Parameter(description = "apptable") final String apptable, @Context final UriInfo uriInfo) { final List result = this.readWriteNonCoreDataService.retrieveDatatableNames(apptable); @@ -109,7 +104,7 @@ public class DatatablesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create Data Table", notes = "Create a new data table and registers it with the Apache Fineract Core application table.\n" + @Operation(summary = "Create Data Table", description = "Create a new data table and registers it with the Apache Fineract Core application table.\n" + "\n" + "Field Descriptions\n" + "\n" + "Mandatory - datatableName : \n" + "\nThe name of the Data Table.\n" + "\n" + "Mandatory - apptableName\n" + "\n" + "Application table name. Must be one of the following:\n" + "\n" + "m_client\n" + "\n" + "m_group" + "\n" + "\n" + "m_loan" + "\n" + "\n" + "m_office" + "\n" + "\n" + "m_saving_account" + "\n" + "\n" @@ -121,15 +116,15 @@ public class DatatablesApiResource { + "\n" + "\n" + "Mandatory - type" + "\n" + "\n" + "Column type. Must be one of the following:" + "\n" + "\n" + "Boolean" + "\n" + "\n" + "Date" + "\n" + "\n" + "DateTime" + "\n" + "\n" + "Decimal" + "\n" + "\n" + "Dropdown" + "\n" + "\n" + "\n" + "Number" + "\n" + "\n" + "String" + "\n" + "\n" + "Text" + "\n" + "\n" + "Mandatory [type = Dropdown] - code" + "\n" + "\n" - + "Used in Code Value fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned." + + "Used in Code description fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned." + "\n" + "\n" + "Optional - mandatory" + "\n" + "\n" + "Determines whether this column must have a value in every entry. Optional, defaults to false." + "\n" + "\n" + "Mandatory [type = String] - length" + "\n" + "\n" + "Length of the text field. Mandatory if type String is used, otherwise an error is returned.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PostDataTablesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PostDataTablesResponse.class) }) - public String createDatatable(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesResponse.class))) }) + public String createDatatable(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createDBDatatable(apiRequestBodyAsJson).build(); @@ -141,12 +136,12 @@ public class DatatablesApiResource { @Path("{datatableName}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Data Table", notes = "Modifies fields of a data table. If the apptableName parameter is passed, data table is deregistered and registered with the new application table.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PutDataTablesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesResponse.class) }) - public String updateDatatable(@PathParam("datatableName") @ApiParam(value = "datatableName") final String datatableName, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update Data Table", description = "Modifies fields of a data table. If the apptableName parameter is passed, data table is deregistered and registered with the new application table.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesResponse.class))) }) + public String updateDatatable(@PathParam("datatableName") @Parameter(description = "datatableName") final String datatableName, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateDBDatatable(datatableName, apiRequestBodyAsJson).build(); @@ -158,10 +153,11 @@ public class DatatablesApiResource { @Path("{datatableName}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete Data Table", notes = "Deletes a data table and deregisters it from the Apache Fineract Core application table.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.DeleteDataTablesResponse.class) }) - public String deleteDatatable(@PathParam("datatableName") @ApiParam(value = "datatableName") final String datatableName, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Delete Data Table", description = "Deletes a data table and deregisters it from the Apache Fineract Core application table.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.DeleteDataTablesResponse.class))) }) + public String deleteDatatable(@PathParam("datatableName") @Parameter(description = "datatableName") final String datatableName, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteDBDatatable(datatableName, apiRequestBodyAsJson).build(); @@ -173,13 +169,13 @@ public class DatatablesApiResource { @Path("register/{datatable}/{apptable}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Register Data Table", notes = "Registers a data table with the Apache Fineract Core application table. This allows the data table to be maintained through the API. In case the datatable is a PPI (survey table), a parameter category should be pass along with the request. The API currently support one category (200)") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PostDataTablesRegisterDatatableAppTable.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesResponse.class) }) - public String registerDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, - @PathParam("apptable") @ApiParam(value = "apptable") final String apptable, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Register Data Table", description = "Registers a data table with the Apache Fineract Core application table. This allows the data table to be maintained through the API. In case the datatable is a PPI (survey table), a parameter category should be pass along with the request. The API currently support one category (200)") + @RequestBody(content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesRegisterDatatableAppTable.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesResponse.class))) }) + public String registerDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, + @PathParam("apptable") @Parameter(description = "apptable") final String apptable, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().registerDBDatatable(datatable, apptable) .withJson(apiRequestBodyAsJson).build(); @@ -193,9 +189,10 @@ public class DatatablesApiResource { @Path("deregister/{datatable}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Deregister Data Table", notes = "Deregisters a data table. It will no longer be available through the API.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesResponse.class) }) - public String deregisterDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable) { + @Operation(summary = "Deregister Data Table", description = "Deregisters a data table. It will no longer be available through the API.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesResponse.class))) }) + public String deregisterDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable) { this.readWriteNonCoreDataService.deregisterDatatable(datatable); @@ -208,9 +205,10 @@ public class DatatablesApiResource { @Path("{datatable}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Data Table Details", notes = "Lists a registered data table details and the Apache Fineract Core application table they are registered to.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.GetDataTablesResponse.class) }) - public String getDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, + @Operation(summary = "Retrieve Data Table Details", description = "Lists a registered data table details and the Apache Fineract Core application table they are registered to.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.GetDataTablesResponse.class))) }) + public String getDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, @Context final UriInfo uriInfo) { final DatatableData result = this.readWriteNonCoreDataService.retrieveDatatable(datatable); @@ -223,17 +221,18 @@ public class DatatablesApiResource { @Path("{datatable}/{apptableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Entry(s) from Data Table", notes = "Gets the entry (if it exists) for data tables that are one to one with the application table. \n" + @Operation(summary = "Retrieve Entry(s) from Data Table", description = "Gets the entry (if it exists) for data tables that are one to one with the application table. \n" + "Gets the entries (if they exist) for data tables that are one to many with the application table.\n" + "\n" + "Note: The 'fields' parameter is not available for datatables.\n" + "\n" + "ARGUMENTS\n" + "orderoptional Specifies the order in which data is returned.genericResultSetoptional, defaults to false If 'true' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality.\n" + "Example Requests:\n" + "\n" + "datatables/extra_client_details/1\n" + "\n" + "\n" + "datatables/extra_family_details/1?order=`Date of Birth` desc\n" + "\n" + "\n" + "datatables/extra_client_details/1?genericResultSet=true") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.GetDataTablesAppTableIdResponse.class) }) - public String getDatatable(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, - @QueryParam("order") @ApiParam(value = "order") final String order, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.GetDataTablesAppTableIdResponse.class))) }) + public String getDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, + @QueryParam("order") @Parameter(description = "order") final String order, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasDatatableReadPermission(datatable); @@ -282,15 +281,14 @@ public class DatatablesApiResource { @Path("{datatable}/{apptableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create Entry in Data Table", notes = "Adds a row to the data table.\n" + "\n" + @Operation(summary = "Create Entry in Data Table", description = "Adds a row to the data table.\n" + "\n" + "Note that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name \"Business Description\" is considered the same as \"Business_Description\". So you shouldn't have both \"versions\" in any data table.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PostDataTablesAppTableIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesAppTableIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PostDataTablesAppTableIdResponse.class) }) - public String createDatatableEntry(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PostDataTablesAppTableIdResponse.class))) }) + public String createDatatableEntry(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createDatatable(datatable, apptableId, null) // @@ -306,13 +304,13 @@ public class DatatablesApiResource { @Path("{datatable}/{apptableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Entry in Data Table (One to One)", notes = "Updates the row (if it exists) of the data table.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PutDataTablesAppTableIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesAppTableIdResponse.class) }) - public String updateDatatableEntryOnetoOne(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update Entry in Data Table (One to One)", description = "Updates the row (if it exists) of the data table.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdResponse.class))) }) + public String updateDatatableEntryOnetoOne(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateDatatable(datatable, apptableId, null) // @@ -328,15 +326,14 @@ public class DatatablesApiResource { @Path("{datatable}/{apptableId}/{datatableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Entry in Data Table (One to Many)", notes = "Updates the row (if it exists) of the data table.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdRequest.class) }) + @Operation(summary = "Update Entry in Data Table (One to Many)", description = "Updates the row (if it exists) of the data table.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdResponse.class) }) - public String updateDatatableEntryOneToMany(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, - @PathParam("datatableId") @ApiParam(value = "datatableId") final Long datatableId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.PutDataTablesAppTableIdDatatableIdResponse.class))) }) + public String updateDatatableEntryOneToMany(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, + @PathParam("datatableId") @Parameter(description = "datatableId") final Long datatableId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateDatatable(datatable, apptableId, datatableId) // @@ -352,12 +349,12 @@ public class DatatablesApiResource { @Path("{datatable}/{apptableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete Entry(s) in Data Table", notes = "Deletes the entry (if it exists) for data tables that are one-to-one with the application table. \n" + @Operation(summary = "Delete Entry(s) in Data Table", description = "Deletes the entry (if it exists) for data tables that are one-to-one with the application table. \n" + "Deletes the entries (if they exist) for data tables that are one-to-many with the application table.") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdResponse.class) }) - public String deleteDatatableEntries(@PathParam("datatable") @ApiParam(value = "datatable") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdResponse.class))) }) + public String deleteDatatableEntries(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteDatatable(datatable, apptableId, null) // @@ -372,14 +369,14 @@ public class DatatablesApiResource { @Path("{datatable}/{apptableId}/{datatableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete Entry in Datatable (One to Many)", notes = "Deletes the entry (if it exists) for data tables that are one to many with the application table.\n" + @Operation(summary = "Delete Entry in Datatable (One to Many)", description = "Deletes the entry (if it exists) for data tables that are one to many with the application table.\n" + "\n") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdDatatableIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DatatablesApiResourceSwagger.DeleteDataTablesDatatableAppTableIdDatatableIdResponse.class))) }) public String deleteDatatableEntries( - @PathParam("datatable") @ApiParam(value = "datatable", type = "body", example = "{}") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, - @PathParam("datatableId") @ApiParam(value = "datatableId") final Long datatableId) { + @PathParam("datatable") @Parameter(description = "datatable", example = "{}") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, + @PathParam("datatableId") @Parameter(description = "datatableId") final Long datatableId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteDatatable(datatable, apptableId, datatableId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java index 6bbceaf18..4e4facf2b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData; import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData; @@ -33,48 +32,48 @@ final class DatatablesApiResourceSwagger { } - @ApiModel(value = "GetDataTablesResponse") + @Schema(description = "GetDataTablesResponse") public static final class GetDataTablesResponse { private GetDataTablesResponse() { } - @ApiModelProperty(example = "m_client") + @Schema(example = "m_client") public String appTableName; - @ApiModelProperty(example = "extra_client_details") + @Schema(example = "extra_client_details") public String datatableName; public List column; } - @ApiModel(value = "PostDataTablesRequest") + @Schema(description = "PostDataTablesRequest") public static final class PostDataTablesRequest { private PostDataTablesRequest() { } - @ApiModelProperty(example = "m_client") + @Schema(example = "m_client") public String applicationTableName; - @ApiModelProperty(example = "extra_client_details") + @Schema(example = "extra_client_details") public String registeredTableName; - @ApiModelProperty(example = "true") + @Schema(required = false, description = "Allows to create multiple entries in the Data Table. Optional, defaults to false. If this property is not provided Data Table will allow only one entry.", example = "true") public boolean multiRow; public List columnHeaderData; } - @ApiModel(value = "PostDataTablesResponse") + @Schema(description = "PostDataTablesResponse") public static final class PostDataTablesResponse { private PostDataTablesResponse() { } - @ApiModelProperty(example = "extra_client_details") + @Schema(example = "extra_client_details") public String resourceIdentifier; } - @ApiModel(value = "PutDataTablesRequest") + @Schema(description = "PutDataTablesRequest") public static final class PutDataTablesRequest { private PutDataTablesRequest() { @@ -85,7 +84,7 @@ final class DatatablesApiResourceSwagger { private PutDataTablesRequestDropColumns() {} - @ApiModelProperty(example = "Gender_cd_Question") + @Schema(example = "Gender_cd_Question") public String name; } @@ -93,13 +92,13 @@ final class DatatablesApiResourceSwagger { private PutDataTablesRequestAddColumns() {} - @ApiModelProperty(example = "Question") + @Schema(example = "Question") public String name; - @ApiModelProperty(example = "Dropdown") + @Schema(example = "Dropdown") public String type; - @ApiModelProperty(example = "Gender") + @Schema(example = "Gender") public String code; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean mandatory; } @@ -107,92 +106,92 @@ final class DatatablesApiResourceSwagger { private PutDataTablesRequestChangeColumns() {} - @ApiModelProperty(example = "Question") + @Schema(example = "Question") public String name; - @ApiModelProperty(example = "Question 2") + @Schema(example = "Question 2") public String newName; - @ApiModelProperty(example = "Gender") + @Schema(example = "Gender") public String code; - @ApiModelProperty(example = "Gender2") + @Schema(example = "Gender2") public String newCode; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean mandatory; } - @ApiModelProperty(example = "m_client") + @Schema(example = "m_client") public String appTableName; public List dropColumns; public List addColumns; public List ChangeColumns; } - @ApiModel(value = "PutDataTablesResponse") + @Schema(description = "PutDataTablesResponse") public static final class PutDataTablesResponse { private PutDataTablesResponse() { } - @ApiModelProperty(example = "extra_client_details") + @Schema(example = "extra_client_details") public String resourceIdentifier; } - @ApiModel(value = "DeleteDataTablesResponse") + @Schema(description = "DeleteDataTablesResponse") public static final class DeleteDataTablesResponse { private DeleteDataTablesResponse() { } - @ApiModelProperty(example = "extra_client_details") + @Schema(example = "extra_client_details") public String resourceIdentifier; } - @ApiModel(value = "PostDataTablesRegisterDatatableAppTable") + @Schema(description = "PostDataTablesRegisterDatatableAppTable") public static final class PostDataTablesRegisterDatatableAppTable { private PostDataTablesRegisterDatatableAppTable() {} } - @ApiModel(value = "PostDataTablesAppTableIdRequest") + @Schema(description = "PostDataTablesAppTableIdRequest") public static final class PostDataTablesAppTableIdRequest { private PostDataTablesAppTableIdRequest() { } - @ApiModelProperty(example = "Livestock sales") + @Schema(example = "Livestock sales") public String BusinessDescription; - @ApiModelProperty(example = "First comment made") + @Schema(example = "First comment made") public String Comment; - @ApiModelProperty(example = "Primary") + @Schema(example = "Primary") public String Education_cv; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Long Gender_cd; - @ApiModelProperty(example = "8.5") + @Schema(example = "8.5") public Double HighestRatePaid; - @ApiModelProperty(example = "01 October 2012") + @Schema(example = "01 October 2012") public String NextVisit; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Long YearsinBusiness; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModel(value = "PostDataTablesAppTableIdResponse ") + @Schema(description = "PostDataTablesAppTableIdResponse ") public static final class PostDataTablesAppTableIdResponse { private PostDataTablesAppTableIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "GetDataTablesAppTableIdResponse") + @Schema(description = "GetDataTablesAppTableIdResponse") public static final class GetDataTablesAppTableIdResponse { private GetDataTablesAppTableIdResponse() { @@ -203,18 +202,18 @@ final class DatatablesApiResourceSwagger { public List data; } - @ApiModel(value = "PutDataTablesAppTableIdRequest") + @Schema(description = "PutDataTablesAppTableIdRequest") public static final class PutDataTablesAppTableIdRequest { private PutDataTablesAppTableIdRequest() { } - @ApiModelProperty(example = "Livestock sales updated") + @Schema(example = "Livestock sales updated") public String BusinessDescription; } - @ApiModel(value = "PutDataTablesAppTableIdResponse") + @Schema(description = "PutDataTablesAppTableIdResponse") public static final class PutDataTablesAppTableIdResponse { private PutDataTablesAppTableIdResponse() { @@ -225,68 +224,68 @@ final class DatatablesApiResourceSwagger { private PutDataTablesAppTableIdResponseChanges() {} - @ApiModelProperty(example = "Livestock sales updated") + @Schema(example = "Livestock sales updated") public String BusinessDescription; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutDataTablesAppTableIdResponseChanges changes; } - @ApiModel(value = "PutDataTablesAppTableIdDatatableIdRequest") + @Schema(description = "PutDataTablesAppTableIdDatatableIdRequest") public static final class PutDataTablesAppTableIdDatatableIdRequest { private PutDataTablesAppTableIdDatatableIdRequest() { } - @ApiModelProperty(example = "01 June 1982") + @Schema(example = "01 June 1982") public String DateOfBirth; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Long Education_cdHighest; - @ApiModelProperty(example = "June") + @Schema(example = "June") public String Name; - @ApiModelProperty(example = "More notes") + @Schema(example = "More notes") public String OtherNotes; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Long PointsScore; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModel(value = "PutDataTablesAppTableIdDatatableIdResponse ") + @Schema(description = "PutDataTablesAppTableIdDatatableIdResponse ") public static final class PutDataTablesAppTableIdDatatableIdResponse { private PutDataTablesAppTableIdDatatableIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "DeleteDataTablesDatatableAppTableIdResponse ") + @Schema(description = "DeleteDataTablesDatatableAppTableIdResponse ") public static final class DeleteDataTablesDatatableAppTableIdResponse { private DeleteDataTablesDatatableAppTableIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "DeleteDataTablesDatatableAppTableIdDatatableIdResponse ") + @Schema(description = "DeleteDataTablesDatatableAppTableIdDatatableIdResponse ") public static final class DeleteDataTablesDatatableAppTableIdDatatableIdResponse { private DeleteDataTablesDatatableAppTableIdDatatableIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResource.java index 6ef832978..4a8d61faf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -60,8 +60,7 @@ import org.springframework.stereotype.Component; @Path("/entityDatatableChecks") @Component @Scope("singleton") -@Api(tags = { "Entity Datatable Check" }) -@SwaggerDefinition(tags = { @Tag(name = "Entity Data Table", description = "This defines Entity-Datatable Check.") }) +@Tag(name = "Entity Data Table", description = "This defines Entity-Datatable Check.") public class EntityDatatableChecksApiResource { private final PlatformSecurityContext context; @@ -86,17 +85,17 @@ public class EntityDatatableChecksApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Entity-Datatable Checks", notes = "The list capability of Entity-Datatable Checks can support pagination.\n" + @Operation(summary = "List Entity-Datatable Checks", description = "The list capability of Entity-Datatable Checks can support pagination.\n" + "\n" + "OPTIONAL ARGUMENTS\n" + "offset Integer optional, defaults to 0 Indicates the result from which pagination startslimit Integer optional, defaults to 200 Restricts the size of results returned. To override the default and return all entries you must explicitly pass a non-positive integer value for limit e.g. limit=0, or limit=-1\n" + "Example Request:\n" + "\n" + "entityDatatableChecks?offset=0&limit=15") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksResponse.class, responseContainer = "list") }) - public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @ApiParam(value = "status") final Long status, - @QueryParam("entity") @ApiParam(value = "entity") final String entity, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit) { + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksResponse.class)))) }) + public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @Parameter(description = "status") final Long status, + @QueryParam("entity") @Parameter(description = "entity") final String entity, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit) { final SearchParameters searchParameters = SearchParameters.forPagination(offset, limit); final Page result = this.readEntityDatatableChecksService.retrieveAll(searchParameters, status, entity, productId); @@ -109,10 +108,10 @@ public class EntityDatatableChecksApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Entity-Datatable Checks Template", notes = "This is a convenience resource useful for building maintenance user interface screens for Entity-Datatable Checks applications. The template data returned consists of:\n" - + "\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "entityDatatableChecks/template") + @Operation(summary = "Retrieve Entity-Datatable Checks Template", description = "This is a convenience resource useful for building maintenance user interface screens for Entity-Datatable Checks applications. The template data returned consists of:\n" + + "\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "entityDatatableChecks/template") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksTemplateResponse.class))) }) public String getTemplate(@Context final UriInfo uriInfo) { final EntityDataTableChecksTemplateData result = this.readEntityDatatableChecksService.retrieveTemplate(); @@ -124,13 +123,12 @@ public class EntityDatatableChecksApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create Entity-Datatable Checks", notes = "Mandatory Fields : \n" + "entity, status, datatableName\n" + "\n" + @Operation(summary = "Create Entity-Datatable Checks", description = "Mandatory Fields : \n" + "entity, status, datatableName\n" + "\n" + "Non-Mandatory Fields : \n" + "productId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateResponse.class) }) - public String createEntityDatatableCheck(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.PostEntityDatatableChecksTemplateResponse.class))) }) + public String createEntityDatatableCheck(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createEntityDatatableChecks(apiRequestBodyAsJson).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); @@ -141,11 +139,11 @@ public class EntityDatatableChecksApiResource { @Path("{entityDatatableCheckId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete Entity-Datatable Checks", notes = "Deletes an existing Entity-Datatable Check") + @Operation(summary = "Delete Entity-Datatable Checks", description = "Deletes an existing Entity-Datatable Check") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = EntityDatatableChecksApiResourceSwagger.DeleteEntityDatatableChecksTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.DeleteEntityDatatableChecksTemplateResponse.class))) }) public String deleteDatatable( - @PathParam("entityDatatableCheckId") @ApiParam(value = "entityDatatableCheckId") final long entityDatatableCheckId, + @PathParam("entityDatatableCheckId") @Parameter(description = "entityDatatableCheckId") final long entityDatatableCheckId, final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResourceSwagger.java index aa2ef207c..00eb785d1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/EntityDatatableChecksApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import java.util.List; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -37,7 +36,7 @@ final class EntityDatatableChecksApiResourceSwagger { } - @ApiModel(value = "GetEntityDatatableChecksResponse") + @Schema(description = "GetEntityDatatableChecksResponse") public static final class GetEntityDatatableChecksResponse { private GetEntityDatatableChecksResponse() {} @@ -52,7 +51,7 @@ final class EntityDatatableChecksApiResourceSwagger { public String productName; } - @ApiModel(value = "GetEntityDatatableChecksTemplateResponse") + @Schema(description = "GetEntityDatatableChecksTemplateResponse") public static final class GetEntityDatatableChecksTemplateResponse { private GetEntityDatatableChecksTemplateResponse() {} @@ -67,42 +66,42 @@ final class EntityDatatableChecksApiResourceSwagger { public Collection savingsProductDatas; } - @ApiModel(value = "PostEntityDatatableChecksTemplateRequest") + @Schema(description = "PostEntityDatatableChecksTemplateRequest") public static final class PostEntityDatatableChecksTemplateRequest { private PostEntityDatatableChecksTemplateRequest() { } - @ApiModelProperty(example = "m_loan") + @Schema(example = "m_loan") public String entity; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Long status; - @ApiModelProperty(example = "Additional Details") + @Schema(example = "Additional Details") public String datatableName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long productId; } - @ApiModel(value = "PostEntityDatatableChecksTemplateResponse") + @Schema(description = "PostEntityDatatableChecksTemplateResponse") public static final class PostEntityDatatableChecksTemplateResponse { private PostEntityDatatableChecksTemplateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "DeleteEntityDatatableChecksTemplateResponse") + @Schema(description = "DeleteEntityDatatableChecksTemplateResponse") public static final class DeleteEntityDatatableChecksTemplateResponse { private DeleteEntityDatatableChecksTemplateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResource.java index d244745b8..1f13ab5a1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -59,8 +59,7 @@ import org.springframework.stereotype.Component; @Path("/reports") @Component @Scope("singleton") -@Api(tags = { "Reports" }) -@SwaggerDefinition(tags = { @Tag(name = "Reports", description = "Non-core reports can be added, updated and deleted.") }) +@Tag(name = "Reports", description = "Non-core reports can be added, updated and deleted.") public class ReportsApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "reportName", "reportType", "reportSubType", @@ -88,9 +87,9 @@ public class ReportsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Reports", notes = "Lists all reports and their parameters.\n" + "\n" + "Example Request:\n" + "\n" - + "reports", responseContainer = "List", response = ReportsApiResourceSwagger.GetReportsResponse.class) - @ApiResponses({ @ApiResponse(code = 200, message = "") }) + @Operation(summary = "List Reports", description = "Lists all reports and their parameters.\n" + "\n" + "Example Request:\n" + "\n" + + "reports") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsResponse.class)))) public String retrieveReportList(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -105,10 +104,11 @@ public class ReportsApiResource { @Path("{id}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Report\n", notes = "Example Requests:\n" + "\n" + "reports/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Report\n", description = "Example Requests:\n" + "\n" + "reports/1\n" + "\n" + "\n" + "reports/1?template=true") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.GetReportsResponse.class) }) - public String retrieveReport(@PathParam("id") @ApiParam(value = "id") final Long id, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsResponse.class))) }) + public String retrieveReport(@PathParam("id") @Parameter(description = "id") final Long id, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -126,9 +126,10 @@ public class ReportsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Report Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "\n" + "Example Request : \n" + "\n" + "reports/template") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.GetReportsTemplateResponse.class) }) + @Operation(summary = "Retrieve Report Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "\n" + "Example Request : \n" + "\n" + "reports/template") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsTemplateResponse.class))) }) public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -143,11 +144,11 @@ public class ReportsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Report", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportsApiResourceSwagger.PostRepostRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.PostReportsResponse.class) }) - public String createReport(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a Report", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PostRepostRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PostReportsResponse.class))) }) + public String createReport(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createReport().withJson(apiRequestBodyAsJson).build(); @@ -160,12 +161,12 @@ public class ReportsApiResource { @Path("{id}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Report", notes = "Only the useReport value can be updated for core reports.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportsApiResourceSwagger.PutReportRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.PutReportResponse.class) }) - public String updateReport(@PathParam("id") @ApiParam(value = "id") final Long id, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Report", description = "Only the useReport description can be updated for core reports.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PutReportRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.PutReportResponse.class))) }) + public String updateReport(@PathParam("id") @Parameter(description = "id") final Long id, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateReport(id).withJson(apiRequestBodyAsJson).build(); @@ -178,9 +179,10 @@ public class ReportsApiResource { @Path("{id}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Report", notes = "Only non-core reports can be deleted.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportsApiResourceSwagger.DeleteReportsResponse.class) }) - public String deleteReport(@PathParam("id") @ApiParam(value = "id") final Long id) { + @Operation(summary = "Delete a Report", description = "Only non-core reports can be deleted.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.DeleteReportsResponse.class))) }) + public String deleteReport(@PathParam("id") @Parameter(description = "id") final Long id) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteReport(id).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResourceSwagger.java index 248b567f6..5b60662bb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/ReportsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import java.util.List; import org.apache.fineract.infrastructure.dataqueries.data.ReportParameterData; @@ -33,35 +32,35 @@ final class ReportsApiResourceSwagger { } - @ApiModel(value = "GetReportsResponse") + @Schema(description = "GetReportsResponse") public static final class GetReportsResponse { private GetReportsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Client Listing") + @Schema(example = "Client Listing") public String reportName; - @ApiModelProperty(example = "Table") + @Schema(example = "Table") public String reportType; public String reportSubType; - @ApiModelProperty(example = "Client") + @Schema(example = "Client") public String reportCategory; - @ApiModelProperty(example = "Individual Client Report Lists the small number of defined fields on the client table. Would expect to copy this report and add any one to one additional data for specific tenant needs. Can be run for any size MFI but you expect it only to be run within a branch for larger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesnt have that client browser/memory impact).") + @Schema(example = "Individual Client Report Lists the small number of defined fields on the client table. Would expect to copy this report and add any one to one additional data for specific tenant needs. Can be run for any size MFI but you expect it only to be run within a branch for larger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesnt have that client browser/memory impact).") public String description; - @ApiModelProperty(example = "") + @Schema(example = "") public String reportSql; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean coreReport; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean useReport; public Collection reportParameters; } - @ApiModel(value = "GetReportsTemplateResponse") + @Schema(description = "GetReportsTemplateResponse") public static final class GetReportsTemplateResponse { private GetReportsTemplateResponse() { @@ -73,53 +72,53 @@ final class ReportsApiResourceSwagger { public Collection allowedParameters; } - @ApiModel(value = "PostRepostRequest") + @Schema(description = "PostRepostRequest") public static final class PostRepostRequest { private PostRepostRequest() { } - @ApiModelProperty(example = "Completely New Report") + @Schema(example = "Completely New Report") public String reportName; - @ApiModelProperty(example = "Table") + @Schema(example = "Table") public String reportType; - @ApiModelProperty(example = "") + @Schema(example = "") public String reportSubType; - @ApiModelProperty(example = "Loan") + @Schema(example = "Loan") public String reportCategory; - @ApiModelProperty(example = "Just An Example") + @Schema(example = "Just An Example") public String description; - @ApiModelProperty(example = "select 'very good sql' as AComment") + @Schema(example = "select 'very good sql' as AComment") public String reportSql; public Collection reportParameters; } - @ApiModel(value = "PostReportsResponse") + @Schema(description = "PostReportsResponse") public static final class PostReportsResponse { private PostReportsResponse() { } - @ApiModelProperty(example = "132") + @Schema(example = "132") public long resourceId; } - @ApiModel(value = "PutReportRequest") + @Schema(description = "PutReportRequest") public static final class PutReportRequest { private PutReportRequest() { } - @ApiModelProperty(example = "Completely New Report") + @Schema(example = "Completely New Report") public String reportName; public Collection reportParameters; } - @ApiModel(value = "PutReportResponse") + @Schema(description = "PutReportResponse") public static final class PutReportResponse { private PutReportResponse() { @@ -132,24 +131,24 @@ final class ReportsApiResourceSwagger { } - @ApiModelProperty(example = "Changed New Report") + @Schema(example = "Changed New Report") public String reportName; public Collection reportParameters; } - @ApiModelProperty(example = "132") + @Schema(example = "132") public long resourceId; public PutReportResponseChanges changes; } - @ApiModel(value = "DeleteReportsResponse") + @Schema(description = "DeleteReportsResponse") public static final class DeleteReportsResponse { private DeleteReportsResponse() { } - @ApiModelProperty(example = "132") + @Schema(example = "132") public long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java index d82042a6c..ee05b1bb7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.File; import java.util.HashMap; import java.util.Map; @@ -62,8 +62,7 @@ import org.springframework.stereotype.Component; @Path("/runreports") @Component @Scope("singleton") -@Api(tags = { "Run Reports" }) -@SwaggerDefinition(tags = { @Tag(name = "Run Reports", description = "") }) +@Tag(name = "Run Reports", description = "") public class RunreportsApiResource { private final PlatformSecurityContext context; @@ -87,7 +86,7 @@ public class RunreportsApiResource { @Path("{reportName}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON, "text/csv", "application/vnd.ms-excel", "application/pdf", "text/html" }) - @ApiOperation(value = "Running a Report", notes = "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n" + @Operation(summary = "Running a Report", description = "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n" + "\n" + "Reports can also be used to provide data for searching and workflow functionality.\n" + "\n" + "The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n" + "\n" @@ -105,10 +104,11 @@ public class RunreportsApiResource { + "runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1\n" + "\n" + "\n" + "runreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RunreportsApiResourceSwagger.GetReportNameResponse.class) }) - public Response runReport(@PathParam("reportName") @ApiParam(value = "reportName") final String reportName, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RunreportsApiResourceSwagger.GetReportNameResponse.class))) }) + public Response runReport(@PathParam("reportName") @Parameter(description = "reportName") final String reportName, @Context final UriInfo uriInfo, - @DefaultValue("false") @QueryParam("isSelfServiceUserReport") @ApiParam(value = "isSelfServiceUserReport") final boolean isSelfServiceUserReport) { + @DefaultValue("false") @QueryParam("isSelfServiceUserReport") @Parameter(description = "isSelfServiceUserReport") final boolean isSelfServiceUserReport) { final MultivaluedMap queryParams = uriInfo.getQueryParameters(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResourceSwagger.java index 7d4393afb..63fb56294 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/RunreportsApiResourceSwagger.java @@ -18,7 +18,7 @@ */ package org.apache.fineract.infrastructure.dataqueries.api; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData; import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData; @@ -31,7 +31,7 @@ final class RunreportsApiResourceSwagger { } - @ApiModel(value = "GetReportNameResponse") + @Schema(description = "GetReportNameResponse") public static final class GetReportNameResponse { private GetReportNameResponse() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java index 2aa88d349..da9912085 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResource.java @@ -21,13 +21,14 @@ package org.apache.fineract.infrastructure.documentmanagement.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataBodyPart; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -64,12 +65,10 @@ import org.springframework.stereotype.Component; @Path("{entityType}/{entityId}/documents") @Component @Scope("singleton") -@Api(tags = { "Documents" }) -@SwaggerDefinition(tags = { - @Tag(name = "Documents", description = "Multiple Documents (a combination of a name, description and a file) may be attached to different Entities like Clients, Groups, Staff, Loans, Savings and Client Identifiers in the system\n" - + "\n" + "Note: The currently allowed Entities are\n" + "\n" + "Clients: URL Pattern as clients\n" - + "Staff: URL Pattern as staff\n" + "Loans: URL Pattern as loans\n" + "Savings: URL Pattern as savings\n" - + "Client Identifiers: URL Pattern as client_identifiers\n" + "Groups: URL Pattern as groups") }) +@Tag(name = "Documents", description = "Multiple Documents (a combination of a name, description and a file) may be attached to different Entities like Clients, Groups, Staff, Loans, Savings and Client Identifiers in the system\n" + + "\n" + "Note: The currently allowed Entities are\n" + "\n" + "Clients: URL Pattern as clients\n" + "Staff: URL Pattern as staff\n" + + "Loans: URL Pattern as loans\n" + "Savings: URL Pattern as savings\n" + "Client Identifiers: URL Pattern as client_identifiers\n" + + "Groups: URL Pattern as groups") public class DocumentManagementApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -97,13 +96,13 @@ public class DocumentManagementApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List documents", notes = "Example Requests:\n" + "\n" + "clients/1/documents\n" + "\n" + @Operation(summary = "List documents", description = "Example Requests:\n" + "\n" + "clients/1/documents\n" + "\n" + "client_identifiers/1/documents\n" + "\n" + "loans/1/documents?fields=name,description") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class)))) }) public String retreiveAllDocuments(@Context final UriInfo uriInfo, - @PathParam("entityType") @ApiParam(value = "entityType") final String entityType, - @PathParam("entityId") @ApiParam(value = "entityId") final Long entityId) { + @PathParam("entityType") @Parameter(description = "entityType") final String entityType, + @PathParam("entityId") @Parameter(description = "entityId") final Long entityId) { this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType); @@ -116,20 +115,20 @@ public class DocumentManagementApiResource { @POST @Consumes({ MediaType.MULTIPART_FORM_DATA }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Document", notes = "Note: A document is created using a Multi-part form upload \n" + "\n" + @Operation(summary = "Create a Document", description = "Note: A document is created using a Multi-part form upload \n" + "\n" + "Body Parts\n" + "\n" + "name : \n" + "Name or summary of the document\n" + "\n" + "description : \n" + "Description of the document\n" + "\n" + "file : \n" + "The file to be uploaded\n" + "\n" + "Mandatory Fields : \n" + "file and description") @ApiResponses({ - @ApiResponse(code = 200, message = "Not Shown (multi-part form data)", response = DocumentManagementApiResourceSwagger.PostEntityTypeEntityIdDocumentsResponse.class) }) - public String createDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType, - @PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @HeaderParam("Content-Length") @ApiParam(value = "Content-Length") final Long fileSize, - @FormDataParam("file") @ApiParam(value = "file") final InputStream inputStream, - @FormDataParam("file") final @ApiParam(value = "file") FormDataContentDisposition fileDetails, - @FormDataParam("file") @ApiParam(value = "file") final FormDataBodyPart bodyPart, - @FormDataParam("name") @ApiParam(value = "name") final String name, - @FormDataParam("description") @ApiParam(value = "description") final String description) { + @ApiResponse(responseCode = "200", description = "Not Shown (multi-part form data)", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.PostEntityTypeEntityIdDocumentsResponse.class))) }) + public String createDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType, + @PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @HeaderParam("Content-Length") @Parameter(description = "Content-Length") final Long fileSize, + @FormDataParam("file") @Parameter(description = "file") final InputStream inputStream, + @FormDataParam("file") final @Parameter(description = "file") FormDataContentDisposition fileDetails, + @FormDataParam("file") @Parameter(description = "file") final FormDataBodyPart bodyPart, + @FormDataParam("name") @Parameter(description = "name") final String name, + @FormDataParam("description") @Parameter(description = "description") final String description) { /** * TODO: also need to have a backup and stop reading from stream after max size is reached to protect against @@ -151,20 +150,20 @@ public class DocumentManagementApiResource { @Path("{documentId}") @Consumes({ MediaType.MULTIPART_FORM_DATA }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Document", notes = "Note: A document is updated using a Multi-part form upload \n" + "Body Parts\n" + @Operation(summary = "Update a Document", description = "Note: A document is updated using a Multi-part form upload \n" + "Body Parts\n" + "name\n" + "Name or summary of the document\n" + "description\n" + "Description of the document\n" + "file\n" + "The file to be uploaded") @ApiResponses({ - @ApiResponse(code = 200, message = "Not Shown (multi-part form data)", response = DocumentManagementApiResourceSwagger.PutEntityTypeEntityIdDocumentsResponse.class) }) - public String updateDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType, - @PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @PathParam("documentId") @ApiParam(value = "documentId") final Long documentId, - @HeaderParam("Content-Length") @ApiParam(value = "Content-Length") final Long fileSize, - @FormDataParam("file") @ApiParam(value = "file") final InputStream inputStream, - @FormDataParam("file") @ApiParam(value = "file") final FormDataContentDisposition fileDetails, - @FormDataParam("file") @ApiParam(value = "file") final FormDataBodyPart bodyPart, - @FormDataParam("name") @ApiParam(value = "name") final String name, - @FormDataParam("description") @ApiParam(value = "description") final String description) { + @ApiResponse(responseCode = "200", description = "Not Shown (multi-part form data)", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.PutEntityTypeEntityIdDocumentsResponse.class))) }) + public String updateDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType, + @PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @PathParam("documentId") @Parameter(description = "documentId") final Long documentId, + @HeaderParam("Content-Length") @Parameter(description = "Content-Length") final Long fileSize, + @FormDataParam("file") @Parameter(description = "file") final InputStream inputStream, + @FormDataParam("file") @Parameter(description = "file") final FormDataContentDisposition fileDetails, + @FormDataParam("file") @Parameter(description = "file") final FormDataBodyPart bodyPart, + @FormDataParam("name") @Parameter(description = "name") final String name, + @FormDataParam("description") @Parameter(description = "description") final String description) { final Set modifiedParams = new HashSet<>(); modifiedParams.add("name"); @@ -197,13 +196,13 @@ public class DocumentManagementApiResource { @Path("{documentId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Document", notes = "Example Requests:\n" + "\n" + "clients/1/documents/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Document", description = "Example Requests:\n" + "\n" + "clients/1/documents/1\n" + "\n" + "\n" + "loans/1/documents/1\n" + "\n" + "\n" + "client_identifiers/1/documents/1?fields=name,description") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class) }) - public String getDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType, - @PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @PathParam("documentId") @ApiParam(value = "documentId") final Long documentId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.GetEntityTypeEntityIdDocumentsResponse.class))) }) + public String getDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType, + @PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @PathParam("documentId") @Parameter(description = "documentId") final Long documentId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType); @@ -217,12 +216,12 @@ public class DocumentManagementApiResource { @Path("{documentId}/attachment") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_OCTET_STREAM }) - @ApiOperation(value = "Retrieve Binary File associated with Document", notes = "Request used to download the file associated with the document\n" + @Operation(summary = "Retrieve Binary File associated with Document", description = "Request used to download the file associated with the document\n" + "\n" + "Example Requests:\n" + "\n" + "clients/1/documents/1/attachment\n" + "\n" + "\n" + "loans/1/documents/1/attachment") - @ApiResponses({ @ApiResponse(code = 200, message = "Not Shown: The corresponding Binary file") }) - public Response downloadFile(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType, - @PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @PathParam("documentId") @ApiParam(value = "documentId") final Long documentId) { + @ApiResponses({ @ApiResponse(responseCode = "200", description = "Not Shown: The corresponding Binary file") }) + public Response downloadFile(@PathParam("entityType") @Parameter(description = "entityType") final String entityType, + @PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @PathParam("documentId") @Parameter(description = "documentId") final Long documentId) { this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType); @@ -238,12 +237,12 @@ public class DocumentManagementApiResource { @Path("{documentId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Remove a Document", notes = "") + @Operation(summary = "Remove a Document", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = DocumentManagementApiResourceSwagger.DeleteEntityTypeEntityIdDocumentsResponse.class) }) - public String deleteDocument(@PathParam("entityType") @ApiParam(value = "entityType") final String entityType, - @PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @PathParam("documentId") @ApiParam(value = "documentId") final Long documentId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = DocumentManagementApiResourceSwagger.DeleteEntityTypeEntityIdDocumentsResponse.class))) }) + public String deleteDocument(@PathParam("entityType") @Parameter(description = "entityType") final String entityType, + @PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @PathParam("documentId") @Parameter(description = "documentId") final Long documentId) { final DocumentCommand documentCommand = new DocumentCommand(null, documentId, entityType, entityId, null, null, null, null, null, null); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java index 94dd1754e..0d9dc4eec 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/DocumentManagementApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.documentmanagement.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 7/8/17. @@ -31,49 +30,49 @@ final class DocumentManagementApiResourceSwagger { } - @ApiModel(value = "GetEntityTypeEntityIdDocumentsResponse") + @Schema(description = "GetEntityTypeEntityIdDocumentsResponse") public static final class GetEntityTypeEntityIdDocumentsResponse { private GetEntityTypeEntityIdDocumentsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "clients") + @Schema(example = "clients") public String parentEntityType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long parentEntityId; - @ApiModelProperty(example = "Client Details Form") + @Schema(example = "Client Details Form") public String name; - @ApiModelProperty(example = "CGAP.pdf") + @Schema(example = "CGAP.pdf") public String fileName; - @ApiModelProperty(example = "5246719") + @Schema(example = "5246719") public Long size; - @ApiModelProperty(example = "application/pdf") + @Schema(example = "application/pdf") public String type; - @ApiModelProperty(example = "A signed form signed by new member") + @Schema(example = "A signed form signed by new member") public String description; - @ApiModelProperty(example = "") + @Schema(example = "") public String location; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer storageType; } - @ApiModel(value = "PostEntityTypeEntityIdDocumentsResponse") + @Schema(description = "PostEntityTypeEntityIdDocumentsResponse") public static final class PostEntityTypeEntityIdDocumentsResponse { private PostEntityTypeEntityIdDocumentsResponse() { } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long resourceId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public String resourceIdentifier; } - @ApiModel(value = "PutEntityTypeEntityIdDocumentsResponse") + @Schema(description = "PutEntityTypeEntityIdDocumentsResponse") public static final class PutEntityTypeEntityIdDocumentsResponse { private PutEntityTypeEntityIdDocumentsResponse() { @@ -88,14 +87,14 @@ final class DocumentManagementApiResourceSwagger { } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long resourceId; public PutEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes; - @ApiModelProperty(example = "3") + @Schema(example = "3") public String resourceIdentifier; } - @ApiModel(value = "DeleteEntityTypeEntityIdDocumentsResponse") + @Schema(description = "DeleteEntityTypeEntityIdDocumentsResponse") public static final class DeleteEntityTypeEntityIdDocumentsResponse { private DeleteEntityTypeEntityIdDocumentsResponse() { @@ -110,10 +109,10 @@ final class DocumentManagementApiResourceSwagger { } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long resourceId; public DeleteEntityTypeEntityIdDocumentsResponse.PutEntityTypeEntityIdDocumentsResponseChangesSwagger changes; - @ApiModelProperty(example = "3") + @Schema(example = "3") public String resourceIdentifier; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java index d587b7b95..1d681fcdf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java @@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.documentmanagement.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataBodyPart; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; import java.io.InputStream; import java.util.Base64; import javax.ws.rs.Consumes; @@ -56,7 +55,7 @@ import org.springframework.stereotype.Component; @Path("{entity}/{entityId}/images") @Component @Scope("singleton") -@Api(value = "DomainName//api//v1//{entity}//{entityId}//images", description = "") + public class ImagesApiResource { private final PlatformSecurityContext context; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/api/FineractEntityApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/api/FineractEntityApiResource.java index 74d3715eb..04621372b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/api/FineractEntityApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/api/FineractEntityApiResource.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.infrastructure.entityaccess.api; -import io.swagger.annotations.Api; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -51,7 +50,7 @@ import org.springframework.stereotype.Component; @Produces({ MediaType.APPLICATION_JSON }) @Component @Scope("singleton") -@Api(value = "DomainName/api/v1/entitytoentitymapping", description = "") // https://github.com/swagger-api/swagger-ui/issues/1655 + public class FineractEntityApiResource { private final PlatformSecurityContext context; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResource.java index 1d6f00180..3be95524e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResource.java @@ -21,15 +21,15 @@ package org.apache.fineract.infrastructure.hooks.api; import static org.apache.fineract.infrastructure.hooks.api.HookApiConstants.HOOK_RESOURCE_NAME; import static org.apache.fineract.infrastructure.hooks.api.HookApiConstants.RESPONSE_DATA_PARAMETERS; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -61,9 +61,7 @@ import org.springframework.stereotype.Component; @Produces({ MediaType.APPLICATION_JSON }) @Component @Scope("singleton") -@Api(tags = { "Hooks" }) -@SwaggerDefinition(tags = { - @Tag(name = "Hooks", description = "Hooks are a mechanism to trigger custom code on the occurence of events. ") }) +@Tag(name = "Hooks", description = "Hooks are a mechanism to trigger custom code on the occurence of events. ") public class HookApiResource { private final PlatformSecurityContext context; @@ -84,10 +82,9 @@ public class HookApiResource { } @GET - @ApiOperation(value = "Retrieve Hooks", notes = "Returns the list of hooks.\n" + "\n" + "Example Requests:\n" + "\n" - + "hooks", responseContainer = "List", response = HookApiResourceSwagger.GetHookResponse.class) + @Operation(summary = "Retrieve Hooks", description = "Returns the list of hooks.\n" + "\n" + "Example Requests:\n" + "\n" + "hooks") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.GetHookResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = HookApiResourceSwagger.GetHookResponse.class)))) }) public String retrieveHooks(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME); @@ -100,9 +97,11 @@ public class HookApiResource { @GET @Path("{hookId}") - @ApiOperation(value = "Retrieve a Hook", notes = "Returns the details of a Hook.\n" + "\n" + "Example Requests:\n" + "\n" + "hooks/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.GetHookResponse.class) }) - public String retrieveHook(@PathParam("hookId") @ApiParam(value = "hookId") final Long hookId, @Context final UriInfo uriInfo) { + @Operation(summary = "Retrieve a Hook", description = "Returns the details of a Hook.\n" + "\n" + "Example Requests:\n" + "\n" + + "hooks/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.GetHookResponse.class))) }) + public String retrieveHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME); @@ -119,9 +118,10 @@ public class HookApiResource { @GET @Path("template") - @ApiOperation(value = "Retrieve Hooks Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "hooks/template") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.GetHookTemplateResponse.class) }) + @Operation(summary = "Retrieve Hooks Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "hooks/template") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.GetHookTemplateResponse.class))) }) public String template(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(HOOK_RESOURCE_NAME); @@ -133,16 +133,16 @@ public class HookApiResource { } @POST - @ApiOperation(value = "Create a Hook", notes = "The following parameters can be passed for the creation of a hook :-\n" + "\n" + @Operation(summary = "Create a Hook", description = "The following parameters can be passed for the creation of a hook :-\n" + "\n" + "name - string - Required. The name of the template that is being called. (See /hooks/template for the list of valid hook names.)\n" + "\n" + "isActive - boolean - Determines whether the hook is actually triggered.\n" + "\n" + "events - array - Determines what events the hook is triggered for.\n" + "\n" + "config - hash - Required. Key/value pairs to provide settings for this hook. These settings vary between the templates.\n" + "\n" + "templateId - Optional. The UGD template ID associated with the same entity (client or loan).") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", dataType = "body", required = true, type = "body", dataTypeClass = HookApiResourceSwagger.PostHookRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.PostHookResponse.class) }) - public String createHook(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PostHookRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PostHookResponse.class))) }) + public String createHook(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createHook().withJson(apiRequestBodyAsJson).build(); @@ -153,12 +153,12 @@ public class HookApiResource { @PUT @Path("{hookId}") - @ApiOperation(value = "Update a Hook", notes = "Updates the details of a hook.") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", dataType = "body", required = true, type = "body", dataTypeClass = HookApiResourceSwagger.PutHookRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.PutHookResponse.class) }) - public String updateHook(@PathParam("hookId") @ApiParam(value = "hookId") final Long hookId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Hook", description = "Updates the details of a hook.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PutHookRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.PutHookResponse.class))) }) + public String updateHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHook(hookId).withJson(apiRequestBodyAsJson).build(); @@ -169,9 +169,10 @@ public class HookApiResource { @DELETE @Path("{hookId}") - @ApiOperation(value = "Delete a Hook", notes = "Deletes a hook.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HookApiResourceSwagger.DeleteHookResponse.class) }) - public String deleteHook(@PathParam("hookId") @ApiParam(value = "hookId") final Long hookId) { + @Operation(summary = "Delete a Hook", description = "Deletes a hook.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HookApiResourceSwagger.DeleteHookResponse.class))) }) + public String deleteHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHook(hookId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResourceSwagger.java index 0c4703f11..383cd9ee1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/api/HookApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.hooks.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.infrastructure.hooks.data.Event; import org.apache.fineract.infrastructure.hooks.data.Field; @@ -37,64 +36,64 @@ final class HookApiResourceSwagger { } - @ApiModel(value = "PostHookRequest") + @Schema(description = "PostHookRequest") public static final class PostHookRequest { private PostHookRequest() { } - @ApiModelProperty(example = "Web") + @Schema(example = "Web") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "Kremlin") + @Schema(example = "Kremlin") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long templateId; public List events; public List config; } - @ApiModel(value = "PostHookResponse") + @Schema(description = "PostHookResponse") public static final class PostHookResponse { private PostHookResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } - @ApiModel(value = "GetHookResponse") + @Schema(description = "GetHookResponse") public static final class GetHookResponse { private GetHookResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Web") + @Schema(example = "Web") public String name; - @ApiModelProperty(example = "Kremlin") + @Schema(example = "Kremlin") public String displayName; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "[2014, 9, 16]") + @Schema(example = "[2014, 9, 16]") public LocalDate createdAt; - @ApiModelProperty(example = "[2014, 9, 16]") + @Schema(example = "[2014, 9, 16]") public LocalDate updatedAt; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long templateId; - @ApiModelProperty(example = "My UGD") + @Schema(example = "My UGD") public String templateName; public List events; public List config; } - @ApiModel(value = "GetHookTemplateResponse") + @Schema(description = "GetHookTemplateResponse") public static final class GetHookTemplateResponse { private GetHookTemplateResponse() { @@ -105,37 +104,37 @@ final class HookApiResourceSwagger { public List groupings; } - @ApiModel(value = "DeleteHookResponse") + @Schema(description = "DeleteHookResponse") public static final class DeleteHookResponse { private DeleteHookResponse() { } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; } - @ApiModel(value = "PutHookRequest") + @Schema(description = "PutHookRequest") public static final class PutHookRequest { private PutHookRequest() { } - @ApiModelProperty(example = "Web") + @Schema(example = "Web") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "Kremlin") + @Schema(example = "Kremlin") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long templateId; public List events; public List config; } - @ApiModel(value = "PutHookResponse") + @Schema(description = "PutHookResponse") public static final class PutHookResponse { private PutHookResponse() { @@ -146,14 +145,14 @@ final class HookApiResourceSwagger { private PutHookResponseChangesSwagger() {} - @ApiModelProperty(example = "Kremlin") + @Schema(example = "Kremlin") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public List events; public List config; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long resourceId; public PutHookResponseChangesSwagger changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java index 448c4fda5..af877d5ca 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.infrastructure.jobs.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -49,8 +49,8 @@ import org.springframework.stereotype.Component; @Path("/scheduler") @Component -@Api(tags = { "Scheduler" }) -@SwaggerDefinition(tags = { @Tag(name = "Scheduler", description = "") }) + +@Tag(name = "Scheduler", description = "") public class SchedulerApiResource { private final PlatformSecurityContext context; @@ -70,9 +70,10 @@ public class SchedulerApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Scheduler Status", notes = "Returns the scheduler status.\n" + "\n" + "Example Requests:\n" + "\n" + @Operation(summary = "Retrieve Scheduler Status", description = "Returns the scheduler status.\n" + "\n" + "Example Requests:\n" + "\n" + "scheduler") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SchedulerApiResourceSwagger.GetSchedulerResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SchedulerApiResourceSwagger.GetSchedulerResponse.class))) }) public String retrieveStatus(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME); final boolean isSchedulerRunning = this.jobRegisterService.isSchedulerRunning(); @@ -85,10 +86,11 @@ public class SchedulerApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Activate Scheduler Jobs | Suspend Scheduler Jobs", notes = "Activates the scheduler job service. | Suspends the scheduler job service.") - @ApiResponses({ @ApiResponse(code = 200, message = "POST : scheduler?command=start\n\n" + "\n" + "POST : scheduler?command=stop") }) + @Operation(summary = "Activate Scheduler Jobs | Suspend Scheduler Jobs", description = "Activates the scheduler job service. | Suspends the scheduler job service.") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "POST : scheduler?command=start\n\n" + "\n" + + "POST : scheduler?command=stop") }) public Response changeSchedulerStatus( - @QueryParam(SchedulerJobApiConstants.COMMAND) @ApiParam(value = "command") final String commandParam) { + @QueryParam(SchedulerJobApiConstants.COMMAND) @Parameter(description = "command") final String commandParam) { // check the logged in user have permissions to update scheduler status final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "UPDATE_SCHEDULER"); if (hasNotPermission) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResourceSwagger.java index 3b462ed6d..1d9960fac 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.jobs.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 12/8/17. @@ -30,14 +29,14 @@ final class SchedulerApiResourceSwagger { } - @ApiModel(value = "GetSchedulerResponse") + @Schema(description = "GetSchedulerResponse") public static final class GetSchedulerResponse { private GetSchedulerResponse() { } - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean active; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResource.java index e9635fb43..3967c8f57 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.jobs.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -64,9 +64,7 @@ import org.springframework.stereotype.Component; @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Component -@Api(tags = { "MIFOSX-BATCH JOBS" }) -@SwaggerDefinition(tags = { - @Tag(name = "MIFOSX-BATCH JOBS", description = "Batch jobs (also known as cron jobs on Unix-based systems) are a series of back-end jobs executed on a computer at a particular time defined in job's cron expression.\n\n At any point, you can view the list of batch jobs scheduled to run along with other details specific to each job. Manually you can execute the jobs at any point of time.\n\n The scheduler status can be either \"Active\" or \"Standby\". If the scheduler status is Active, it indicates that all batch jobs are running/ will run as per the specified schedule.If the scheduler status is Standby, it will ensure all scheduled batch runs are suspended.") }) +@Tag(name = "MIFOSX-BATCH JOBS", description = "Batch jobs (also known as cron jobs on Unix-based systems) are a series of back-end jobs executed on a computer at a particular time defined in job's cron expression.\n\n At any point, you can view the list of batch jobs scheduled to run along with other details specific to each job. Manually you can execute the jobs at any point of time.\n\n The scheduler status can be either \"Active\" or \"Standby\". If the scheduler status is Active, it indicates that all batch jobs are running/ will run as per the specified schedule.If the scheduler status is Standby, it will ensure all scheduled batch runs are suspended.") public class SchedulerJobApiResource { private final SchedulerJobRunnerReadService schedulerJobRunnerReadService; @@ -93,9 +91,10 @@ public class SchedulerJobApiResource { } @GET - @ApiOperation(value = "Retrieve Scheduler Jobs", notes = "Returns the list of jobs.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs") + @Operation(summary = "Retrieve Scheduler Jobs", description = "Returns the list of jobs.\n" + "\n" + "Example Requests:\n" + "\n" + + "jobs") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = SchedulerJobApiResourceSwagger.GetJobsResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME); final List jobDetailDatas = this.schedulerJobRunnerReadService.findAllJobDeatils(); @@ -105,9 +104,10 @@ public class SchedulerJobApiResource { @GET @Path("{" + SchedulerJobApiConstants.JOB_ID + "}") - @ApiOperation(value = "Retrieve a Job", notes = "Returns the details of a Job.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs/5") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SchedulerJobApiResourceSwagger.GetJobsResponse.class) }) - public String retrieveOne(@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId, + @Operation(summary = "Retrieve a Job", description = "Returns the details of a Job.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs/5") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsResponse.class))) }) + public String retrieveOne(@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME); final JobDetailData jobDetailData = this.schedulerJobRunnerReadService.retrieveOne(jobId); @@ -117,15 +117,15 @@ public class SchedulerJobApiResource { @GET @Path("{" + SchedulerJobApiConstants.JOB_ID + "}/" + SchedulerJobApiConstants.JOB_RUN_HISTORY) - @ApiOperation(value = "Retrieve Job Run History", notes = "Example Requests:\n" + "\n" + "jobs/5/runhistory?offset=0&limit=200") + @Operation(summary = "Retrieve Job Run History", description = "Example Requests:\n" + "\n" + "jobs/5/runhistory?offset=0&limit=200") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = SchedulerJobApiResourceSwagger.GetJobsJobIDJobRunHistoryResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsJobIDJobRunHistoryResponse.class))) }) public String retrieveHistory(@Context final UriInfo uriInfo, - @PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME); final SearchParameters searchParameters = SearchParameters.forPagination(offset, limit, orderBy, sortOrder); final Page jobhistoryDetailData = this.schedulerJobRunnerReadService.retrieveJobHistory(jobId, @@ -137,10 +137,10 @@ public class SchedulerJobApiResource { @POST @Path("{" + SchedulerJobApiConstants.JOB_ID + "}") - @ApiOperation(value = "Run a Job", notes = "Manually Execute Specific Job.") - @ApiResponses({ @ApiResponse(code = 200, message = "POST: jobs/1?command=executeJob") }) - public Response executeJob(@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId, - @QueryParam(SchedulerJobApiConstants.COMMAND) @ApiParam(value = "command") final String commandParam) { + @Operation(summary = "Run a Job", description = "Manually Execute Specific Job.") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "POST: jobs/1?command=executeJob") }) + public Response executeJob(@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId, + @QueryParam(SchedulerJobApiConstants.COMMAND) @Parameter(description = "command") final String commandParam) { // check the logged in user have permissions to execute scheduler jobs final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "EXECUTEJOB_SCHEDULER"); if (hasNotPermission) { @@ -159,12 +159,11 @@ public class SchedulerJobApiResource { @PUT @Path("{" + SchedulerJobApiConstants.JOB_ID + "}") - @ApiOperation(value = "Update a Job", notes = "Updates the details of a job.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SchedulerJobApiResourceSwagger.PutJobsJobIDRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "") }) - public String updateJobDetail(@PathParam(SchedulerJobApiConstants.JOB_ID) @ApiParam(value = "jobId") final Long jobId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(summary = "Update a Job", description = "Updates the details of a job.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.PutJobsJobIDRequest.class))) + @ApiResponses({ @ApiResponse(responseCode = "200", description = "") }) + public String updateJobDetail(@PathParam(SchedulerJobApiConstants.JOB_ID) @Parameter(description = "jobId") final Long jobId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateJobDetail(jobId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResourceSwagger.java index 641debd71..1224abe06 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.jobs.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Date; import java.util.List; import org.apache.fineract.infrastructure.jobs.data.JobDetailHistoryData; @@ -33,47 +32,47 @@ final class SchedulerJobApiResourceSwagger { } - @ApiModel(value = "GetJobsResponse") + @Schema(description = "GetJobsResponse") public static final class GetJobsResponse { private GetJobsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long jobId; - @ApiModelProperty(example = "Update loan Summary") + @Schema(example = "Update loan Summary") public String displayName; - @ApiModelProperty(example = "") + @Schema(example = "") public Date nextRunTime; - @ApiModelProperty(example = "") + @Schema(example = "") public String initializingError; - @ApiModelProperty(example = "0 0 22 1/1 * ? *") + @Schema(example = "0 0 22 1/1 * ? *") public String cronExpression; - @ApiModelProperty(example = "false") + @Schema(example = "false") public boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public boolean currentlyRunning; public JobDetailHistoryData lastRunHistory; } - @ApiModel(value = "PutJobsJobsIDRequest") + @Schema(description = "PutJobsJobsIDRequest") public static final class PutJobsJobIDRequest { private PutJobsJobIDRequest() { } - @ApiModelProperty(example = "Update loan Summary") + @Schema(example = "Update loan Summary") public String displayName; - @ApiModelProperty(example = "0 0 22 1/1 * ? *") + @Schema(example = "0 0 22 1/1 * ? *") public String cronExpression; - @ApiModelProperty(example = "false") + @Schema(example = "false") public boolean active; } - @ApiModel(value = "GetJobsJobIDJobRunHistoryResponse") + @Schema(description = "GetJobsJobIDJobRunHistoryResponse") public static final class GetJobsJobIDJobRunHistoryResponse { private GetJobsJobIDJobRunHistoryResponse() { @@ -84,19 +83,19 @@ final class SchedulerJobApiResourceSwagger { private JobDetailHistoryDataSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long version; - @ApiModelProperty(example = "Jul 16, 2013 12:00:00 PM") + @Schema(example = "Jul 16, 2013 12:00:00 PM") public Date jobRunStartTime; - @ApiModelProperty(example = "Jul 16, 2013 12:00:00 PM") + @Schema(example = "Jul 16, 2013 12:00:00 PM") public Date jobRunEndTime; - @ApiModelProperty(example = "success") + @Schema(example = "success") public String status; - @ApiModelProperty(example = "cron") + @Schema(example = "cron") public String triggerType; } - @ApiModelProperty(example = "8") + @Schema(example = "8") public int totalFilteredRecords; public List pageItems; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResource.java index 076fc65e8..577f47fbe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.infrastructure.reportmailingjob.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -59,9 +59,7 @@ import org.springframework.stereotype.Component; @Path("/" + ReportMailingJobConstants.REPORT_MAILING_JOB_RESOURCE_NAME) @Component @Scope("singleton") -@Api(tags = { "Report Mailing Jobs" }) -@SwaggerDefinition(tags = { - @Tag(name = "Report Mailing Jobs", description = "This resource allows you to create a scheduled job that runs a report and sents it by email to specified email addresses.\n\nThe scheduled job can be configured to run once or on a regular basis (once a day, twice a week, etc)") }) +@Tag(name = "Report Mailing Jobs", description = "This resource allows you to create a scheduled job that runs a report and sents it by email to specified email addresses.\n\nThe scheduled job can be configured to run once or on a regular basis (once a day, twice a week, etc)") public class ReportMailingJobApiResource { private final PlatformSecurityContext platformSecurityContext; @@ -86,14 +84,13 @@ public class ReportMailingJobApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Report Mailing Job", notes = "Mandatory Fields: " + @Operation(summary = "Create a Report Mailing Job", description = "Mandatory Fields: " + "name, startDateTime, stretchyReportId, emailRecipients, emailSubject, emailMessage, emailAttachmentFileFormatId, recurrence, isActive\n" + "\n" + "Optional Fields: " + "description, stretchyReportParamMap") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportMailingJobApiResourceSwagger.PostReportMailingJobsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PostReportMailingJobsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.PostReportMailingJobsResponse.class) }) - public String createReportMailingJob(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PostReportMailingJobsResponse.class))) }) + public String createReportMailingJob(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandWrapper = new CommandWrapperBuilder() .createReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME).withJson(apiRequestBodyAsJson).build(); @@ -106,13 +103,12 @@ public class ReportMailingJobApiResource { @Path("{entityId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Report Mailing Job\n", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportMailingJobApiResourceSwagger.PutReportMailingJobsRequest.class) }) + @Operation(summary = "Update a Report Mailing Job\n", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PutReportMailingJobsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.PutReportMailingJobsResponse.class) }) - public String updateReportMailingJob(@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.PutReportMailingJobsResponse.class))) }) + public String updateReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandWrapper = new CommandWrapperBuilder() .updateReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME, entityId).withJson(apiRequestBodyAsJson) .build(); @@ -126,13 +122,12 @@ public class ReportMailingJobApiResource { @Path("{entityId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Report Mailing Job", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsRequest.class) }) + @Operation(summary = "Delete a Report Mailing Job", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsResponse.class) }) - public String deleteReportMailingJob(@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.DeleteReportMailingJobsResponse.class))) }) + public String deleteReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandWrapper = new CommandWrapperBuilder() .deleteReportMailingJob(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME, entityId).withJson(apiRequestBodyAsJson) .build(); @@ -146,11 +141,11 @@ public class ReportMailingJobApiResource { @Path("{entityId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Report Mailing Job", notes = "Example Requests:\n" + "\n" + "reportmailingjobs/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Report Mailing Job", description = "Example Requests:\n" + "\n" + "reportmailingjobs/1\n" + "\n" + "\n" + "reportmailingjobs/1?template=true") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class) }) - public String retrieveReportMailingJob(@PathParam("entityId") @ApiParam(value = "entityId") final Long entityId, + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class))) }) + public String retrieveReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId, @Context final UriInfo uriInfo) { this.platformSecurityContext.authenticatedUser() .validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME); @@ -172,10 +167,10 @@ public class ReportMailingJobApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Report Mailing Job Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for report mailing job applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "reportmailingjobs/template") + @Operation(summary = "Retrieve Report Mailing Job Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for report mailing job applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "reportmailingjobs/template") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.GetReportMailingJobsTemplate.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsTemplate.class))) }) public String retrieveReportMailingJobTemplate(@Context final UriInfo uriInfo) { this.platformSecurityContext.authenticatedUser() .validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME); @@ -191,14 +186,14 @@ public class ReportMailingJobApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Report Mailing Jobs", notes = "Example Requests:\n" + "\n" + "reportmailingjobs") + @Operation(summary = "List Report Mailing Jobs", description = "Example Requests:\n" + "\n" + "reportmailingjobs") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class)))) }) public String retrieveAllReportMailingJobs(@Context final UriInfo uriInfo, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.platformSecurityContext.authenticatedUser() .validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResourceSwagger.java index 189ca90e8..93349bf48 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.reportmailingjob.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.dataqueries.data.ReportData; @@ -35,120 +34,120 @@ final class ReportMailingJobApiResourceSwagger { } - @ApiModel(value = "GetReportMailingJobsTemplate") + @Schema(description = "GetReportMailingJobsTemplate") public static final class GetReportMailingJobsTemplate { private GetReportMailingJobsTemplate() { } - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean isActive; public List emailAttachmentFileFormatOptions; public List stretchyReportParamDateOptions; } - @ApiModel(value = "GetReportMailingJobsResponse") + @Schema(description = "GetReportMailingJobsResponse") public static final class GetReportMailingJobsResponse { private GetReportMailingJobsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String name; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String description; - @ApiModelProperty(example = "1469627093000") + @Schema(example = "1469627093000") public DateTime startDateTime; - @ApiModelProperty(example = "") + @Schema(example = "") public String recurrence; public ReportMailingJobTimelineData timeline; - @ApiModelProperty(example = "info@musonisystem.com") + @Schema(example = "info@musonisystem.com") public String emailRecipients; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String emailSubject; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String emailMessage; - @ApiModelProperty(example = "") + @Schema(example = "") public EnumOptionData emailAttachmentFileFormat; - @ApiModelProperty(example = "") + @Schema(example = "") public ReportData stretchyReport; - @ApiModelProperty(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}") + @Schema(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}") public String stretchyReportParamMap; - @ApiModelProperty(example = "1469627093000") + @Schema(example = "1469627093000") public DateTime nextRunDateTime; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer numberOfRuns; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean isActive; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long runAsUserId; } - @ApiModel(value = "PostReportMailingJobsRequest") + @Schema(description = "PostReportMailingJobsRequest") public static final class PostReportMailingJobsRequest { private PostReportMailingJobsRequest() { } - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy HH:mm:ss") + @Schema(example = "dd-MM-yyyy HH:mm:ss") public String dateFormat; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String name; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String description; - @ApiModelProperty(example = "1469627093000") + @Schema(example = "1469627093000") public DateTime startDateTime; - @ApiModelProperty(example = "120") + @Schema(example = "120") public Long stretchyReportId; - @ApiModelProperty(example = "info@musonisystem.com") + @Schema(example = "info@musonisystem.com") public String emailRecipients; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String emailSubject; - @ApiModelProperty(example = "Client Numbers Report") + @Schema(example = "Client Numbers Report") public String emailMessage; - @ApiModelProperty(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR") + @Schema(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR") public String recurrence; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean isActive; - @ApiModelProperty(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}") + @Schema(example = "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}") public String stretchyReportParamMap; } - @ApiModel(value = "PostReportMailingJobsResponse") + @Schema(description = "PostReportMailingJobsResponse") public static final class PostReportMailingJobsResponse { private PostReportMailingJobsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PutReportMailingJobsRequest") + @Schema(description = "PutReportMailingJobsRequest") public static final class PutReportMailingJobsRequest { private PutReportMailingJobsRequest() { } - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy HH:mm:ss") + @Schema(example = "dd-MM-yyyy HH:mm:ss") public String dateFormat; - @ApiModelProperty(example = "10-08-2016 23:30:00") + @Schema(example = "10-08-2016 23:30:00") public DateTime startDateTime; } - @ApiModel(value = "PutReportMailingJobsResponse") + @Schema(description = "PutReportMailingJobsResponse") public static final class PutReportMailingJobsResponse { private PutReportMailingJobsResponse() { @@ -159,16 +158,16 @@ final class ReportMailingJobApiResourceSwagger { private PutReportMailingJobsResponseChanges() {} - @ApiModelProperty(example = "10-08-2016 23:30:00") + @Schema(example = "10-08-2016 23:30:00") public DateTime startDateTime; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutReportMailingJobsResponseChanges changes; } - @ApiModel(value = "DeleteReportMailingJobsRequest ") + @Schema(description = "DeleteReportMailingJobsRequest ") public static final class DeleteReportMailingJobsRequest { private DeleteReportMailingJobsRequest() { @@ -176,14 +175,14 @@ final class ReportMailingJobApiResourceSwagger { } } - @ApiModel(value = "DeleteReportMailingJobsResponse") + @Schema(description = "DeleteReportMailingJobsResponse") public static final class DeleteReportMailingJobsResponse { private DeleteReportMailingJobsResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResource.java index 7bd2e5a41..9d9cb5b37 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.infrastructure.reportmailingjob.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -47,8 +47,8 @@ import org.springframework.stereotype.Component; @Path("/" + ReportMailingJobConstants.REPORT_MAILING_JOB_RUN_HISTORY_RESOURCE_NAME) @Component -@Api(tags = { "List Report Mailing Job History" }) -@SwaggerDefinition(tags = { @Tag(name = "List Report Mailing Job History", description = "") }) + +@Tag(name = "List Report Mailing Job History", description = "") public class ReportMailingJobRunHistoryApiResource { private final PlatformSecurityContext platformSecurityContext; @@ -70,15 +70,16 @@ public class ReportMailingJobRunHistoryApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Report Mailing Job History", notes = "The list capability of report mailing job history can support pagination and sorting.\n" + @Operation(summary = "List Report Mailing Job History", description = "The list capability of report mailing job history can support pagination and sorting.\n" + "\n" + "Example Requests:\n" + "\n" + "reportmailingjobrunhistory/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = ReportMailingJobRunHistoryData.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ReportMailingJobRunHistoryData.class))) }) public String retrieveAllByReportMailingJobId(@Context final UriInfo uriInfo, - @QueryParam("reportMailingJobId") @ApiParam(value = "reportMailingJobId") final Long reportMailingJobId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @QueryParam("reportMailingJobId") @Parameter(description = "reportMailingJobId") final Long reportMailingJobId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.platformSecurityContext.authenticatedUser() .validateHasReadPermission(ReportMailingJobConstants.REPORT_MAILING_JOB_ENTITY_NAME); final SearchParameters searchParameters = SearchParameters.fromReportMailingJobRunHistory(offset, limit, orderBy, sortOrder); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResourceSwagger.java index 3e0ce9845..c864787de 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/api/ReportMailingJobRunHistoryApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.reportmailingjob.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.joda.time.DateTime; /** @@ -31,26 +30,26 @@ final class ReportMailingJobRunHistoryApiResourceSwagger { } - @ApiModel(value = "GetReportMailingJobRunHistoryResponse") + @Schema(description = "GetReportMailingJobRunHistoryResponse") public static final class GetReportMailingJobRunHistoryResponse { private GetReportMailingJobRunHistoryResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long reportMailingJobId; - @ApiModelProperty(example = "1469627093050") + @Schema(example = "1469627093050") public DateTime startDateTime; - @ApiModelProperty(example = "1469627093050") + @Schema(example = "1469627093050") public DateTime endDateTime; - @ApiModelProperty(example = "success") + @Schema(example = "success") public String status; - @ApiModelProperty(example = "") + @Schema(example = "") public String errorMessage; - @ApiModelProperty(example = "") + @Schema(example = "") public String errorLog; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java index d3ed86423..977f44206 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java @@ -20,12 +20,12 @@ package org.apache.fineract.infrastructure.security.api; import com.google.gson.Gson; import com.sun.jersey.core.util.Base64; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; @@ -58,9 +58,7 @@ import org.springframework.stereotype.Component; @Scope("singleton") @Profile("basicauth") @Path("/authentication") -@Api(tags = { "Authentication HTTP Basic" }) -@SwaggerDefinition(tags = { - @Tag(name = "Authentication HTTP Basic", description = "An API capability that allows client applications to verify authentication details using HTTP Basic Authentication.") }) +@Tag(name = "Authentication HTTP Basic", description = "An API capability that allows client applications to verify authentication details using HTTP Basic Authentication.") public class AuthenticationApiResource { public static class AuthenticateRequest { @@ -88,9 +86,10 @@ public class AuthenticationApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Verify authentication", notes = "Authenticates the credentials provided and returns the set roles and permissions allowed.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = AuthenticationApiResourceSwagger.PostAuthenticationResponse.class), - @ApiResponse(code = 400, message = "Unauthenticated. Please login") }) + @Operation(summary = "Verify authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = AuthenticationApiResourceSwagger.PostAuthenticationResponse.class))), + @ApiResponse(responseCode = "400", description = "Unauthenticated. Please login") }) public String authenticate(final String apiRequestBodyAsJson) { // TODO FINERACT-819: sort out Jersey so JSON conversion does not have // to be done explicitly via GSON here, but implicit by arg diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java index 7b511fef1..efc555985 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.security.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.useradministration.data.RoleData; @@ -33,32 +32,32 @@ final class AuthenticationApiResourceSwagger { } - @ApiModel(value = "PostAuthenticationResponse") + @Schema(description = "PostAuthenticationResponse") public static final class PostAuthenticationResponse { private PostAuthenticationResponse() { } - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String username; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long userId; - @ApiModelProperty(example = "bWlmb3M6cGFzc3dvcmQ=") + @Schema(example = "bWlmb3M6cGFzc3dvcmQ=") public String base64EncodedAuthenticationKey; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean authenticated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long staffId; - @ApiModelProperty(example = "Director, Program") + @Schema(example = "Director, Program") public String staffDisplayName; public EnumOptionData organisationalRole; public Collection roles; - @ApiModelProperty(example = "ALL_FUNCTIONS") + @Schema(example = "ALL_FUNCTIONS") public Collection permissions; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResource.java index 3dd768b00..d6b7c97c6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.infrastructure.security.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.Collection; import java.util.Set; @@ -58,8 +58,8 @@ import org.springframework.stereotype.Component; @Component @Profile("oauth") @Scope("singleton") -@Api(tags = { "Fetch authenticated user details" }) -@SwaggerDefinition(tags = { @Tag(name = "Fetch authenticated user details", description = "") }) + +@Tag(name = "Fetch authenticated user details", description = "") @SuppressWarnings("deprecation") // TODO FINERACT-1012 public class UserDetailsApiResource { @@ -80,9 +80,11 @@ public class UserDetailsApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Fetch authenticated user details\n", notes = "checks the Authentication and returns the set roles and permissions allowed.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = UserDetailsApiResourceSwagger.GetUserDetailsResponse.class) }) - public String fetchAuthenticatedUserData(@QueryParam("access_token") @ApiParam(value = "access_token") final String accessToken) { + @Operation(summary = "Fetch authenticated user details\n", description = "checks the Authentication and returns the set roles and permissions allowed.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UserDetailsApiResourceSwagger.GetUserDetailsResponse.class))) }) + public String fetchAuthenticatedUserData( + @QueryParam("access_token") @Parameter(description = "access_token") final String accessToken) { final Authentication authentication = this.tokenServices.loadAuthentication(accessToken); if (authentication.isAuthenticated()) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResourceSwagger.java index 72cd2729f..5b6fabb54 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/UserDetailsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.security.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.useradministration.data.RoleData; @@ -33,32 +32,32 @@ final class UserDetailsApiResourceSwagger { } - @ApiModel(value = "GetUserDetailsResponse") + @Schema(description = "GetUserDetailsResponse") public static final class GetUserDetailsResponse { private GetUserDetailsResponse() { } - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String username; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long userId; - @ApiModelProperty(example = "bWlmb3M6cGFzc3dvcmQ=") + @Schema(example = "bWlmb3M6cGFzc3dvcmQ=") public String accessToken; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean authenticated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long staffId; - @ApiModelProperty(example = "mifosStaffDisplayName") + @Schema(example = "mifosStaffDisplayName") public String staffDisplayName; public EnumOptionData organisationalRole; public Collection roles; - @ApiModelProperty(example = "ALL_FUNCTIONS") + @Schema(example = "ALL_FUNCTIONS") public Collection permissions; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/api/SmsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/api/SmsApiResource.java index 3d0025f5f..c07134555 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/api/SmsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/api/SmsApiResource.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.infrastructure.sms.api; -import io.swagger.annotations.Api; import java.util.Collection; import java.util.Date; import javax.ws.rs.Consumes; @@ -55,7 +54,7 @@ import org.springframework.stereotype.Component; @Produces({ MediaType.APPLICATION_JSON }) @Component @Scope("singleton") -@Api(value = "SMS", description = "") + public class SmsApiResource { private final String resourceNameForPermissions = "SMS"; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/LikelihoodApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/LikelihoodApiResource.java index a5aa6a717..9f6dc577c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/LikelihoodApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/LikelihoodApiResource.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.infrastructure.survey.api; -import io.swagger.annotations.Api; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -45,7 +44,7 @@ import org.springframework.stereotype.Component; @Path("/likelihood") @Component @Scope("singleton") -@Api(value = "Likelihood") + public class LikelihoodApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/PovertyLineApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/PovertyLineApiResource.java index 3aaca6970..ee098b27a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/PovertyLineApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/PovertyLineApiResource.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.infrastructure.survey.api; -import io.swagger.annotations.Api; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -37,7 +36,7 @@ import org.springframework.stereotype.Component; @Path("/povertyLine") @Component @Scope("singleton") -@Api(value = "Poverty Line") + public class PovertyLineApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java index 9d8b46354..573352705 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.infrastructure.survey.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -57,7 +58,7 @@ import org.springframework.stereotype.Component; @Path("/survey") @Component @Scope("singleton") -@Api(value = "Survey", description = "") + public class SurveyApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; @@ -84,9 +85,9 @@ public class SurveyApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve surveys", notes = "Retrieve surveys. This allows to retrieve the list of survey tables registered .") + @Operation(summary = "Retrieve surveys", description = "Retrieve surveys. This allows to retrieve the list of survey tables registered .") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = SurveyApiResourceSwagger.GetSurveyResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SurveyApiResourceSwagger.GetSurveyResponse.class)))) }) public String retrieveSurveys() { this.context.authenticatedUser().validateHasReadPermission(SurveyApiConstants.SURVEY_RESOURCE_NAME); @@ -99,9 +100,10 @@ public class SurveyApiResource { @Path("{surveyName}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve survey", notes = "Lists a registered survey table details and the Apache Fineract Core application table they are registered to.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SurveyApiResourceSwagger.GetSurveyResponse.class) }) - public String retrieveSurvey(@PathParam("surveyName") @ApiParam(value = "surveyName") final String surveyName) { + @Operation(summary = "Retrieve survey", description = "Lists a registered survey table details and the Apache Fineract Core application table they are registered to.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.GetSurveyResponse.class))) }) + public String retrieveSurvey(@PathParam("surveyName") @Parameter(description = "surveyName") final String surveyName) { this.context.authenticatedUser().validateHasReadPermission(SurveyApiConstants.SURVEY_RESOURCE_NAME); @@ -115,14 +117,14 @@ public class SurveyApiResource { @Path("{surveyName}/{apptableId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create an entry in the survey table", notes = "Insert and entry in a survey table (full fill the survey)." + "\n" - + "\n" + "Refer Link for sample Body: [ https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#survey_create ] ") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdRequest.class) }) + @Operation(summary = "Create an entry in the survey table", description = "Insert and entry in a survey table (full fill the survey)." + + "\n" + "\n" + + "Refer Link for sample Body: [ https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#survey_create ] ") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdResponse.class) }) - public String createDatatableEntry(@PathParam("surveyName") @ApiParam(value = "surveyName") final String datatable, - @PathParam("apptableId") @ApiParam(value = "apptableId") final Long apptableId, final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdResponse.class))) }) + public String createDatatableEntry(@PathParam("surveyName") @Parameter(description = "surveyName") final String datatable, + @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .fullFilSurvey(datatable, apptableId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResourceSwagger.java index 34709a8fc..1f34c05a1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.infrastructure.survey.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.infrastructure.dataqueries.data.ResultsetColumnHeaderData; import org.joda.time.DateTime; @@ -33,7 +32,7 @@ final class SurveyApiResourceSwagger { } - @ApiModel(value = "GetSurveyResponse") + @Schema(description = "GetSurveyResponse") public static final class GetSurveyResponse { private GetSurveyResponse() { @@ -46,65 +45,65 @@ final class SurveyApiResourceSwagger { } - @ApiModelProperty(example = "m_client") + @Schema(example = "m_client") public String applicationTableName; - @ApiModelProperty(example = "ppi_kenya_2005") + @Schema(example = "ppi_kenya_2005") public String registeredTableName; public List columnHeaderData; } public GetSurveyResponseDatatableData datatableData; - @ApiModelProperty(example = "false") + @Schema(example = "false") public boolean enabled; } - @ApiModel(value = "PostSurveySurveyNameApptableIdRequest") + @Schema(description = "PostSurveySurveyNameApptableIdRequest") public static final class PostSurveySurveyNameApptableIdRequest { private PostSurveySurveyNameApptableIdRequest() { } - @ApiModelProperty(example = "167") + @Schema(example = "167") public Long ppi_household_members_cd_q1_householdmembers; - @ApiModelProperty(example = "174") + @Schema(example = "174") public Long ppi_highestschool_cd_q2_highestschool; - @ApiModelProperty(example = "180") + @Schema(example = "180") public Long ppi_businessoccupation_cd_q3_businessoccupation; - @ApiModelProperty(example = "184") + @Schema(example = "184") public Long ppi_habitablerooms_cd_q4_habitablerooms; - @ApiModelProperty(example = "188") + @Schema(example = "188") public Long ppi_floortype_cd_q5_floortype; - @ApiModelProperty(example = "190") + @Schema(example = "190") public Long ppi_lightingsource_cd_q6_lightingsource; - @ApiModelProperty(example = "193") + @Schema(example = "193") public Long ppi_irons_cd_q7_irons; - @ApiModelProperty(example = "195") + @Schema(example = "195") public Long ppi_mosquitonets_cd_q8_mosquitonets; - @ApiModelProperty(example = "198") + @Schema(example = "198") public Long ppi_towels_cd_q9_towels; - @ApiModelProperty(example = "201") + @Schema(example = "201") public Long ppi_fryingpans_cd_q10_fryingpans; - @ApiModelProperty(example = "2014-12-02 20:30:00") + @Schema(example = "2014-12-02 20:30:00") public DateTime Date; - @ApiModelProperty(example = "Y-m-d H:i:s") + @Schema(example = "Y-m-d H:i:s") public DateTime dateFormat; - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; } - @ApiModel(value = "PostSurveySurveyNameApptableIdResponse") + @Schema(description = "PostSurveySurveyNameApptableIdResponse") public static final class PostSurveySurveyNameApptableIdResponse { private PostSurveySurveyNameApptableIdResponse() { } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long officeId; - @ApiModelProperty(example = "87") + @Schema(example = "87") public Long clientId; - @ApiModelProperty(example = "87") + @Schema(example = "87") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/api/InteropApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/api/InteropApiResource.java index 2e0abe071..10684bdcf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/api/InteropApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/api/InteropApiResource.java @@ -20,15 +20,14 @@ package org.apache.fineract.interoperation.api; import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_QUOTE; import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_REQUEST; -import static org.apache.fineract.interoperation.util.InteropUtil.ROOT_PATH; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import javax.ws.rs.Consumes; @@ -71,7 +70,7 @@ import org.springframework.stereotype.Component; @Path("/interoperation") // api/v1/ @Component @Scope -@Api(value = ROOT_PATH, description = "") + public class InteropApiResource { private PlatformSecurityContext context; @@ -97,8 +96,8 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("health") - @ApiOperation(value = "Query Interoperation Health Request", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) + @Operation(summary = "Query Interoperation Health Request", description = "") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) public String health(@Context UriInfo uriInfo) { return "OK"; } @@ -107,9 +106,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("accounts/{accountId}") - @ApiOperation(value = "Query Interoperation Account details", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropAccountData.class) }) - public String getAccountDetails(@PathParam("accountId") @ApiParam(value = "accountId") String accountId, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation Account details", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropAccountData.class))) }) + public String getAccountDetails(@PathParam("accountId") @Parameter(description = "accountId") String accountId, + @Context UriInfo uriInfo) { InteropAccountData result = interopService.getAccountDetails(accountId); ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -120,13 +121,15 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("accounts/{accountId}/transactions") - @ApiOperation(value = "Query transactions by Account Id", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransactionsData.class) }) - public String getAccountTransactions(@PathParam("accountId") @ApiParam(value = "accountId") String accountId, - @DefaultValue("true") @QueryParam("debit") @ApiParam(value = "debit") boolean debit, - @DefaultValue("false") @QueryParam("credit") @ApiParam(value = "credit") boolean credit, - @QueryParam("fromBookingDateTime") @ApiParam(value = "fromBookingDateTime") String fromBookingDateTime, - @QueryParam("toBookingDateTime") @ApiParam(value = "toBookingDateTime") String toBookingDateTime, @Context UriInfo uriInfo) { + @Operation(summary = "Query transactions by Account Id", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransactionsData.class))) }) + public String getAccountTransactions(@PathParam("accountId") @Parameter(description = "accountId") String accountId, + @DefaultValue("true") @QueryParam("debit") @Parameter(description = "debit") boolean debit, + @DefaultValue("false") @QueryParam("credit") @Parameter(description = "credit") boolean credit, + @QueryParam("fromBookingDateTime") @Parameter(description = "fromBookingDateTime") String fromBookingDateTime, + @QueryParam("toBookingDateTime") @Parameter(description = "toBookingDateTime") String toBookingDateTime, + @Context UriInfo uriInfo) { LocalDateTime transactionsFrom = fromBookingDateTime == null ? null : LocalDateTime.parse(fromBookingDateTime, DateTimeFormatter.ISO_LOCAL_DATE_TIME); LocalDateTime transactionsTo = toBookingDateTime == null ? null @@ -142,9 +145,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("accounts/{accountId}/identifiers") - @ApiOperation(value = "Query Interoperation secondary identifiers by Account Id", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifiersResponseData.class) }) - public String getAccountIdentifiers(@PathParam("accountId") @ApiParam(value = "accountId") String accountId, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation secondary identifiers by Account Id", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifiersResponseData.class))) }) + public String getAccountIdentifiers(@PathParam("accountId") @Parameter(description = "accountId") String accountId, + @Context UriInfo uriInfo) { InteropIdentifiersResponseData result = interopService.getAccountIdentifiers(accountId); ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -155,10 +160,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("parties/{idType}/{idValue}") - @ApiOperation(value = "Query Interoperation Account by secondary identifier", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) }) - public String getAccountByIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType, - @PathParam("idValue") @ApiParam(value = "idValue") String idValue, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation Account by secondary identifier", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) }) + public String getAccountByIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType, + @PathParam("idValue") @Parameter(description = "idValue") String idValue, @Context UriInfo uriInfo) { InteropIdentifierAccountResponseData result = interopService.getAccountByIdentifier(idType, idValue, null); ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -169,11 +175,12 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("parties/{idType}/{idValue}/{subIdOrType}") - @ApiOperation(value = "Query Interoperation Account by secondary identifier", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) }) - public String getAccountByIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType, - @PathParam("idValue") @ApiParam(value = "idValue") String idValue, - @PathParam("subIdOrType") @ApiParam(value = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation Account by secondary identifier", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) }) + public String getAccountByIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType, + @PathParam("idValue") @Parameter(description = "idValue") String idValue, + @PathParam("subIdOrType") @Parameter(description = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) { InteropIdentifierAccountResponseData result = interopService.getAccountByIdentifier(idType, idValue, subIdOrType); ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -184,12 +191,12 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("parties/{idType}/{idValue}") - @ApiOperation(value = "Interoperation Identifier registration", httpMethod = "POST", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) }) - public String registerAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType, - @PathParam("idValue") @ApiParam(value = "idValue") String idValue, @ApiParam(hidden = true) String identifierJson, + @Operation(summary = "Interoperation Identifier registration", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) }) + public String registerAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType, + @PathParam("idValue") @Parameter(description = "idValue") String idValue, @Parameter(hidden = true) String identifierJson, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().registerAccountIdentifier(idType, idValue, null) .withJson(identifierJson).build(); @@ -205,14 +212,14 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("parties/{idType}/{idValue}/{subIdOrType}") - @ApiOperation(value = "Interoperation Identifier registration", httpMethod = "POST", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) }) - public String registerAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType, - @PathParam("idValue") @ApiParam(value = "idValue") String idValue, - @PathParam("subIdOrType") @ApiParam(value = "subIdOrType") String subIdOrType, @ApiParam(hidden = true) String identifierJson, - @Context UriInfo uriInfo) { + @Operation(summary = "Interoperation Identifier registration", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) }) + public String registerAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType, + @PathParam("idValue") @Parameter(description = "idValue") String idValue, + @PathParam("subIdOrType") @Parameter(description = "subIdOrType") String subIdOrType, + @Parameter(hidden = true) String identifierJson, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().registerAccountIdentifier(idType, idValue, subIdOrType) .withJson(identifierJson).build(); @@ -227,12 +234,12 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("parties/{idType}/{idValue}") - @ApiOperation(value = "Allow Interoperation Identifier registration", httpMethod = "DELETE", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) }) - public String deleteAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType, - @PathParam("idValue") @ApiParam(value = "idValue") String idValue, @Context UriInfo uriInfo) { + @Operation(summary = "Allow Interoperation Identifier registration", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) }) + public String deleteAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType, + @PathParam("idValue") @Parameter(description = "idValue") String idValue, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().deleteAccountIdentifier(idType, idValue, null).build(); InteropIdentifierAccountResponseData result = (InteropIdentifierAccountResponseData) commandsSourceService @@ -246,13 +253,13 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("parties/{idType}/{idValue}/{subIdOrType}") - @ApiOperation(value = "Allow Interoperation Identifier registration", httpMethod = "DELETE", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropIdentifierRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropIdentifierAccountResponseData.class) }) - public String deleteAccountIdentifier(@PathParam("idType") @ApiParam(value = "idType") InteropIdentifierType idType, - @PathParam("idValue") @ApiParam(value = "idValue") String idValue, - @PathParam("subIdOrType") @ApiParam(value = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) { + @Operation(summary = "Allow Interoperation Identifier registration", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropIdentifierRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropIdentifierAccountResponseData.class))) }) + public String deleteAccountIdentifier(@PathParam("idType") @Parameter(description = "idType") InteropIdentifierType idType, + @PathParam("idValue") @Parameter(description = "idValue") String idValue, + @PathParam("subIdOrType") @Parameter(description = "subIdOrType") String subIdOrType, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().deleteAccountIdentifier(idType, idValue, subIdOrType).build(); InteropIdentifierAccountResponseData result = (InteropIdentifierAccountResponseData) commandsSourceService @@ -266,10 +273,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("transactions/{transactionCode}/requests/{requestCode}") - @ApiOperation(value = "Query Interoperation Transaction Request", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransactionRequestResponseData.class) }) - public String getTransactionRequest(@PathParam("transactionCode") @ApiParam(value = "transactionCode") String transactionCode, - @PathParam("requestCode") @ApiParam(value = "requestCode") String requestCode, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation Transaction Request", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransactionRequestResponseData.class))) }) + public String getTransactionRequest(@PathParam("transactionCode") @Parameter(description = "transactionCode") String transactionCode, + @PathParam("requestCode") @Parameter(description = "requestCode") String requestCode, @Context UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_REQUEST); InteropTransactionRequestResponseData result = interopService.getTransactionRequest(transactionCode, requestCode); @@ -282,11 +290,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("requests") - @ApiOperation(value = "Allow Interoperation Transaction Request", httpMethod = "POST", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropTransactionRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransactionRequestResponseData.class) }) - public String createTransactionRequest(@ApiParam(hidden = true) String quotesJson, @Context UriInfo uriInfo) { + @Operation(summary = "Allow Interoperation Transaction Request", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropTransactionRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransactionRequestResponseData.class))) }) + public String createTransactionRequest(@Parameter(hidden = true) String quotesJson, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().createTransactionRequest().withJson(quotesJson).build(); InteropTransactionRequestResponseData result = (InteropTransactionRequestResponseData) commandsSourceService @@ -300,10 +308,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("transactions/{transactionCode}/quotes/{quoteCode}") - @ApiOperation(value = "Query Interoperation Quote", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropQuoteResponseData.class) }) - public String getQuote(@PathParam("transactionCode") @ApiParam(value = "transactionCode") String transactionCode, - @PathParam("quoteCode") @ApiParam(value = "quoteCode") String quoteCode, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation Quote", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropQuoteResponseData.class))) }) + public String getQuote(@PathParam("transactionCode") @Parameter(description = "transactionCode") String transactionCode, + @PathParam("quoteCode") @Parameter(description = "quoteCode") String quoteCode, @Context UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_QUOTE); InteropQuoteResponseData result = interopService.getQuote(transactionCode, quoteCode); @@ -316,11 +325,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("quotes") - @ApiOperation(value = "Calculate Interoperation Quote", httpMethod = "POST", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropQuoteRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropQuoteResponseData.class) }) - public String createQuote(@ApiParam(hidden = true) String quotesJson, @Context UriInfo uriInfo) { + @Operation(summary = "Calculate Interoperation Quote", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropQuoteRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropQuoteResponseData.class))) }) + public String createQuote(@Parameter(hidden = true) String quotesJson, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().createQuotes().withJson(quotesJson).build(); InteropQuoteResponseData result = (InteropQuoteResponseData) commandsSourceService.logCommandSource(commandRequest); @@ -333,10 +342,11 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("transactions/{transactionCode}/transfers/{transferCode}") - @ApiOperation(value = "Query Interoperation Transfer", httpMethod = "GET", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransferResponseData.class) }) - public String getTransfer(@PathParam("transactionCode") @ApiParam(value = "transactionCode") String transactionCode, - @PathParam("transferCode") @ApiParam(value = "transferCode") String transferCode, @Context UriInfo uriInfo) { + @Operation(summary = "Query Interoperation Transfer", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransferResponseData.class))) }) + public String getTransfer(@PathParam("transactionCode") @Parameter(description = "transactionCode") String transactionCode, + @PathParam("transferCode") @Parameter(description = "transferCode") String transferCode, @Context UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(ENTITY_NAME_QUOTE); InteropTransferResponseData result = interopService.getTransfer(transactionCode, transferCode); @@ -349,12 +359,12 @@ public class InteropApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("transfers") - @ApiOperation(value = "Prepare Interoperation Transfer", httpMethod = "POST", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InteropTransferRequestData.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = InteropTransferResponseData.class) }) - public String performTransfer(@QueryParam("action") @ApiParam(value = "action") String action, - @ApiParam(hidden = true) String quotesJson, @Context UriInfo uriInfo) { + @Operation(summary = "Prepare Interoperation Transfer", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InteropTransferRequestData.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InteropTransferResponseData.class))) }) + public String performTransfer(@QueryParam("action") @Parameter(description = "action") String action, + @Parameter(hidden = true) String quotesJson, @Context UriInfo uriInfo) { CommandWrapper commandRequest = new InteropWrapperBuilder().performTransfer(InteropTransferActionType.valueOf(action)) .withJson(quotesJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java index 8c7bdfef2..5e0477846 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.mix.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.sql.Date; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -37,8 +35,8 @@ import org.springframework.stereotype.Component; @Path("/mixreport") @Component @Scope("singleton") -@Api(tags = { "Mix Report" }) -@SwaggerDefinition(tags = { @Tag(name = "Mix Report", description = "") }) + +@Tag(name = "Mix Report", description = "") public class MixReportApiResource { private final XBRLResultService xbrlResultService; diff --git a/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java index 66cf6a75c..f35b91e8d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.mix.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -45,8 +43,8 @@ import org.springframework.stereotype.Component; @Path("/mixtaxonomy") @Component @Scope("singleton") -@Api(tags = { "Mix Taxonomy" }) -@SwaggerDefinition(tags = { @Tag(name = "Mix Taxonomy", description = "") }) + +@Tag(name = "Mix Taxonomy", description = "") public class MixTaxonomyApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( diff --git a/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java index 096a7b406..0e202ca50 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.mix.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -49,8 +47,8 @@ import org.springframework.stereotype.Component; @Path("/mixmapping") @Component @Scope("singleton") -@Api(tags = { "Mix Mapping " }) -@SwaggerDefinition(tags = { @Tag(name = "Mix Mapping", description = "") }) + +@Tag(name = "Mix Mapping", description = "") public class MixTaxonomyMappingApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("identifier", "config")); diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/api/NotificationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/notification/api/NotificationApiResource.java index 524bc1b36..5ae26807c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/api/NotificationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/api/NotificationApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.notification.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.PUT; @@ -45,8 +43,8 @@ import org.springframework.stereotype.Component; @Path("/notifications") @Component @Scope("singleton") -@Api(tags = { "Notification" }) -@SwaggerDefinition(tags = { @Tag(name = "Notification", description = "") }) + +@Tag(name = "Notification", description = "") public class NotificationApiResource { private final PlatformSecurityContext context; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResource.java index 24165a277..8bf6cd67c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResource.java @@ -21,15 +21,15 @@ package org.apache.fineract.organisation.holiday.api; import static org.apache.fineract.organisation.holiday.api.HolidayApiConstants.HOLIDAY_RESOURCE_NAME; import static org.apache.fineract.organisation.holiday.api.HolidayApiConstants.HOLIDAY_RESPONSE_DATA_PARAMETERS; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import java.util.Date; import javax.ws.rs.Consumes; @@ -64,13 +64,11 @@ import org.springframework.stereotype.Component; @Path("/holidays") @Component @Scope("singleton") -@Api(tags = { "Holidays" }) -@SwaggerDefinition(tags = { - @Tag(name = "Holidays", description = "Some MFI's span large regions where different branch offices might observe different holidays. They need the ability to define holidays for specific branch offices and be able to set the repayment rule to follow during those holidays.\n" - + "\n" - + "The reschedule of repayments to repaymentsRescheduledTo date during defined holidays is turned on/off by enabling/disabling reschedule-repayments-on-holidays in Global configurations.\n" - + "\n" - + "Allow Repayment transactions on a defined holidays is turned on/off by enabling/disabling allow-transactions-on-holiday in Global configurations.") }) +@Tag(name = "Holidays", description = "Some MFI's span large regions where different branch offices might observe different holidays. They need the ability to define holidays for specific branch offices and be able to set the repayment rule to follow during those holidays.\n" + + "\n" + + "The reschedule of repayments to repaymentsRescheduledTo date during defined holidays is turned on/off by enabling/disabling reschedule-repayments-on-holidays in Global configurations.\n" + + "\n" + + "Allow Repayment transactions on a defined holidays is turned on/off by enabling/disabling allow-transactions-on-holiday in Global configurations.") public class HolidaysApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; @@ -94,12 +92,12 @@ public class HolidaysApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Holiday", notes = "Mandatory Fields: " + @Operation(summary = "Create a Holiday", description = "Mandatory Fields: " + "name, description, fromDate, toDate, repaymentsRescheduledTo, offices") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = HolidaysApiResourceSwagger.PostHolidaysRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.PostHolidaysResponse.class) }) - public String createNewHoliday(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysResponse.class))) }) + public String createNewHoliday(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createHoliday().withJson(apiRequestBodyAsJson).build(); @@ -112,14 +110,14 @@ public class HolidaysApiResource { @Path("{holidayId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Activate a Holiday", notes = "Always Holidays are created in pending state. This API allows to activate a holiday.\n" + @Operation(summary = "Activate a Holiday", description = "Always Holidays are created in pending state. This API allows to activate a holiday.\n" + "\n" + "Only the active holidays are considered for rescheduling the loan repayment.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = HolidaysApiResourceSwagger.PostHolidaysHolidayIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.PostHolidaysHolidayIdResponse.class) }) - public String handleCommands(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysHolidayIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysHolidayIdResponse.class))) }) + public String handleCommands(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String jsonApiRequest = apiRequestBodyAsJson; if (StringUtils.isBlank(jsonApiRequest)) { @@ -145,9 +143,11 @@ public class HolidaysApiResource { @Path("{holidayId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Holiday", notes = "Example Requests:\n" + "\n" + "holidays/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.GetHolidaysResponse.class) }) - public String retrieveOne(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId, @Context final UriInfo uriInfo) { + @Operation(summary = "Retrieve a Holiday", description = "Example Requests:\n" + "\n" + "holidays/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.GetHolidaysResponse.class))) }) + public String retrieveOne(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(HOLIDAY_RESOURCE_NAME); @@ -162,12 +162,12 @@ public class HolidaysApiResource { @Path("{holidayId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Holiday", notes = "If a holiday is in pending state (created and not activated) then all fields are allowed to modify. Once holidays become active only name and descriptions are allowed to modify.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = HolidaysApiResourceSwagger.PutHolidaysHolidayIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.PutHolidaysHolidayIdResponse.class) }) - public String update(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @Operation(summary = "Update a Holiday", description = "If a holiday is in pending state (created and not activated) then all fields are allowed to modify. Once holidays become active only name and descriptions are allowed to modify.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PutHolidaysHolidayIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PutHolidaysHolidayIdResponse.class))) }) + public String update(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHoliday(holidayId).withJson(jsonRequestBody).build(); @@ -180,9 +180,10 @@ public class HolidaysApiResource { @Path("{holidayId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Holiday", notes = "This API allows to delete a holiday. This is a soft delete the deleted holiday status is marked as deleted.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.DeleteHolidaysHolidayIdResponse.class) }) - public String delete(@PathParam("holidayId") @ApiParam(value = "holidayId") final Long holidayId) { + @Operation(summary = "Delete a Holiday", description = "This API allows to delete a holiday. This is a soft delete the deleted holiday status is marked as deleted.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.DeleteHolidaysHolidayIdResponse.class))) }) + public String delete(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHoliday(holidayId).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.toApiJsonSerializer.serialize(result); @@ -195,15 +196,15 @@ public class HolidaysApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Holidays", notes = "Example Requests:\n" + "\n" + "holidays?officeId=1") + @Operation(summary = "List Holidays", description = "Example Requests:\n" + "\n" + "holidays?officeId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = HolidaysApiResourceSwagger.GetHolidaysResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = HolidaysApiResourceSwagger.GetHolidaysResponse.class)))) }) public String retrieveAllHolidays(@Context final UriInfo uriInfo, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @QueryParam("fromDate") @ApiParam(value = "fromDate") final DateParam fromDateParam, - @QueryParam("toDate") @ApiParam(value = "toDate") final DateParam toDateParam, - @QueryParam("locale") @ApiParam(value = "locale") final String locale, - @QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat) { + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @QueryParam("fromDate") @Parameter(description = "fromDate") final DateParam fromDateParam, + @QueryParam("toDate") @Parameter(description = "toDate") final DateParam toDateParam, + @QueryParam("locale") @Parameter(description = "locale") final String locale, + @QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat) { this.context.authenticatedUser().validateHasReadPermission(HOLIDAY_RESOURCE_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResourceSwagger.java index 5a7b6730b..b690cb439 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidaysApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.holiday.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.joda.time.LocalDate; @@ -33,29 +32,29 @@ final class HolidaysApiResourceSwagger { } - @ApiModel(value = "GetHolidaysResponse") + @Schema(description = "GetHolidaysResponse") public static final class GetHolidaysResponse { private GetHolidaysResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Good Friday") + @Schema(example = "Good Friday") public String name; - @ApiModelProperty(example = "[2013, 10, 26]") + @Schema(example = "[2013, 10, 26]") public LocalDate fromDate; - @ApiModelProperty(example = "[2013, 10, 26]") + @Schema(example = "[2013, 10, 26]") public LocalDate toDate; - @ApiModelProperty(example = "[2013, 10, 27]") + @Schema(example = "[2013, 10, 27]") public LocalDate repaymentsRescheduledTo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; public EnumOptionData status; } - @ApiModel(value = "PostHolidaysRequest") + @Schema(description = "PostHolidaysRequest") public static final class PostHolidaysRequest { private PostHolidaysRequest() { @@ -68,39 +67,39 @@ final class HolidaysApiResourceSwagger { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; } - @ApiModelProperty(example = "Good Friday") + @Schema(example = "Good Friday") public String name; - @ApiModelProperty(example = "Good Friday") + @Schema(example = "Good Friday") public String description; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "25 October 2013") + @Schema(example = "25 October 2013") public LocalDate fromDate; - @ApiModelProperty(example = "25 October 2013") + @Schema(example = "25 October 2013") public LocalDate toDate; - @ApiModelProperty(example = "26 October 2013") + @Schema(example = "26 October 2013") public LocalDate repaymentsRescheduledTo; public List offices; } - @ApiModel(value = "PostHolidaysResponse") + @Schema(description = "PostHolidaysResponse") public static final class PostHolidaysResponse { private PostHolidaysResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PostHolidaysHolidayIdRequest") + @Schema(description = "PostHolidaysHolidayIdRequest") public static final class PostHolidaysHolidayIdRequest { private PostHolidaysHolidayIdRequest() { @@ -108,31 +107,31 @@ final class HolidaysApiResourceSwagger { } } - @ApiModel(value = "PostHolidaysHolidayIdResponse") + @Schema(description = "PostHolidaysHolidayIdResponse") public static final class PostHolidaysHolidayIdResponse { private PostHolidaysHolidayIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PutHolidaysHolidayIdRequest") + @Schema(description = "PutHolidaysHolidayIdRequest") public static final class PutHolidaysHolidayIdRequest { private PutHolidaysHolidayIdRequest() { } - @ApiModelProperty(example = "Independence day") + @Schema(example = "Independence day") public String name; - @ApiModelProperty(example = "Holiday for Independence day celebration") + @Schema(example = "Holiday for Independence day celebration") public String description; } - @ApiModel(value = "PutHolidaysHolidayIdResponse") + @Schema(description = "PutHolidaysHolidayIdResponse") public static final class PutHolidaysHolidayIdResponse { private PutHolidaysHolidayIdResponse() { @@ -143,25 +142,25 @@ final class HolidaysApiResourceSwagger { private PutHolidaysHolidayIdResponseChanges() {} - @ApiModelProperty(example = "Independence day") + @Schema(example = "Independence day") public String name; - @ApiModelProperty(example = "Holiday for Independence day celebration") + @Schema(example = "Holiday for Independence day celebration") public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutHolidaysHolidayIdResponseChanges changes; } - @ApiModel(value = "DeleteHolidaysHolidayIdResponse") + @Schema(description = "DeleteHolidaysHolidayIdResponse") public static final class DeleteHolidaysHolidayIdResponse { private DeleteHolidaysHolidayIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResource.java index dd5797d8a..937e80de6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.organisation.monetary.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -55,9 +54,8 @@ import org.springframework.stereotype.Component; @Path("/currencies") @Component @Scope("singleton") -@Api(tags = { "Currency" }) -@SwaggerDefinition(tags = { - @Tag(name = "Currency", description = "Application related configuration around viewing/updating the currencies permitted for use within the MFI.") }) + +@Tag(name = "Currency", description = "Application related configuration around viewing/updating the currencies permitted for use within the MFI.") public class CurrenciesApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("selectedCurrencyOptions", "currencyOptions")); @@ -85,9 +83,10 @@ public class CurrenciesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Currency Configuration", notes = "Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).\n" + @Operation(summary = "Retrieve Currency Configuration", description = "Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).\n" + "\n" + "Example Requests:\n" + "\n" + "currencies\n" + "\n" + "\n" + "currencies?fields=selectedCurrencyOptions") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CurrenciesApiResourceSwagger.GetCurrenciesResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CurrenciesApiResourceSwagger.GetCurrenciesResponse.class))) }) public String retrieveCurrencies(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -101,11 +100,11 @@ public class CurrenciesApiResource { @PUT @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Currency Configuration", notes = "Updates the list of currencies permitted for use.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CurrenciesApiResourceSwagger.PutCurrenciesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CurrenciesApiResourceSwagger.PutCurrenciesResponse.class) }) - public String updateCurrencies(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update Currency Configuration", description = "Updates the list of currencies permitted for use.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CurrenciesApiResourceSwagger.PutCurrenciesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CurrenciesApiResourceSwagger.PutCurrenciesResponse.class))) }) + public String updateCurrencies(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateCurrencies() // diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResourceSwagger.java index 9335fd813..4b2ba30bc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.monetary.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.apache.fineract.organisation.monetary.data.CurrencyData; @@ -32,7 +31,7 @@ final class CurrenciesApiResourceSwagger { } - @ApiModel(value = "GetCurrenciesResponse") + @Schema(description = "GetCurrenciesResponse") public static final class GetCurrenciesResponse { private GetCurrenciesResponse() { @@ -43,28 +42,28 @@ final class CurrenciesApiResourceSwagger { public Collection currencyOptions; } - @ApiModel(value = "PutCurrenciesRequest") + @Schema(description = "PutCurrenciesRequest") public static final class PutCurrenciesRequest { private PutCurrenciesRequest() { } - @ApiModelProperty(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n" - + " \"USD\",\n" + " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]") + @Schema(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n" + " \"USD\",\n" + + " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]") public String currencies; } - @ApiModel(value = "PutCurrenciesResponse") + @Schema(description = "PutCurrenciesResponse") public static final class PutCurrenciesResponse { private PutCurrenciesResponse() { } - @ApiModelProperty(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n" - + " \"USD\",\n" + " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]") + @Schema(example = "[\"KES\",\n" + " \"BND\",\n" + " \"LBP\",\n" + " \"GHC\",\n" + " \"USD\",\n" + + " \"XOF\",\n" + " \"AED\",\n" + " \"AMD\"]") public String currencies; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficeTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficeTransactionsApiResource.java index 929fe9cd8..0cec6e75b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficeTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficeTransactionsApiResource.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.organisation.office.api; -import io.swagger.annotations.Api; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -50,7 +49,7 @@ import org.springframework.stereotype.Component; @Path("/officetransactions") @Component @Scope("singleton") -@Api(value = "officetransactions", description = "") + public class OfficeTransactionsApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java index 12c412fc4..3158ee903 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResource.java @@ -20,15 +20,15 @@ package org.apache.fineract.organisation.office.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -68,9 +68,7 @@ import org.springframework.stereotype.Component; @Path("/offices") @Component @Scope("singleton") -@Api(tags = { "Offices" }) -@SwaggerDefinition(tags = { - @Tag(name = "Offices", description = "Offices are used to model an MFIs structure. A hierarchical representation of offices is supported. There will always be at least one office (which represents the MFI or an MFIs head office). All subsequent offices added must have a parent office.") }) +@Tag(name = "Offices", description = "Offices are used to model an MFIs structure. A hierarchical representation of offices is supported. There will always be at least one office (which represents the MFI or an MFIs head office). All subsequent offices added must have a parent office.") public class OfficesApiResource { /** @@ -107,14 +105,14 @@ public class OfficesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Offices", notes = "Example Requests:\n" + "\n" + "offices\n" + "\n" + "\n" + @Operation(summary = "List Offices", description = "Example Requests:\n" + "\n" + "offices\n" + "\n" + "\n" + "offices?fields=id,name,openingDate") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.GetOfficesResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesResponse.class)))) }) public String retrieveOffices(@Context final UriInfo uriInfo, - @DefaultValue("false") @QueryParam("includeAllOffices") @ApiParam(value = "includeAllOffices") final boolean onlyManualEntries, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @DefaultValue("false") @QueryParam("includeAllOffices") @Parameter(description = "includeAllOffices") final boolean onlyManualEntries, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -130,9 +128,10 @@ public class OfficesApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Office Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "offices/template") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.GetOfficesTemplateResponse.class) }) + @Operation(summary = "Retrieve Office Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "offices/template") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesTemplateResponse.class))) }) public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -149,11 +148,11 @@ public class OfficesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create an Office", notes = "Mandatory Fields\n" + "name, openingDate, parentId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = OfficesApiResourceSwagger.PostOfficesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.PostOfficesResponse.class) }) - public String createOffice(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create an Office", description = "Mandatory Fields\n" + "name, openingDate, parentId") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PostOfficesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PostOfficesResponse.class))) }) + public String createOffice(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createOffice() // @@ -169,10 +168,12 @@ public class OfficesApiResource { @Path("{officeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve an Office", notes = "Example Requests:\n" + "\n" + "offices/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve an Office", description = "Example Requests:\n" + "\n" + "offices/1\n" + "\n" + "\n" + "offices/1?template=true\n" + "\n" + "\n" + "offices/1?fields=id,name,parentName") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.GetOfficesResponse.class) }) - public String retreiveOffice(@PathParam("officeId") @ApiParam(value = "officeId") final Long officeId, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesResponse.class))) }) + public String retreiveOffice(@PathParam("officeId") @Parameter(description = "officeId") final Long officeId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -191,12 +192,12 @@ public class OfficesApiResource { @Path("{officeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Office", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = OfficesApiResourceSwagger.PutOfficesOfficeIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = OfficesApiResourceSwagger.PutOfficesOfficeIdResponse.class) }) - public String updateOffice(@PathParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update Office", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PutOfficesOfficeIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PutOfficesOfficeIdResponse.class))) }) + public String updateOffice(@PathParam("officeId") @Parameter(description = "officeId") final Long officeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateOffice(officeId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResourceSwagger.java index 8a78eab18..05274d18f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.office.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.joda.time.LocalDate; @@ -32,90 +31,90 @@ final class OfficesApiResourceSwagger { } - @ApiModel(value = "GetOfficesResponse") + @Schema(description = "GetOfficesResponse") public static final class GetOfficesResponse { private GetOfficesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public String externalId; - @ApiModelProperty(example = "[2009, 1, 1]") + @Schema(example = "[2009, 1, 1]") public LocalDate openingDate; - @ApiModelProperty(example = ".") + @Schema(example = ".") public String hierarchy; - // @ApiModelProperty(example = "") + // @Schema(example = "") // public Long parentId; - // @ApiModelProperty(example = "") + // @Schema(example = "") // public String parentName; } - @ApiModel(value = "GetOfficesTemplateResponse") + @Schema(description = "GetOfficesTemplateResponse") public static final class GetOfficesTemplateResponse { private GetOfficesTemplateResponse() { } - @ApiModelProperty(example = "[2009, 1, 1]") + @Schema(example = "[2009, 1, 1]") public LocalDate openingDate; public Collection allowedParents; } - @ApiModel(value = "PostOfficesRequest") + @Schema(description = "PostOfficesRequest") public static final class PostOfficesRequest { private PostOfficesRequest() { } - @ApiModelProperty(example = "Good Friday") + @Schema(example = "Good Friday") public String name; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "01 July 2007") + @Schema(example = "01 July 2007") public LocalDate openingDate; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long parentId; - @ApiModelProperty(example = "SYS54-88") + @Schema(example = "SYS54-88") public String externalId; } - @ApiModel(value = "PostOfficesResponse") + @Schema(description = "PostOfficesResponse") public static final class PostOfficesResponse { private PostOfficesResponse() { } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long officeId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long resourceId; } - @ApiModel(value = "PutOfficesOfficeIdRequest") + @Schema(description = "PutOfficesOfficeIdRequest") public static final class PutOfficesOfficeIdRequest { private PutOfficesOfficeIdRequest() { } - @ApiModelProperty(example = "Name is updated") + @Schema(example = "Name is updated") public String name; } - @ApiModel(value = "PutOfficesOfficeIdResponse") + @Schema(description = "PutOfficesOfficeIdResponse") public static final class PutOfficesOfficeIdResponse { private PutOfficesOfficeIdResponse() { @@ -128,13 +127,13 @@ final class OfficesApiResourceSwagger { } - @ApiModelProperty(example = "Name is updated") + @Schema(example = "Name is updated") public String name; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long officeId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long resourceId; public PutOfficesOfficeIdResponseChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCategoryApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCategoryApiResource.java index 9b7a86553..88b07ed1d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCategoryApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCategoryApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.organisation.provisioning.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -50,8 +48,8 @@ import org.springframework.stereotype.Component; @Path("/provisioningcategory") @Component @Scope("singleton") -@Api(tags = { "Provisioning Category" }) -@SwaggerDefinition(tags = { @Tag(name = "Provisioning Category", description = "") }) + +@Tag(name = "Provisioning Category", description = "") public class ProvisioningCategoryApiResource { private final PlatformSecurityContext platformSecurityContext; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java index e3ad1d281..762831c25 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.organisation.provisioning.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -60,8 +60,8 @@ import org.springframework.stereotype.Component; @Path("/provisioningcriteria") @Component @Scope("singleton") -@Api(tags = { "Provisioning Criteria" }) -@SwaggerDefinition(tags = { @Tag(name = "Provisioning Criteria", description = "This defines the Provisioning Criteria") }) + +@Tag(name = "Provisioning Criteria", description = "This defines the Provisioning Criteria") public class ProvisioningCriteriaApiResource { private final PlatformSecurityContext platformSecurityContext; @@ -110,10 +110,10 @@ public class ProvisioningCriteriaApiResource { @Path("{criteriaId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieves a Provisioning Criteria", notes = "Retrieves a Provisioning Criteria") + @Operation(summary = "Retrieves a Provisioning Criteria", description = "Retrieves a Provisioning Criteria") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaCriteriaIdResponse.class) }) - public String retrieveProvisioningCriteria(@PathParam("criteriaId") @ApiParam(value = "criteriaId") final Long criteriaId, + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaCriteriaIdResponse.class))) }) + public String retrieveProvisioningCriteria(@PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId, @Context final UriInfo uriInfo) { platformSecurityContext.authenticatedUser(); ProvisioningCriteriaData criteria = this.provisioningCriteriaReadPlatformService.retrieveProvisioningCriteria(criteriaId); @@ -127,9 +127,9 @@ public class ProvisioningCriteriaApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieves all created Provisioning Criterias", notes = "Retrieves all created Provisioning Criterias") + @Operation(summary = "Retrieves all created Provisioning Criterias", description = "Retrieves all created Provisioning Criterias") @ApiResponses({ - @ApiResponse(code = 200, message = "", responseContainer = "List", response = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaResponse.class)))) }) public String retrieveAllProvisioningCriterias(@Context final UriInfo uriInfo) { platformSecurityContext.authenticatedUser(); Collection data = this.provisioningCriteriaReadPlatformService.retrieveAllProvisioningCriterias(); @@ -140,13 +140,12 @@ public class ProvisioningCriteriaApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a new Provisioning Criteria", notes = "Creates a new Provisioning Criteria\n" + "\n" + @Operation(summary = "Create a new Provisioning Criteria", description = "Creates a new Provisioning Criteria\n" + "\n" + "Mandatory Fields: \n" + "criteriaName\n" + "provisioningcriteria\n" + "\n" + "Optional Fields: \n" + "loanProducts") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaResponse.class) }) - public String createProvisioningCriteria(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PostProvisioningCriteriaResponse.class))) }) + public String createProvisioningCriteria(@Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = null; this.platformSecurityContext.authenticatedUser(); commandWrapper = new CommandWrapperBuilder().createProvisioningCriteria().withJson(apiRequestBodyAsJson).build(); @@ -158,14 +157,13 @@ public class ProvisioningCriteriaApiResource { @Path("{criteriaId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Updates a new Provisioning Criteria", notes = "Updates a new Provisioning Criteria\n" + "\n" + @Operation(summary = "Updates a new Provisioning Criteria", description = "Updates a new Provisioning Criteria\n" + "\n" + "Optional Fields\n" + "criteriaName, loanProducts, provisioningcriteria") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaResponse.class) }) - public String updateProvisioningCriteria(@PathParam("criteriaId") @ApiParam(value = "criteriaId") final Long criteriaId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.PutProvisioningCriteriaResponse.class))) }) + public String updateProvisioningCriteria(@PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { this.platformSecurityContext.authenticatedUser(); final CommandWrapper commandRequest = new CommandWrapperBuilder().updateProvisioningCriteria(criteriaId) .withJson(apiRequestBodyAsJson).build(); @@ -177,10 +175,10 @@ public class ProvisioningCriteriaApiResource { @Path("{criteriaId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Deletes Provisioning Criteria", notes = "Deletes Provisioning Criteria") + @Operation(summary = "Deletes Provisioning Criteria", description = "Deletes Provisioning Criteria") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ProvisioningCriteriaApiResourceSwagger.DeleteProvisioningCriteriaResponse.class) }) - public String deleteProvisioningCriteria(@PathParam("criteriaId") @ApiParam(value = "criteriaId") final Long criteriaId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.DeleteProvisioningCriteriaResponse.class))) }) + public String deleteProvisioningCriteria(@PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId) { this.platformSecurityContext.authenticatedUser(); final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteProvisioningCriteria(criteriaId).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResourceSwagger.java index e523511b6..afe7f739d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.provisioning.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.apache.fineract.organisation.provisioning.data.ProvisioningCriteriaDefinitionData; import org.apache.fineract.portfolio.loanproduct.data.LoanProductData; @@ -33,76 +32,76 @@ final class ProvisioningCriteriaApiResourceSwagger { } - @ApiModel(value = "PostProvisioningCriteriaRequest") + @Schema(description = "PostProvisioningCriteriaRequest") public static final class PostProvisioningCriteriaRequest { private PostProvisioningCriteriaRequest() { } - @ApiModelProperty(example = "High Risk Products Criteria") + @Schema(example = "High Risk Products Criteria") public String criteriaName; public Collection loanProducts; public Collection provisioningcriteria; } - @ApiModel(value = "PostProvisioningCriteriaResponse") + @Schema(description = "PostProvisioningCriteriaResponse") public static final class PostProvisioningCriteriaResponse { private PostProvisioningCriteriaResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "GetProvisioningCriteriaResponse") + @Schema(description = "GetProvisioningCriteriaResponse") public static final class GetProvisioningCriteriaResponse { private GetProvisioningCriteriaResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long criteriaId; - @ApiModelProperty(example = "High Risk Products Criteria") + @Schema(example = "High Risk Products Criteria") public String criteriaName; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdBy; } - @ApiModel(value = "GetProvisioningCriteriaCriteriaIdResponse") + @Schema(description = "GetProvisioningCriteriaCriteriaIdResponse") public static final class GetProvisioningCriteriaCriteriaIdResponse { private GetProvisioningCriteriaCriteriaIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long criteriaId; - @ApiModelProperty(example = "High Risk Products Criteria") + @Schema(example = "High Risk Products Criteria") public String criteriaName; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdBy; public Collection loanProducts; public Collection provisioningcriteria; } - @ApiModel(value = "PutProvisioningCriteriaRequest") + @Schema(description = "PutProvisioningCriteriaRequest") public static final class PutProvisioningCriteriaRequest { private PutProvisioningCriteriaRequest() { } - @ApiModelProperty(example = "High Risk Products Criteria") + @Schema(example = "High Risk Products Criteria") public String criteriaName; public Collection loanProducts; public Collection provisioningcriteria; } - @ApiModel(value = "PutProvisioningCriteriaResponse") + @Schema(description = "PutProvisioningCriteriaResponse") public static final class PutProvisioningCriteriaResponse { private PutProvisioningCriteriaResponse() { @@ -113,23 +112,23 @@ final class ProvisioningCriteriaApiResourceSwagger { private PutProvisioningCriteriaResponseChanges() {} - @ApiModelProperty(example = "High Risk Products Criteria") + @Schema(example = "High Risk Products Criteria") public String criteriaName; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutProvisioningCriteriaResponseChanges changes; } - @ApiModel(value = "DeleteProvisioningCriteriaResponse") + @Schema(description = "DeleteProvisioningCriteriaResponse") public static final class DeleteProvisioningCriteriaResponse { private DeleteProvisioningCriteriaResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java index 59e19cd9a..0131495d0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResource.java @@ -20,15 +20,15 @@ package org.apache.fineract.organisation.staff.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -69,9 +69,7 @@ import org.springframework.stereotype.Component; @Path("/staff") @Component @Scope("singleton") -@Api(tags = { "Staff" }) -@SwaggerDefinition(tags = { - @Tag(name = "Staff", description = "Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not.") }) +@Tag(name = "Staff", description = "Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not.") public class StaffApiResource { /** @@ -111,20 +109,20 @@ public class StaffApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Staff", notes = "Returns the list of staff members.\n" + "\n" + "Example Requests:\n" + "\n" + @Operation(summary = "Retrieve Staff", description = "Returns the list of staff members.\n" + "\n" + "Example Requests:\n" + "\n" + "staff\n\n\n\n" + "\n" + "Retrieve a Staff by status\n" + "\n" + "Returns the details of a Staff based on status.\n" + "\n" + "By default it Returns all the ACTIVE Staff.\n" + "\n" + "If status=INACTIVE, then it returns all INACTIVE Staff.\n" + "\n" + "and for status=ALL, it Returns both ACTIVE and INACTIVE Staff.\n" + "\n" + "Example Requests:\n" + "\n" + "staff?status=active") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.GetStaffResponse.class, responseContainer = "List"), - @ApiResponse(code = 200, message = "GET https://DomainName/api/v1/staff?status={ACTIVE|INACTIVE|ALL}", response = StaffApiResourceSwagger.GetStaffResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = StaffApiResourceSwagger.GetStaffResponse.class)))), + @ApiResponse(responseCode = "200", description = "GET https://DomainName/api/v1/staff?status={ACTIVE|INACTIVE|ALL}", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.GetStaffResponse.class))) }) public String retrieveStaff(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @DefaultValue("false") @QueryParam("staffInOfficeHierarchy") @ApiParam(value = "staffInOfficeHierarchy") final boolean staffInOfficeHierarchy, - @DefaultValue("false") @QueryParam("loanOfficersOnly") @ApiParam(value = "loanOfficersOnly") final boolean loanOfficersOnly, - @DefaultValue("active") @QueryParam("status") @ApiParam(value = "status") final String status) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @DefaultValue("false") @QueryParam("staffInOfficeHierarchy") @Parameter(description = "staffInOfficeHierarchy") final boolean staffInOfficeHierarchy, + @DefaultValue("false") @QueryParam("loanOfficersOnly") @Parameter(description = "loanOfficersOnly") final boolean loanOfficersOnly, + @DefaultValue("active") @QueryParam("status") @Parameter(description = "status") final String status) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -142,12 +140,12 @@ public class StaffApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a staff member", notes = "Creates a staff member.\n" + "\n" + "Mandatory Fields: \n" + @Operation(summary = "Create a staff member", description = "Creates a staff member.\n" + "\n" + "Mandatory Fields: \n" + "officeId, firstname, lastname\n" + "\n" + "Optional Fields: \n" + "isLoanOfficer, isActive") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = StaffApiResourceSwagger.PostStaffRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.PostStaffResponse.class) }) - public String createStaff(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PostStaffRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PostStaffResponse.class))) }) + public String createStaff(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createStaff().withJson(apiRequestBodyAsJson).build(); @@ -160,10 +158,12 @@ public class StaffApiResource { @Path("{staffId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Staff Member", notes = "Returns the details of a Staff Member.\n" + "\n" + "Example Requests:\n" + @Operation(summary = "Retrieve a Staff Member", description = "Returns the details of a Staff Member.\n" + "\n" + "Example Requests:\n" + "\n" + "staff/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.GetStaffResponse.class) }) - public String retreiveStaff(@PathParam("staffId") @ApiParam(value = "staffId") final Long staffId, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.GetStaffResponse.class))) }) + public String retreiveStaff(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -181,12 +181,12 @@ public class StaffApiResource { @Path("{staffId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Staff Member", notes = "Updates the details of a staff member.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = StaffApiResourceSwagger.PutStaffRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = StaffApiResourceSwagger.PutStaffResponse.class) }) - public String updateStaff(@PathParam("staffId") @ApiParam(value = "staffId") final Long staffId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Staff Member", description = "Updates the details of a staff member.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PutStaffRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = StaffApiResourceSwagger.PutStaffResponse.class))) }) + public String updateStaff(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateStaff(staffId).withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResourceSwagger.java index f9f83b9ea..bfa5a810b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/api/StaffApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.staff.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.joda.time.LocalDate; /** @@ -32,94 +31,94 @@ final class StaffApiResourceSwagger { } - @ApiModel(value = "PostStaffRequest") + @Schema(description = "PostStaffRequest") public static final class PostStaffRequest { private PostStaffRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "John") + @Schema(example = "John") public String firstname; - @ApiModelProperty(example = "Doe") + @Schema(example = "Doe") public String lastname; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isLoanOfficer; - @ApiModelProperty(example = "17H") + @Schema(example = "17H") public String externalId; - @ApiModelProperty(example = "+353851239876") + @Schema(example = "+353851239876") public String mobileNo; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "01 January 2009") + @Schema(example = "01 January 2009") public LocalDate joiningDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; } - @ApiModel(value = "PostStaffResponse") + @Schema(description = "PostStaffResponse") public static final class PostStaffResponse { private PostStaffResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "GetStaffResponse") + @Schema(description = "GetStaffResponse") public static final class GetStaffResponse { private GetStaffResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "John") + @Schema(example = "John") public String firstname; - @ApiModelProperty(example = "Doe") + @Schema(example = "Doe") public String lastname; - @ApiModelProperty(example = "Doe, John") + @Schema(example = "Doe, John") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isLoanOfficer; - @ApiModelProperty(example = "17H") + @Schema(example = "17H") public String externalId; - @ApiModelProperty(example = "+353851239876") + @Schema(example = "+353851239876") public Boolean isActive; - @ApiModelProperty(example = "[2009,8,1]") + @Schema(example = "[2009,8,1]") public LocalDate joiningDate; } - @ApiModel(value = "PutStaffRequest") + @Schema(description = "PutStaffRequest") public static final class PutStaffRequest { private PutStaffRequest() { } - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isLoanOfficer; - @ApiModelProperty(example = "17Hbb") + @Schema(example = "17Hbb") public String externalId; } - @ApiModel(value = "PutStaffResponse") + @Schema(description = "PutStaffResponse") public static final class PutStaffResponse { private PutStaffResponse() { @@ -130,15 +129,15 @@ final class StaffApiResourceSwagger { private PutStaffResponseChanges() {} - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isLoanOfficer; - @ApiModelProperty(example = "17Hbb") + @Schema(example = "17Hbb") public String externalId; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java index e85ee4f04..ac8fddd6e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.organisation.teller.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import java.util.Date; import javax.ws.rs.Consumes; @@ -41,8 +39,8 @@ import org.springframework.stereotype.Component; @Path("cashiers") @Component @Scope("singleton") -@Api(tags = { "Cashiers" }) -@SwaggerDefinition(tags = { @Tag(name = "Cashiers", description = "") }) + +@Tag(name = "Cashiers", description = "") public class CashierApiResource { private final DefaultToApiJsonSerializer jsonSerializer; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java index 50ff531e1..430d6950b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.organisation.teller.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import java.util.Date; import javax.ws.rs.Consumes; @@ -64,9 +64,8 @@ import org.springframework.stereotype.Component; @Path("tellers") @Component @Scope("singleton") -@Api(tags = { "Teller Cash Management" }) -@SwaggerDefinition(tags = { - @Tag(name = "Teller Cash Management", description = "Teller cash management which will allow an organization to manage their cash transactions at branches or head office more effectively.") }) + +@Tag(name = "Teller Cash Management", description = "Teller cash management which will allow an organization to manage their cash transactions at branches or head office more effectively.") public class TellerApiResource { private final PlatformSecurityContext securityContext; @@ -88,10 +87,10 @@ public class TellerApiResource { @GET @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "List all tellers", notes = "Retrieves list tellers") + @Operation(summary = "List all tellers", description = "Retrieves list tellers") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersResponse.class, responseContainer = "List") }) - public String getTellerData(@QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class)))) }) + public String getTellerData(@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId) { final Collection foundTellers = this.readPlatformService.getTellers(officeId); return this.jsonSerializer.serialize(foundTellers); @@ -101,9 +100,10 @@ public class TellerApiResource { @Path("{tellerId}") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieve tellers", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersResponse.class) }) - public String findTeller(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId) { + @Operation(summary = "Retrieve tellers", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class))) }) + public String findTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) { final TellerData teller = this.readPlatformService.findTeller(tellerId); return this.jsonSerializer.serialize(teller); @@ -112,12 +112,12 @@ public class TellerApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create teller", notes = "Mandatory Fields\n" + "Teller name, OfficeId, Description, Start Date, Status\n" + @Operation(summary = "Create teller", description = "Mandatory Fields\n" + "Teller name, OfficeId, Description, Start Date, Status\n" + "Optional Fields\n" + "End Date") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersResponse.class) }) - public String createTeller(@ApiParam(hidden = true) final String tellerData) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersResponse.class))) }) + public String createTeller(@Parameter(hidden = true) final String tellerData) { final CommandWrapper request = new CommandWrapperBuilder().createTeller().withJson(tellerData).build(); final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request); @@ -129,12 +129,12 @@ public class TellerApiResource { @Path("{tellerId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update teller", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PutTellersRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PutTellersResponse.class) }) - public String updateTeller(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @ApiParam(hidden = true) final String tellerData) { + @Operation(summary = "Update teller", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersResponse.class))) }) + public String updateTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @Parameter(hidden = true) final String tellerData) { final CommandWrapper request = new CommandWrapperBuilder().updateTeller(tellerId).withJson(tellerData).build(); final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request); @@ -146,7 +146,7 @@ public class TellerApiResource { @Path("{tellerId}") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - public String deleteTeller(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId) { + public String deleteTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) { final CommandWrapper request = new CommandWrapperBuilder().deleteTeller(tellerId).build(); final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request); @@ -158,11 +158,12 @@ public class TellerApiResource { @Path("{tellerId}/cashiers") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "List Cashiers", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersResponse.class) }) - public String getCashierData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @QueryParam("fromdate") @ApiParam(value = "fromdate") final String fromDateStr, - @QueryParam("todate") @ApiParam(value = "todate") final String toDateStr) { + @Operation(summary = "List Cashiers", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersResponse.class))) }) + public String getCashierData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @QueryParam("fromdate") @Parameter(description = "fromdate") final String fromDateStr, + @QueryParam("todate") @Parameter(description = "todate") final String toDateStr) { final DateTimeFormatter dateFormatter = ISODateTimeFormat.basicDate(); final Date fromDate = fromDateStr != null ? dateFormatter.parseDateTime(fromDateStr).toDate() : new Date(); @@ -185,11 +186,11 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieve a cashier", notes = "") + @Operation(summary = "Retrieve a cashier", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashierIdResponse.class) }) - public String findCashierData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashierIdResponse.class))) }) + public String findCashierData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) { final CashierData cashier = this.readPlatformService.findCashier(cashierId); return this.jsonSerializer.serialize(cashier); @@ -199,10 +200,10 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/template") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Find Cashiers", notes = "") + @Operation(summary = "Find Cashiers", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersTemplateResponse.class) }) - public String getCashierTemplate(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersTemplateResponse.class))) }) + public String getCashierTemplate(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) { final TellerData teller = this.readPlatformService.findTeller(tellerId); Long officeId = teller.getOfficeId(); @@ -216,14 +217,14 @@ public class TellerApiResource { @Path("{tellerId}/cashiers") @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Create Cashiers", notes = "Mandatory Fields: \n" + @Operation(summary = "Create Cashiers", description = "Mandatory Fields: \n" + "Cashier/staff, Fromm Date, To Date, Full Day or From time and To time\n" + "\n\n\n" + "Optional Fields: \n" + "Description/Notes") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class) }) - public String createCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @ApiParam(hidden = true) final String cashierData) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class))) }) + public String createCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @Parameter(hidden = true) final String cashierData) { final CommandWrapper request = new CommandWrapperBuilder().allocateTeller(tellerId).withJson(cashierData).build(); final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request); @@ -235,14 +236,13 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Update Cashier", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdRequest.class) }) + @Operation(summary = "Update Cashier", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdResponse.class) }) - public String updateCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId, - @ApiParam(hidden = true) final String cashierDate) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdResponse.class))) }) + public String updateCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId, + @Parameter(hidden = true) final String cashierDate) { final CommandWrapper request = new CommandWrapperBuilder().updateAllocationTeller(tellerId, cashierId).withJson(cashierDate) .build(); @@ -255,11 +255,11 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Delete Cashier", notes = "") + @Operation(summary = "Delete Cashier", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.DeleteTellersTellerIdCashiersCashierIdResponse.class) }) - public String deleteCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.DeleteTellersTellerIdCashiersCashierIdResponse.class))) }) + public String deleteCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) { final CommandWrapper request = new CommandWrapperBuilder().deleteAllocationTeller(tellerId, cashierId).build(); final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(request); @@ -271,14 +271,13 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}/allocate") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Allocate Cash To Cashier", notes = "Mandatory Fields: \n" + "Date, Amount, Currency, Notes/Comments") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateRequest.class) }) + @Operation(summary = "Allocate Cash To Cashier", description = "Mandatory Fields: \n" + "Date, Amount, Currency, Notes/Comments") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateResponse.class) }) - public String allocateCashToCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId, - @ApiParam(hidden = true) final String cashierTxnData) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdAllocateResponse.class))) }) + public String allocateCashToCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId, + @Parameter(hidden = true) final String cashierTxnData) { final CommandWrapper request = new CommandWrapperBuilder().allocateCashToCashier(tellerId, cashierId).withJson(cashierTxnData) .build(); @@ -292,14 +291,13 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}/settle") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Settle Cash From Cashier", notes = "Mandatory Fields\n" + "Date, Amount, Currency, Notes/Comments") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleRequest.class) }) + @Operation(summary = "Settle Cash From Cashier", description = "Mandatory Fields\n" + "Date, Amount, Currency, Notes/Comments") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleResponse.class) }) - public String settleCashFromCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId, - @ApiParam(hidden = true) final String cashierTxnData) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersCashierIdSettleResponse.class))) }) + public String settleCashFromCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId, + @Parameter(hidden = true) final String cashierTxnData) { final CommandWrapper request = new CommandWrapperBuilder().settleCashFromCashier(tellerId, cashierId).withJson(cashierTxnData) .build(); @@ -313,16 +311,16 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}/transactions") @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieve Cashier Transaction", notes = "") + @Operation(summary = "Retrieve Cashier Transaction", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class, responseContainer = "List") }) - public String getTransactionsForCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId, - @QueryParam("currencyCode") @ApiParam(value = "currencyCode") final String currencyCode, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class)))) }) + public String getTransactionsForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId, + @QueryParam("currencyCode") @Parameter(description = "currencyCode") final String currencyCode, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { final TellerData teller = this.readPlatformService.findTeller(tellerId); final CashierData cashier = this.readPlatformService.findCashier(cashierId); @@ -339,16 +337,16 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}/summaryandtransactions") @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Transactions Wtih Summary For Cashier", notes = "") + @Operation(summary = "Transactions Wtih Summary For Cashier", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class) }) - public String getTransactionsWtihSummaryForCashier(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId, - @QueryParam("currencyCode") @ApiParam(value = "currencyCode") final String currencyCode, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class))) }) + public String getTransactionsWtihSummaryForCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId, + @QueryParam("currencyCode") @Parameter(description = "currencyCode") final String currencyCode, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { final TellerData teller = this.readPlatformService.findTeller(tellerId); final CashierData cashier = this.readPlatformService.findCashier(cashierId); @@ -367,11 +365,11 @@ public class TellerApiResource { @Path("{tellerId}/cashiers/{cashierId}/transactions/template") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieve Cashier Transaction Template", notes = "") + @Operation(summary = "Retrieve Cashier Transaction Template", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse.class) }) - public String getCashierTxnTemplate(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @PathParam("cashierId") @ApiParam(value = "cashierId") final Long cashierId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse.class))) }) + public String getCashierTxnTemplate(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) { final CashierTransactionData cashierTxnTemplate = this.readPlatformService.retrieveCashierTxnTemplate(cashierId); @@ -382,8 +380,8 @@ public class TellerApiResource { @Path("{tellerId}/transactions") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - public String getTransactionData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @QueryParam("dateRange") @ApiParam(value = "dateRange") final String dateRange) { + public String getTransactionData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @QueryParam("dateRange") @Parameter(description = "dateRange") final String dateRange) { final DateRange dateRangeHolder = DateRange.fromString(dateRange); final Collection transactions = this.readPlatformService.fetchTellerTransactionsByTellerId(tellerId, @@ -396,8 +394,8 @@ public class TellerApiResource { @Path("{tellerId}/transactions/{transactionId}") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - public String findTransactionData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerid, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId) { + public String findTransactionData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerid, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId) { final TellerTransactionData transaction = this.readPlatformService.findTellerTransaction(transactionId); return this.jsonSerializer.serialize(transaction); @@ -407,9 +405,9 @@ public class TellerApiResource { @Path("{tellerId}/journals") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - public String getJournalData(@PathParam("tellerId") @ApiParam(value = "tellerId") final Long tellerId, - @QueryParam("cashierId") @ApiParam(value = "cashierId") final Long cashierDate, - @QueryParam("dateRange") @ApiParam(value = "dateRange") final String dateRange) { + public String getJournalData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, + @QueryParam("cashierId") @Parameter(description = "cashierId") final Long cashierDate, + @QueryParam("dateRange") @Parameter(description = "dateRange") final String dateRange) { final DateRange dateRangeHolder = DateRange.fromString(dateRange); final Collection journals = this.readPlatformService.fetchTellerJournals(tellerId, cashierDate, diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResourceSwagger.java index c4c2ee48b..7b0eeee24 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.teller.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.util.Collection; import java.util.Date; @@ -41,95 +40,95 @@ final class TellerApiResourceSwagger { } - @ApiModel(value = "GetTellersResponse") + @Schema(description = "GetTellersResponse") public static final class GetTellersResponse { private GetTellersResponse() { } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long debitAccountId; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long creditAccountId; - @ApiModelProperty(example = "Teller3") + @Schema(example = "Teller3") public String name; - @ApiModelProperty(example = "[2015,2,1]") + @Schema(example = "[2015,2,1]") public LocalDate startDate; - @ApiModelProperty(example = "ACTIVE") + @Schema(example = "ACTIVE") public TellerStatus status; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } - @ApiModel(value = "PostTellersRequest") + @Schema(description = "PostTellersRequest") public static final class PostTellersRequest { private PostTellersRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Teller3") + @Schema(example = "Teller3") public String name; - @ApiModelProperty(example = "cash handling") + @Schema(example = "cash handling") public String description; - @ApiModelProperty(example = "ACTIVE") + @Schema(example = "ACTIVE") public TellerStatus status; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; - @ApiModelProperty(example = "01 February 2015") + @Schema(example = "01 February 2015") public LocalDate startDate; } - @ApiModel(value = "PostTellersResponse") + @Schema(description = "PostTellersResponse") public static final class PostTellersResponse { private PostTellersResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Long resourceId; } - @ApiModel(value = "PutTellersRequest") + @Schema(description = "PutTellersRequest") public static final class PutTellersRequest { private PutTellersRequest() { } - @ApiModelProperty(example = "Teller3") + @Schema(example = "Teller3") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "teller cash handling") + @Schema(example = "teller cash handling") public String description; - @ApiModelProperty(example = "ACTIVE") + @Schema(example = "ACTIVE") public TellerStatus status; - @ApiModelProperty(example = "28 February 2015") + @Schema(example = "28 February 2015") public LocalDate endDate; - @ApiModelProperty(example = "01 February 2015") + @Schema(example = "01 February 2015") public LocalDate startDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; } - @ApiModel(value = "PutTellersResponse") + @Schema(description = "PutTellersResponse") public static final class PutTellersResponse { private PutTellersResponse() { @@ -140,140 +139,140 @@ final class TellerApiResourceSwagger { private PutTellersResponseChanges() {} - @ApiModelProperty(example = "teller cash handling") + @Schema(example = "teller cash handling") public String description; - @ApiModelProperty(example = "28 February 2015") + @Schema(example = "28 February 2015") public LocalDate endDate; - @ApiModelProperty(example = "01 February 2015") + @Schema(example = "01 February 2015") public LocalDate startDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Long resourceId; public PutTellersResponseChanges changes; } - @ApiModel(value = "GetTellersTellerIdCashiersResponse") + @Schema(description = "GetTellersTellerIdCashiersResponse") public static final class GetTellersTellerIdCashiersResponse { private GetTellersTellerIdCashiersResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long tellerId; - @ApiModelProperty(example = "Teller1") + @Schema(example = "Teller1") public String tellerName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public Collection cashiers; } - @ApiModel(value = "PostTellersTellerIdCashiersRequest") + @Schema(description = "PostTellersTellerIdCashiersRequest") public static final class PostTellersTellerIdCashiersRequest { private PostTellersTellerIdCashiersRequest() { } - @ApiModelProperty(example = "28 February 2015") + @Schema(example = "28 February 2015") public LocalDate endDate; - @ApiModelProperty(example = "teller cash handling") + @Schema(example = "teller cash handling") public String description; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isFullDay; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long staffId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; - @ApiModelProperty(example = "01 February 2015") + @Schema(example = "01 February 2015") public LocalDate startDate; } - @ApiModel(value = "PostTellersTellerIdCashiersResponse") + @Schema(description = "PostTellersTellerIdCashiersResponse") public static final class PostTellersTellerIdCashiersResponse { private PostTellersTellerIdCashiersResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long subResourceId; } - @ApiModel(value = "GetTellersTellerIdCashiersCashierIdResponse") + @Schema(description = "GetTellersTellerIdCashiersCashierIdResponse") public static final class GetTellersTellerIdCashiersCashierIdResponse { private GetTellersTellerIdCashiersCashierIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long tellerId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long staffId; - @ApiModelProperty(example = "") + @Schema(example = "") public String description; - @ApiModelProperty(example = "Feb 20, 2015 12:00:00 AM") + @Schema(example = "Feb 20, 2015 12:00:00 AM") public LocalDate startDate; - @ApiModelProperty(example = "Feb 27, 2015 12:00:00 AM") + @Schema(example = "Feb 27, 2015 12:00:00 AM") public LocalDate endDate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isFullDay; - @ApiModelProperty(example = "") + @Schema(example = "") public String startTime; - @ApiModelProperty(example = "") + @Schema(example = "") public String endTime; - @ApiModelProperty(example = "Teller1") + @Schema(example = "Teller1") public String tellerName; - @ApiModelProperty(example = "Staff1, Test") + @Schema(example = "Staff1, Test") public String staffName; } - @ApiModel(value = "PutTellersTellerIdCashiersCashierIdRequest") + @Schema(description = "PutTellersTellerIdCashiersCashierIdRequest") public static final class PutTellersTellerIdCashiersCashierIdRequest { private PutTellersTellerIdCashiersCashierIdRequest() { } - @ApiModelProperty(example = "25 February 2015") + @Schema(example = "25 February 2015") public LocalDate endDate; - @ApiModelProperty(example = "Cashier updated.") + @Schema(example = "Cashier updated.") public String description; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isFullDay; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long staffId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; - @ApiModelProperty(example = "01 February 2015") + @Schema(example = "01 February 2015") public LocalDate startDate; } - @ApiModel(value = "PutTellersTellerIdCashiersCashierIdResponse") + @Schema(description = "PutTellersTellerIdCashiersCashierIdResponse") public static final class PutTellersTellerIdCashiersCashierIdResponse { private PutTellersTellerIdCashiersCashierIdResponse() { @@ -284,207 +283,207 @@ final class TellerApiResourceSwagger { private PutTellersTellerIdCashiersCashierIdResponseChanges() {} - @ApiModelProperty(example = "25 February 2015") + @Schema(example = "25 February 2015") public LocalDate endDate; - @ApiModelProperty(example = "Cashier updated.") + @Schema(example = "Cashier updated.") public String description; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long subResourceId; public PutTellersTellerIdCashiersCashierIdResponseChanges changes; } - @ApiModel(value = "DeleteTellersTellerIdCashiersCashierIdResponse") + @Schema(description = "DeleteTellersTellerIdCashiersCashierIdResponse") public static final class DeleteTellersTellerIdCashiersCashierIdResponse { private DeleteTellersTellerIdCashiersCashierIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "GetTellersTellerIdCashiersTemplateResponse") + @Schema(description = "GetTellersTellerIdCashiersTemplateResponse") public static final class GetTellersTellerIdCashiersTemplateResponse { private GetTellersTellerIdCashiersTemplateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long tellerId; - @ApiModelProperty(example = "Teller1") + @Schema(example = "Teller1") public String tellerName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public Collection staffOptions; } - @ApiModel(value = "GetTellersTellerIdCashiersCashiersIdTransactionsResponse") + @Schema(description = "GetTellersTellerIdCashiersCashiersIdTransactionsResponse") public static final class GetTellersTellerIdCashiersCashiersIdTransactionsResponse { private GetTellersTellerIdCashiersCashiersIdTransactionsResponse() { } - @ApiModelProperty(example = "8") + @Schema(example = "8") public Long id; - @ApiModelProperty(example = "15") + @Schema(example = "15") public Long cashierId; public CashierTxnType txnType; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public BigDecimal txnAmount; - @ApiModelProperty(example = "Feb 25, 2015 12:00:00 AM") + @Schema(example = "Feb 25, 2015 12:00:00 AM") public Date txnDate; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long entityId; - @ApiModelProperty(example = "loans") + @Schema(example = "loans") public String entityType; - @ApiModelProperty(example = "Disbursement, Loan:2-000000002,Client:1-Test 1") + @Schema(example = "Disbursement, Loan:2-000000002,Client:1-Test 1") public String txnNote; - @ApiModelProperty(example = "Feb 25, 2015 12:00:00 AM") + @Schema(example = "Feb 25, 2015 12:00:00 AM") public Date createdDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long tellerId; - @ApiModelProperty(example = "B, Ramesh") + @Schema(example = "B, Ramesh") public String cashierName; } - @ApiModel(value = "PostTellersTellerIdCashiersCashierIdAllocateRequest") + @Schema(description = "PostTellersTellerIdCashiersCashierIdAllocateRequest") public static final class PostTellersTellerIdCashiersCashierIdAllocateRequest { private PostTellersTellerIdCashiersCashierIdAllocateRequest() { } - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public BigDecimal txnAmount; - @ApiModelProperty(example = "allocating cash") + @Schema(example = "allocating cash") public String txnNote; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; - @ApiModelProperty(example = "01 February 2015") + @Schema(example = "01 February 2015") public Date txnDate; } - @ApiModel(value = "PostTellersTellerIdCashiersCashierIdAllocateResponse") + @Schema(description = "PostTellersTellerIdCashiersCashierIdAllocateResponse") public static final class PostTellersTellerIdCashiersCashierIdAllocateResponse { private PostTellersTellerIdCashiersCashierIdAllocateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long subResourceId; } - @ApiModel(value = "PostTellersTellerIdCashiersCashierIdSettleRequest") + @Schema(description = "PostTellersTellerIdCashiersCashierIdSettleRequest") public static final class PostTellersTellerIdCashiersCashierIdSettleRequest { private PostTellersTellerIdCashiersCashierIdSettleRequest() { } - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "2000") + @Schema(example = "2000") public BigDecimal txnAmount; - @ApiModelProperty(example = "cash settlement") + @Schema(example = "cash settlement") public String txnNote; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd-MM-yyyy") + @Schema(example = "dd-MM-yyyy") public String dateFormat; - @ApiModelProperty(example = "20 February 2015") + @Schema(example = "20 February 2015") public Date txnDate; } - @ApiModel(value = "PostTellersTellerIdCashiersCashierIdSettleResponse") + @Schema(description = "PostTellersTellerIdCashiersCashierIdSettleResponse") public static final class PostTellersTellerIdCashiersCashierIdSettleResponse { private PostTellersTellerIdCashiersCashierIdSettleResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Long subResourceId; } - @ApiModel(value = "GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse") + @Schema(description = "GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse") public static final class GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse { private GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse() { } - @ApiModelProperty(example = "7000.000000") + @Schema(example = "7000.000000") public BigDecimal sumCashAllocation; - @ApiModelProperty(example = "0") + @Schema(example = "0") public BigDecimal sumInwardCash; - @ApiModelProperty(example = "0") + @Schema(example = "0") public BigDecimal sumOutwardCash; - @ApiModelProperty(example = "50.000000") + @Schema(example = "50.000000") public BigDecimal sumCashSettlement; - @ApiModelProperty(example = "6950.000000") + @Schema(example = "6950.000000") public BigDecimal netCash; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public long tellerId; - @ApiModelProperty(example = "Teller1") + @Schema(example = "Teller1") public String tellerName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public long cashierId; - @ApiModelProperty(example = "Staff1, Test") + @Schema(example = "Staff1, Test") public String cashierName; public Page cashierTransactions; } - @ApiModel(value = "GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse") + @Schema(description = "GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse") public static final class GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse { private GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long cashierId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long tellerId; - @ApiModelProperty(example = "Teller1") + @Schema(example = "Teller1") public String tellerName; - @ApiModelProperty(example = "Staff1, Test") + @Schema(example = "Staff1, Test") public String cashierName; public CashierData cashierData; - @ApiModelProperty(example = "Feb 20, 2015 12:00:00 AM") + @Schema(example = "Feb 20, 2015 12:00:00 AM") public LocalDate startDate; - @ApiModelProperty(example = "Feb 27, 2015 12:00:00 AM") + @Schema(example = "Feb 27, 2015 12:00:00 AM") public LocalDate endDate; public Collection currencyOptions; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java index ac0b01484..275b03f83 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.organisation.teller.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -41,8 +39,8 @@ import org.springframework.stereotype.Component; @Path("cashiersjournal") @Component @Scope("singleton") -@Api(tags = { "Cashier Journals" }) -@SwaggerDefinition(tags = { @Tag(name = "Cashier Journals", description = "") }) + +@Tag(name = "Cashier Journals", description = "") public class TellerJournalApiResource { private final PlatformSecurityContext securityContext; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResource.java index bfc0ec60d..99cf2f7eb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.organisation.workingdays.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.PUT; @@ -52,11 +52,11 @@ import org.springframework.stereotype.Component; @Path("/workingdays") @Component @Scope("singleton") -@Api(tags = { "Working days" }) -@SwaggerDefinition(tags = { @Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n" + +@Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n" + "Rescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n" + "\n" - + "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations.") }) + + "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations.") public class WorkingDaysApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; @@ -80,9 +80,9 @@ public class WorkingDaysApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Working days", notes = "Example Requests:\n" + "\n" + "workingdays") + @Operation(summary = "List Working days", description = "Example Requests:\n" + "\n" + "workingdays") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = WorkingDaysApiResourceSwagger.GetWorkingDaysResponse.class, responseContainer = "list") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.GetWorkingDaysResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(WorkingDaysApiConstants.WORKING_DAYS_RESOURCE_NAME); final WorkingDaysData workingDaysData = this.workingDaysReadPlatformService.retrieve(); @@ -94,12 +94,12 @@ public class WorkingDaysApiResource { @PUT @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Working Day", notes = "Mandatory Fields\n" + @Operation(summary = "Update a Working Day", description = "Mandatory Fields\n" + "recurrence,repaymentRescheduleType,extendTermForDailyRepayments,locale") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = WorkingDaysApiResourceSwagger.PutWorkingDaysRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = WorkingDaysApiResourceSwagger.PutWorkingDaysResponse.class) }) - public String update(@ApiParam(hidden = true) final String jsonRequestBody) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.PutWorkingDaysRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.PutWorkingDaysResponse.class))) }) + public String update(@Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateWorkingDays().withJson(jsonRequestBody).build(); @@ -112,9 +112,10 @@ public class WorkingDaysApiResource { @Path("/template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Working Days Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for working days.\n" + @Operation(summary = "Working Days Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for working days.\n" + "\n" + "Example Request:\n" + "\n" + "workingdays/template") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = WorkingDaysApiResourceSwagger.GetWorkingDaysTemplateResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = WorkingDaysApiResourceSwagger.GetWorkingDaysTemplateResponse.class))) }) public String template(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(WorkingDaysApiConstants.WORKING_DAYS_RESOURCE_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResourceSwagger.java index 318a26143..1da807591 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.organisation.workingdays.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -33,23 +32,23 @@ final class WorkingDaysApiResourceSwagger { } - @ApiModel(value = "GetWorkingDaysResponse") + @Schema(description = "GetWorkingDaysResponse") public static final class GetWorkingDaysResponse { private GetWorkingDaysResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR") + @Schema(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR") public String recurrence; public EnumOptionData repaymentRescheduleType; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean extendTermForDailyRepayments; } - @ApiModel(value = "GetWorkingDaysTemplateResponse") + @Schema(description = "GetWorkingDaysTemplateResponse") public static final class GetWorkingDaysTemplateResponse { private GetWorkingDaysTemplateResponse() { @@ -59,31 +58,31 @@ final class WorkingDaysApiResourceSwagger { public Collection repaymentRescheduleOptions; } - @ApiModel(value = "PutWorkingDaysRequest") + @Schema(description = "PutWorkingDaysRequest") public static final class PutWorkingDaysRequest { private PutWorkingDaysRequest() { } - @ApiModelProperty(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR") + @Schema(example = "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR") public String recurrence; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "4") + @Schema(example = "4") public EnumOptionData repaymentRescheduleType; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean extendTermForDailyRepayments; } - @ApiModel(value = "PutWorkingDaysResponse") + @Schema(description = "PutWorkingDaysResponse") public static final class PutWorkingDaysResponse { private PutWorkingDaysResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResource.java index c7b8441cf..70d89ce67 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.account.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -56,9 +55,7 @@ import org.springframework.stereotype.Component; @Path("/accounttransfers") @Component @Scope("singleton") -@Api(tags = { "Account Transfers" }) -@SwaggerDefinition(tags = { - @Tag(name = "Account Transfers", description = "Ability to be able to transfer monetary funds from one account to another.\n\nNote: At present only savings account to savings account transfers are supported.") }) +@Tag(name = "Account Transfers", description = "Ability to be able to transfer monetary funds from one account to another.\n\nNote: At present only savings account to savings account transfers are supported.") public class AccountTransfersApiResource { private final PlatformSecurityContext context; @@ -84,21 +81,22 @@ public class AccountTransfersApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Account Transfer Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n" + @Operation(summary = "Retrieve Account Transfer Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n" + "\n\n" + "Field Defaults\n\n" + "Allowed Value Lists\n\n" + "Example Requests:\n\n" + "\n\n" + "accounttransfers/template?fromAccountType=2&fromOfficeId=1\n\n" + "\n\n" + "accounttransfers/template?fromAccountType=2&fromOfficeId=1&fromClientId=1\n\n" + "\n\n" + "accounttransfers/template?fromClientId=1&fromAccountType=2&fromAccountId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class) }) - public String template(@QueryParam("fromOfficeId") @ApiParam(value = "fromOfficeId") final Long fromOfficeId, - @QueryParam("fromClientId") @ApiParam(value = "fromClientId") final Long fromClientId, - @QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccountId, - @QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType, - @QueryParam("toOfficeId") @ApiParam(value = "toOfficeId") final Long toOfficeId, - @QueryParam("toClientId") @ApiParam(value = "toClientId") final Long toClientId, - @QueryParam("toAccountId") @ApiParam(value = "toAccountId") final Long toAccountId, - @QueryParam("toAccountType") @ApiParam(value = "toAccountType") final Integer toAccountType, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class))) }) + public String template(@QueryParam("fromOfficeId") @Parameter(description = "fromOfficeId") final Long fromOfficeId, + @QueryParam("fromClientId") @Parameter(description = "fromClientId") final Long fromClientId, + @QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccountId, + @QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType, + @QueryParam("toOfficeId") @Parameter(description = "toOfficeId") final Long toOfficeId, + @QueryParam("toClientId") @Parameter(description = "toClientId") final Long toClientId, + @QueryParam("toAccountId") @Parameter(description = "toAccountId") final Long toAccountId, + @QueryParam("toAccountType") @Parameter(description = "toAccountType") final Integer toAccountType, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME); @@ -112,12 +110,10 @@ public class AccountTransfersApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create new Transfer", httpMethod = "POST", notes = "Ability to create new transfer of monetary funds from one account to another.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountTransfersApiResourceSwagger.PostAccountTransfersRequest.class) }) - @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.PostAccountTransfersResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create new Transfer", description = "Ability to create new transfer of monetary funds from one account to another.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRequest.class))) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersResponse.class))) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createAccountTransfer().withJson(apiRequestBodyAsJson).build(); @@ -129,18 +125,18 @@ public class AccountTransfersApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List account transfers", httpMethod = "GET", notes = "Lists account's transfers\n\n" + "Example Requests:\n\n" - + "\n\n" + "accounttransfers") + @Operation(summary = "List account transfers", description = "Lists account's transfers\n\n" + "Example Requests:\n\n" + "\n\n" + + "accounttransfers") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(example = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("accountDetailId") @ApiParam(value = "accountDetailId") final Long accountDetailId) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(example = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("accountDetailId") @Parameter(description = "accountDetailId") final Long accountDetailId) { this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME); @@ -157,11 +153,11 @@ public class AccountTransfersApiResource { @Path("{transferId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve account transfer", httpMethod = "GET", notes = "Retrieves account transfer\n\n" - + "Example Requests :\n\n" + "\n\n" + "accounttransfers/1") + @Operation(summary = "Retrieve account transfer", description = "Retrieves account transfer\n\n" + "Example Requests :\n\n" + "\n\n" + + "accounttransfers/1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.GetAccountTransfersPageItems.class) }) - public String retrieveOne(@PathParam("transferId") @ApiParam(value = "transferId") final Long transferId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.GetAccountTransfersPageItems.class))) }) + public String retrieveOne(@PathParam("transferId") @Parameter(description = "transferId") final Long transferId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME); @@ -176,19 +172,20 @@ public class AccountTransfersApiResource { @Path("templateRefundByTransfer") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Refund of an Active Loan by Transfer Template", httpMethod = "GET", notes = "Retrieves Refund of an Active Loan by Transfer Template" + @Operation(summary = "Retrieve Refund of an Active Loan by Transfer Template", description = "Retrieves Refund of an Active Loan by Transfer Template" + "Example Requests :\n\n" + "\n\n" + "accounttransfers/templateRefundByTransfer?fromAccountId=2&fromAccountType=1& toAccountId=1&toAccountType=2&toClientId=1&toOfficeId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateRefundByTransferResponse.class) }) - public String templateRefundByTransfer(@QueryParam("fromOfficeId") @ApiParam(value = "fromOfficeId") final Long fromOfficeId, - @QueryParam("fromClientId") @ApiParam(value = "fromClientId") final Long fromClientId, - @QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccountId, - @QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType, - @QueryParam("toOfficeId") @ApiParam(value = "toOfficeId") final Long toOfficeId, - @QueryParam("toClientId") @ApiParam(value = "toClientId") final Long toClientId, - @QueryParam("toAccountId") @ApiParam(value = "toAccountId") final Long toAccountId, - @QueryParam("toAccountType") @ApiParam(value = "toAccountType") final Integer toAccountType, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateRefundByTransferResponse.class))) }) + public String templateRefundByTransfer(@QueryParam("fromOfficeId") @Parameter(description = "fromOfficeId") final Long fromOfficeId, + @QueryParam("fromClientId") @Parameter(description = "fromClientId") final Long fromClientId, + @QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccountId, + @QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType, + @QueryParam("toOfficeId") @Parameter(description = "toOfficeId") final Long toOfficeId, + @QueryParam("toClientId") @Parameter(description = "toClientId") final Long toClientId, + @QueryParam("toAccountId") @Parameter(description = "toAccountId") final Long toAccountId, + @QueryParam("toAccountType") @Parameter(description = "toAccountType") final Integer toAccountType, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME); @@ -203,12 +200,11 @@ public class AccountTransfersApiResource { @Path("refundByTransfer") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Refund of an Active Loan by Transfer", httpMethod = "POST", notes = "Ability to refund an active loan by transferring to a savings account.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferRequest.class) }) + @Operation(summary = "Refund of an Active Loan by Transfer", description = "Ability to refund an active loan by transferring to a savings account.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferResponse.class) }) - public String templateRefundByTransferPost(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferResponse.class))) }) + public String templateRefundByTransferPost(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().refundByTransfer().withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResourceSwagger.java index e90cd5e3a..8757da352 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.account.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class AccountTransfersApiResourceSwagger { private AccountTransfersApiResourceSwagger() {} - @ApiModel(value = "GetAccountTransfersTemplateResponse") + @Schema(description = "GetAccountTransfersTemplateResponse") public static final class GetAccountTransfersTemplateResponse { private GetAccountTransfersTemplateResponse() {} @@ -39,17 +38,17 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersFromOffice() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String name; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String nameDecorated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer externalId; - @ApiModelProperty(example = "[2009, 1, 1]") + @Schema(example = "[2009, 1, 1]") public LocalDate openingDate; - @ApiModelProperty(example = ".") + @Schema(example = ".") public String hierarchy; } @@ -57,23 +56,23 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersFromAccountType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } static final class GetAccountTransfersFromOfficeOptions { private GetAccountTransfersFromOfficeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String name; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String nameDecorated; } @@ -81,13 +80,13 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersFromClientOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Small shop") + @Schema(example = "Small shop") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String officeName; } @@ -95,23 +94,23 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersFromAccountTypeOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } static final class GetAccountTransfersToOfficeOptions { private GetAccountTransfersToOfficeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String name; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String nameDecorated; } @@ -119,17 +118,17 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersToAccountTypeOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long transferAmount; - @ApiModelProperty(example = "[2013, 8, 15]") + @Schema(example = "[2013, 8, 15]") public LocalDate transferDate; public GetAccountTransfersFromOffice fromOffice; public GetAccountTransfersFromAccountType fromAccountType; @@ -140,51 +139,51 @@ final class AccountTransfersApiResourceSwagger { public Set toAccountTypeOptions; } - @ApiModel(value = "PostAccountTransfersRequest") + @Schema(description = "PostAccountTransfersRequest") public static final class PostAccountTransfersRequest { private PostAccountTransfersRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer fromAccountType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromAccountId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toAccountType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toAccountId; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "01 August 2011") + @Schema(example = "01 August 2011") public String transferDate; - @ApiModelProperty(example = "112.45") + @Schema(example = "112.45") public Float transferAmount; - @ApiModelProperty(example = "A description of the transfer") + @Schema(example = "A description of the transfer") public String transferDescription; } - @ApiModel(value = "PostAccountTransfersResponse") + @Schema(description = "PostAccountTransfersResponse") public static final class PostAccountTransfersResponse { private PostAccountTransfersResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetAccountTransfersResponse") + @Schema(description = "GetAccountTransfersResponse") public static final class GetAccountTransfersResponse { private GetAccountTransfersResponse() {} @@ -197,17 +196,17 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersPageItemsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -215,9 +214,9 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersPageItemsFromOffice() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "HO") + @Schema(example = "HO") public String name; } @@ -225,9 +224,9 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersPageItemsFromAccount() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; } @@ -235,24 +234,24 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersPageItemsToAccountType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountType.loan") + @Schema(example = "accountType.loan") public String code; - @ApiModelProperty(example = "Loan Account") - public String value; + @Schema(example = "Loan Account") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean reversed; public GetAccountTransfersPageItemsCurrency currency; - @ApiModelProperty(example = "200") + @Schema(example = "200") public Float transferAmount; - @ApiModelProperty(example = "[2013, 4, 1]") + @Schema(example = "[2013, 4, 1]") public LocalDate transferDate; - @ApiModelProperty(example = "pay off loan from savings.") + @Schema(example = "pay off loan from savings.") public String transferDescription; public GetAccountTransfersPageItemsFromOffice fromOffice; public GetAccountTransfersTemplateResponse.GetAccountTransfersFromClientOptions fromClient; @@ -264,12 +263,12 @@ final class AccountTransfersApiResourceSwagger { public GetAccountTransfersPageItemsFromAccount toAccount; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetAccountTransfersTemplateRefundByTransferResponse") + @Schema(description = "GetAccountTransfersTemplateRefundByTransferResponse") public static final class GetAccountTransfersTemplateRefundByTransferResponse { private GetAccountTransfersTemplateRefundByTransferResponse() {} @@ -278,19 +277,19 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer decimalPlaces; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -298,17 +297,17 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferFromOffice() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer externalId; - @ApiModelProperty(example = "[2009, 1, 1]") + @Schema(example = "[2009, 1, 1]") public LocalDate openingDate; - @ApiModelProperty(example = ".") + @Schema(example = ".") public String hierarchy; } @@ -320,12 +319,12 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "clientStatusType.active") + @Schema(example = "clientStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; + @Schema(example = "Active") + public String description; } static final class GetAccountTransfersGender { @@ -347,21 +346,21 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTimeline() {} - @ApiModelProperty(example = "[2012, 2, 1]") + @Schema(example = "[2012, 2, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; - @ApiModelProperty(example = "[2012, 2, 1]") + @Schema(example = "[2012, 2, 1]") public LocalDate activatedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String activatedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String activatedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String activatedByLastname; } @@ -370,27 +369,27 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersGroups() {} } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; public GetAccountTransfersStatus status; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "[2012, 2, 1]") + @Schema(example = "[2012, 2, 1]") public LocalDate activationDate; - @ApiModelProperty(example = "Daniel") + @Schema(example = "Daniel") public String firstname; - @ApiModelProperty(example = "Owusu") + @Schema(example = "Owusu") public String lastname; - @ApiModelProperty(example = "Daniel Owusu") + @Schema(example = "Daniel Owusu") public String displayName; public GetAccountTransfersGender gender; public GetAccountTransfersClientType clientType; public GetAccountTransfersClientClassification clientClassification; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetAccountTransfersTimeline timeline; public GetAccountTransfersGroups groups; @@ -400,22 +399,22 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferFromAccount() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Daniel Owusu") + @Schema(example = "Daniel Owusu") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "CTRL") + @Schema(example = "CTRL") public String productName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetAccountTransfersTemplateRefundByTransferCurrency currency; - @ApiModelProperty(example = "130") + @Schema(example = "130") public Float amtForTransfer; } @@ -423,13 +422,13 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferToClient() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Daniel Owusu") + @Schema(example = "Daniel Owusu") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -437,19 +436,19 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferToAccount() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Daniel Owusu") + @Schema(example = "Daniel Owusu") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "TEST") + @Schema(example = "TEST") public String productName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetAccountTransfersTemplateRefundByTransferCurrency currency; } @@ -458,11 +457,11 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferFromOfficeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; } @@ -470,13 +469,13 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferFromClientOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Daniel Owusu") + @Schema(example = "Daniel Owusu") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -484,27 +483,27 @@ final class AccountTransfersApiResourceSwagger { private GetAccountTransfersTemplateRefundByTransferFromAccountOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Daniel Owusu") + @Schema(example = "Daniel Owusu") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "CTRL") + @Schema(example = "CTRL") public String productName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetAccountTransfersTemplateRefundByTransferCurrency currency; } public GetAccountTransfersTemplateRefundByTransferCurrency currency; - @ApiModelProperty(example = "130") + @Schema(example = "130") public Float transferAmount; - @ApiModelProperty(example = "[2014, 11, 1]") + @Schema(example = "[2014, 11, 1]") public LocalDate transferDate; public GetAccountTransfersTemplateRefundByTransferFromOffice fromOffice; public GetAccountTransfersTemplateRefundByTransferFromClient fromClient; @@ -524,47 +523,47 @@ final class AccountTransfersApiResourceSwagger { public Set toAccountOptions; } - @ApiModel(value = "PostAccountTransfersRefundByTransferRequest") + @Schema(description = "PostAccountTransfersRefundByTransferRequest") public static final class PostAccountTransfersRefundByTransferRequest { private PostAccountTransfersRefundByTransferRequest() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer fromAccountId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromAccountType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toAccountType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toAccountId; - @ApiModelProperty(example = "130") + @Schema(example = "130") public Float transferAmount; - @ApiModelProperty(example = "31 October 2014") + @Schema(example = "31 October 2014") public String transferDate; - @ApiModelProperty(example = "Transfer refund to my savings account") + @Schema(example = "Transfer refund to my savings account") public String transferDescription; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromClientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromOfficeId; } - @ApiModel(value = "PostAccountTransfersRefundByTransferResponse") + @Schema(description = "PostAccountTransfersRefundByTransferResponse") public static final class PostAccountTransfersRefundByTransferResponse { private PostAccountTransfersRefundByTransferResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResource.java index 64a4ea9b4..b55972a1d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.account.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Date; import java.util.Set; @@ -66,11 +65,8 @@ import org.springframework.stereotype.Component; @Path("/standinginstructions") @Component @Scope("singleton") -@Api(tags = { "Standing Instructions" }) -@SwaggerDefinition(tags = { - @Tag(name = "Standing Instructions", description = "Standing instructions (or standing orders) refer to instructions a bank account holder (\"the payer\") gives to his or her bank to pay a set amount at regular intervals to another's (\"the payee's\") account.\n" - + "\n" - + "Note: At present only savings account to savings account and savings account to Loan account transfers are permitted.") }) +@Tag(name = "Standing Instructions", description = "Standing instructions (or standing orders) refer to instructions a bank account holder (\"the payer\") gives to his or her bank to pay a set amount at regular intervals to another's (\"the payee's\") account.\n" + + "\n" + "Note: At present only savings account to savings account and savings account to Loan account transfers are permitted.") public class StandingInstructionApiResource { private final PlatformSecurityContext context; @@ -99,22 +95,23 @@ public class StandingInstructionApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Standing Instruction Template", httpMethod = "GET", notes = "This is a convenience resource. " + @Operation(summary = "Retrieve Standing Instruction Template", description = "This is a convenience resource. " + "It can be useful when building maintenance user interface screens for client applications. " + "The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Requests:\n" + "\n" + "standinginstructions/template?fromAccountType=2&fromOfficeId=1\n" + "\n" + "standinginstructions/template?fromAccountType=2&fromOfficeId=1&fromClientId=1&transferType=1\n" + "\n" + "standinginstructions/template?fromClientId=1&fromAccountType=2&fromAccountId=1&transferType=1") - @ApiResponses(@ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.GetStandingInstructionsTemplateResponse.class)) - public String template(@QueryParam("fromOfficeId") @ApiParam(value = "fromOfficeId") final Long fromOfficeId, - @QueryParam("fromClientId") @ApiParam(value = "fromClientId") final Long fromClientId, - @QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccountId, - @QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType, - @QueryParam("toOfficeId") @ApiParam(value = "toOfficeId") final Long toOfficeId, - @QueryParam("toClientId") @ApiParam(value = "toClientId") final Long toClientId, - @QueryParam("toAccountId") @ApiParam(value = "toAccountId") final Long toAccountId, - @QueryParam("toAccountType") @ApiParam(value = "toAccountType") final Integer toAccountType, - @QueryParam("transferType") @ApiParam(value = "transferType") final Integer transferType, @Context final UriInfo uriInfo) { + @ApiResponses(@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsTemplateResponse.class)))) + public String template(@QueryParam("fromOfficeId") @Parameter(description = "fromOfficeId") final Long fromOfficeId, + @QueryParam("fromClientId") @Parameter(description = "fromClientId") final Long fromClientId, + @QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccountId, + @QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType, + @QueryParam("toOfficeId") @Parameter(description = "toOfficeId") final Long toOfficeId, + @QueryParam("toClientId") @Parameter(description = "toClientId") final Long toClientId, + @QueryParam("toAccountId") @Parameter(description = "toAccountId") final Long toAccountId, + @QueryParam("toAccountType") @Parameter(description = "toAccountType") final Integer toAccountType, + @QueryParam("transferType") @Parameter(description = "transferType") final Integer transferType, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME); @@ -129,12 +126,11 @@ public class StandingInstructionApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create new Standing Instruction", httpMethod = "POST", notes = "Ability to create new instruction for transfer of monetary funds from one account to another") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = StandingInstructionApiResourceSwagger.PostStandingInstructionsRequest.class) }) + @Operation(summary = "Create new Standing Instruction", description = "Ability to create new instruction for transfer of monetary funds from one account to another") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PostStandingInstructionsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.PostStandingInstructionsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PostStandingInstructionsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createStandingInstruction().withJson(apiRequestBodyAsJson) .build(); @@ -148,17 +144,17 @@ public class StandingInstructionApiResource { @Path("{standingInstructionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Standing Instruction | Delete Standing Instruction", httpMethod = "PUT", notes = "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n" + @Operation(summary = "Update Standing Instruction | Delete Standing Instruction", description = "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n" + "\n" + "PUT https://DomainName/api/v1/standinginstructions/1?command=update\n" + "\n\n" + "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n" + "\n" + "PUT https://DomainName/api/v1/standinginstructions/1?command=delete") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = false, paramType = "body", dataType = "body", format = "body", dataTypeClass = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdRequest.class) }) + @RequestBody(required = false, content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdResponse.class) }) - public String update(@PathParam("standingInstructionId") @ApiParam(value = "standingInstructionId") final Long standingInstructionId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson, - @QueryParam("command") @ApiParam(value = "command") final String commandParam) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdResponse.class))) }) + public String update( + @PathParam("standingInstructionId") @Parameter(description = "standingInstructionId") final Long standingInstructionId, + @Parameter(hidden = true) final String apiRequestBodyAsJson, + @QueryParam("command") @Parameter(description = "command") final String commandParam) { CommandWrapper commandRequest = null; if (is(commandParam, "update")) { @@ -185,21 +181,21 @@ public class StandingInstructionApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Standing Instructions", httpMethod = "GET", notes = "Example Requests:\n" + "\n" + "standinginstructions") + @Operation(summary = "List Standing Instructions", description = "Example Requests:\n" + "\n" + "standinginstructions") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("transferType") @ApiParam(value = "transferType") final Integer transferType, - @QueryParam("clientName") @ApiParam(value = "clientName") final String clientName, - @QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccount, - @QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("transferType") @Parameter(description = "transferType") final Integer transferType, + @QueryParam("clientName") @Parameter(description = "clientName") final String clientName, + @QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccount, + @QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType) { this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME); @@ -221,18 +217,17 @@ public class StandingInstructionApiResource { @Path("{standingInstructionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Standing Instruction", httpMethod = "GET", notes = "Example Requests :\n" + "\n" - + "standinginstructions/1") + @Operation(summary = "Retrieve Standing Instruction", description = "Example Requests :\n" + "\n" + "standinginstructions/1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = StandingInstructionApiResourceSwagger.GetStandingInstructionsStandingInstructionIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsStandingInstructionIdResponse.class))) }) public String retrieveOne( - @PathParam("standingInstructionId") @ApiParam(value = "standingInstructionId") final Long standingInstructionId, - @Context final UriInfo uriInfo, @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @PathParam("standingInstructionId") @Parameter(description = "standingInstructionId") final Long standingInstructionId, + @Context final UriInfo uriInfo, @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResourceSwagger.java index a797dccac..207d94531 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.account.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -32,7 +31,7 @@ final class StandingInstructionApiResourceSwagger { // this class is only for Swagger Live Documentation } - @ApiModel(value = "GetStandingInstructionsTemplateResponse") + @Schema(description = "GetStandingInstructionsTemplateResponse") public static final class GetStandingInstructionsTemplateResponse { private GetStandingInstructionsTemplateResponse() {} @@ -41,17 +40,17 @@ final class StandingInstructionApiResourceSwagger { private GetFromOfficeResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String decoratedName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer externalId; - @ApiModelProperty(example = "[2009, 1, 1]") + @Schema(example = "[2009, 1, 1]") public LocalDate openingDate; - @ApiModelProperty(example = ".") + @Schema(example = ".") public String hierarchy; } @@ -59,23 +58,23 @@ final class StandingInstructionApiResourceSwagger { private GetFromAccountTypeResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } static final class GetFromOfficeOptionsResponseStandingInstructionSwagger { private GetFromOfficeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; } @@ -83,13 +82,13 @@ final class StandingInstructionApiResourceSwagger { private GetFromClientOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Client_FirstName_2VRAG Client_LastName_9QCY") + @Schema(example = "Client_FirstName_2VRAG Client_LastName_9QCY") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -97,23 +96,23 @@ final class StandingInstructionApiResourceSwagger { private GetFromAccountTypeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } static final class GetToOfficeOptionsResponseStandingInstructionSwagger { private GetToOfficeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; } @@ -121,84 +120,84 @@ final class StandingInstructionApiResourceSwagger { private GetToAccountTypeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountType.loan") + @Schema(example = "accountType.loan") public String code; - @ApiModelProperty(example = "Loan Account") - public String value; + @Schema(example = "Loan Account") + public String description; } static final class GetTransferTypeOptionsResponseStandingInstructionSwagger { private GetTransferTypeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountTransferType.account.transfer") + @Schema(example = "accountTransferType.account.transfer") public String code; - @ApiModelProperty(example = "Account Transfer") - public String value; + @Schema(example = "Account Transfer") + public String description; } static final class GetStatusOptionsResponseStandingInstructionSwagger { private GetStatusOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "standingInstructionStatus.active") + @Schema(example = "standingInstructionStatus.active") public String code; - @ApiModelProperty(example = "Active") - public String value; + @Schema(example = "Active") + public String description; } static final class GetInstructionTypeOptionsResponseStandingInstructionSwagger { private GetInstructionTypeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "standingInstructionType.fixed") + @Schema(example = "standingInstructionType.fixed") public String code; - @ApiModelProperty(example = "Fixed") - public String value; + @Schema(example = "Fixed") + public String description; } static final class GetPriorityOptionsResponseStandingInstructionSwagger { private GetPriorityOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "standingInstructionPriority.urgent") + @Schema(example = "standingInstructionPriority.urgent") public String code; - @ApiModelProperty(example = "Urgent Priority") - public String value; + @Schema(example = "Urgent Priority") + public String description; } static final class GetRecurrenceTypeOptionsResponseStandingInstructionSwagger { private GetRecurrenceTypeOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountTransferRecurrenceType.periodic") + @Schema(example = "accountTransferRecurrenceType.periodic") public String code; - @ApiModelProperty(example = "Periodic Recurrence") - public String value; + @Schema(example = "Periodic Recurrence") + public String description; } static final class GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger { private GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "frequencyperiodFrequencyType.days") + @Schema(example = "frequencyperiodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } public GetFromOfficeResponseStandingInstructionSwagger fromOffice; @@ -216,18 +215,18 @@ final class StandingInstructionApiResourceSwagger { public Set recurrenceFrequencyOptions; } - @ApiModel(value = "PostStandingInstructionsResponse") + @Schema(description = "PostStandingInstructionsResponse") public static final class PostStandingInstructionsResponse { private PostStandingInstructionsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long clientId; - @ApiModelProperty(example = "65") + @Schema(example = "65") public Integer resourceId; } - @ApiModel(value = "GetStandingInstructionsResponse") + @Schema(description = "GetStandingInstructionsResponse") public static final class GetStandingInstructionsResponse { private GetStandingInstructionsResponse() {} @@ -238,9 +237,9 @@ final class StandingInstructionApiResourceSwagger { private GetFromOfficeStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; } @@ -248,13 +247,13 @@ final class StandingInstructionApiResourceSwagger { private GetFromClientStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Test test") + @Schema(example = "Test test") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -262,25 +261,25 @@ final class StandingInstructionApiResourceSwagger { private GetFromAccountTypeStandingInstructionSwagger() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } static final class GetFromAccountStandingInstructionSwagger { private GetFromAccountStandingInstructionSwagger() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Long id; - @ApiModelProperty(example = "000000014") + @Schema(example = "000000014") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long productId; - @ApiModelProperty(example = "savings old") + @Schema(example = "savings old") public String productName; } @@ -288,9 +287,9 @@ final class StandingInstructionApiResourceSwagger { private GetToOfficeStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; } @@ -298,13 +297,13 @@ final class StandingInstructionApiResourceSwagger { private GetToClientStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Test test") + @Schema(example = "Test test") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -312,25 +311,25 @@ final class StandingInstructionApiResourceSwagger { private GetToAccountTypeStandingInstructionSwagger() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } static final class GetToAccountStandingInstructionSwagger { private GetToAccountStandingInstructionSwagger() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long id; - @ApiModelProperty(example = "000000003") + @Schema(example = "000000003") public Long accountNo; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Long productId; - @ApiModelProperty(example = "account overdraft") + @Schema(example = "account overdraft") public String productName; } @@ -338,79 +337,79 @@ final class StandingInstructionApiResourceSwagger { private GetTransferTypeStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountTransferType.account.transfer") + @Schema(example = "accountTransferType.account.transfer") public String code; - @ApiModelProperty(example = "Account Transfer") - public String value; + @Schema(example = "Account Transfer") + public String description; } static final class GetPriorityStandingInstructionSwagger { private GetPriorityStandingInstructionSwagger() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "standingInstructionPriority.medium") + @Schema(example = "standingInstructionPriority.medium") public String code; - @ApiModelProperty(example = "Medium Priority") - public String value; + @Schema(example = "Medium Priority") + public String description; } static final class GetInstructionTypeStandingInstructionSwagger { private GetInstructionTypeStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "standingInstructionType.fixed") + @Schema(example = "standingInstructionType.fixed") public String code; - @ApiModelProperty(example = "Fixed") - public String value; + @Schema(example = "Fixed") + public String description; } static final class GetStatusStandingInstructionSwagger { private GetStatusStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "standingInstructionStatus.deleted") + @Schema(example = "standingInstructionStatus.deleted") public String code; - @ApiModelProperty(example = "Deleted") - public String value; + @Schema(example = "Deleted") + public String description; } static final class GetRecurrenceTypeStandingInstructionSwagger { private GetRecurrenceTypeStandingInstructionSwagger() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountTransferRecurrenceType.periodic") + @Schema(example = "accountTransferRecurrenceType.periodic") public String code; - @ApiModelProperty(example = "Periodic Recurrence") - public String value; + @Schema(example = "Periodic Recurrence") + public String description; } static final class GetRecurrenceFrequencyStandingInstructionSwagger { private GetRecurrenceFrequencyStandingInstructionSwagger() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "frequencyperiodFrequencyType.months") + @Schema(example = "frequencyperiodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Long accountDetailId; - @ApiModelProperty(example = "test standing") + @Schema(example = "test standing") public String name; public GetFromOfficeStandingInstructionSwagger fromOffice; public GetFromClientStandingInstructionSwagger fromClient; @@ -424,84 +423,84 @@ final class StandingInstructionApiResourceSwagger { public GetPriorityStandingInstructionSwagger priority; public GetInstructionTypeStandingInstructionSwagger instructionType; public GetStatusStandingInstructionSwagger status; - @ApiModelProperty(example = "150.000000") + @Schema(example = "150.000000") public float amount; - @ApiModelProperty(example = "[2014, 4, 3]") + @Schema(example = "[2014, 4, 3]") public LocalDate validFrom; public GetRecurrenceTypeStandingInstructionSwagger recurrenceType; public GetRecurrenceFrequencyStandingInstructionSwagger recurrenceFrequency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurrenceInterval; - @ApiModelProperty(example = "[4, 3]") + @Schema(example = "[4, 3]") public LocalDate recurrenceOnMonthDay; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "PostStandingInstructionsRequest") + @Schema(description = "PostStandingInstructionsRequest") public static final class PostStandingInstructionsRequest { private PostStandingInstructionsRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long fromOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long fromClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer fromAccountType; - @ApiModelProperty(example = "standing instruction") + @Schema(example = "standing instruction") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transferType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer priority; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer status; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long fromAccountId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long toOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long toClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toAccountType; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Long toAccountId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer instructionType; - @ApiModelProperty(example = "221") + @Schema(example = "221") public Integer amount; - @ApiModelProperty(example = "08 April 2014") + @Schema(example = "08 April 2014") public String validFrom; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurrenceType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurrenceInterval; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer recurrenceFrequency; - @ApiModelProperty(value = "en") + @Schema(description = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "02 April") + @Schema(example = "02 April") public String recurrenceOnMonthDay; - @ApiModelProperty(example = "dd MMMM") + @Schema(example = "dd MMMM") public String monthDayFormat; } - @ApiModel(value = "GetStandingInstructionsStandingInstructionIdResponse") + @Schema(description = "GetStandingInstructionsStandingInstructionIdResponse") public static final class GetStandingInstructionsStandingInstructionIdResponse { private GetStandingInstructionsStandingInstructionIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Long accountDetailId; - @ApiModelProperty(example = "test standing") + @Schema(example = "test standing") public String name; public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromOfficeStandingInstructionSwagger fromOffice; public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromClientStandingInstructionSwagger fromClient; @@ -515,40 +514,40 @@ final class StandingInstructionApiResourceSwagger { public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetPriorityStandingInstructionSwagger priority; public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetInstructionTypeStandingInstructionSwagger instructionType; public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetStatusStandingInstructionSwagger status; - @ApiModelProperty(example = "150.000000") + @Schema(example = "150.000000") public float amount; - @ApiModelProperty(example = "[2014, 4, 3]") + @Schema(example = "[2014, 4, 3]") public LocalDate validFrom; public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetRecurrenceTypeStandingInstructionSwagger recurrenceType; public GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetRecurrenceFrequencyStandingInstructionSwagger recurrenceFrequency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurrenceInterval; - @ApiModelProperty(example = "[4, 3]") + @Schema(example = "[4, 3]") public LocalDate recurrenceOnMonthDay; } - @ApiModel(value = "PutStandingInstructionsStandingInstructionIdResponse") + @Schema(description = "PutStandingInstructionsStandingInstructionIdResponse") public static final class PutStandingInstructionsStandingInstructionIdResponse { private PutStandingInstructionsStandingInstructionIdResponse() {} static final class PutUpdateStandingInstructionChanges { - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer recurrenceInterval; } - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer resourceId; public PutUpdateStandingInstructionChanges changes; } - @ApiModel(value = "PutStandingInstructionsStandingInstructionIdRequest") + @Schema(description = "PutStandingInstructionsStandingInstructionIdRequest") public static final class PutStandingInstructionsStandingInstructionIdRequest { private PutStandingInstructionsStandingInstructionIdRequest() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer recurrenceInterval; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResource.java index 40bab77fb..a2ee50e19 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.portfolio.account.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Date; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -51,9 +51,7 @@ import org.springframework.stereotype.Component; @Path("/standinginstructionrunhistory") @Component @Scope("singleton") -@Api(tags = { "Standing Instructions History" }) -@SwaggerDefinition(tags = { - @Tag(name = "Standing Instructions History", description = "The list capability of history can support pagination and sorting.") }) +@Tag(name = "Standing Instructions History", description = "The list capability of history can support pagination and sorting.") public class StandingInstructionHistoryApiResource { private final PlatformSecurityContext context; @@ -75,27 +73,27 @@ public class StandingInstructionHistoryApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Standing Instructions Logged History", httpMethod = "GET", notes = "The list capability of history can support pagination and sorting \n\n" + @Operation(summary = "Standing Instructions Logged History", description = "The list capability of history can support pagination and sorting \n\n" + "Example Requests :\n" + "\n" + "standinginstructionrunhistory\n" + "\n" + "standinginstructionrunhistory?orderBy=name&sortOrder=DESC\n" + "\n" + "standinginstructionrunhistory?offset=10&limit=50") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = StandingInstructionHistoryApiResourceSwagger.GetStandingInstructionRunHistoryResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionHistoryApiResourceSwagger.GetStandingInstructionRunHistoryResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("transferType") @ApiParam(value = "transferType") final Integer transferType, - @QueryParam("clientName") @ApiParam(value = "clientName") final String clientName, - @QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("fromAccountId") @ApiParam(value = "fromAccountId") final Long fromAccount, - @QueryParam("fromAccountType") @ApiParam(value = "fromAccountType") final Integer fromAccountType, - @QueryParam("locale") @ApiParam(value = "locale") final String locale, - @QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat, - @QueryParam("fromDate") @ApiParam(value = "fromDate") final DateParam fromDateParam, - @QueryParam("toDate") @ApiParam(value = "toDate") final DateParam toDateParam) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("transferType") @Parameter(description = "transferType") final Integer transferType, + @QueryParam("clientName") @Parameter(description = "clientName") final String clientName, + @QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("fromAccountId") @Parameter(description = "fromAccountId") final Long fromAccount, + @QueryParam("fromAccountType") @Parameter(description = "fromAccountType") final Integer fromAccountType, + @QueryParam("locale") @Parameter(description = "locale") final String locale, + @QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat, + @QueryParam("fromDate") @Parameter(description = "fromDate") final DateParam fromDateParam, + @QueryParam("toDate") @Parameter(description = "toDate") final DateParam toDateParam) { this.context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResourceSwagger.java index 7a97bfcca..1aa405689 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionHistoryApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.account.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class StandingInstructionHistoryApiResourceSwagger { private StandingInstructionHistoryApiResourceSwagger() {} - @ApiModel(value = "GetStandingInstructionRunHistoryResponse") + @Schema(description = "GetStandingInstructionRunHistoryResponse") public static final class GetStandingInstructionRunHistoryResponse { private GetStandingInstructionRunHistoryResponse() {} @@ -41,13 +40,13 @@ final class StandingInstructionHistoryApiResourceSwagger { private GetStandingInstructionHistoryPageItemsFromClient() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Test client") + @Schema(example = "Test client") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -55,13 +54,13 @@ final class StandingInstructionHistoryApiResourceSwagger { private GetStandingInstructionHistoryFromAccount() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Long id; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long productId; - @ApiModelProperty(example = "General Savings") + @Schema(example = "General Savings") public String productName; } @@ -69,13 +68,13 @@ final class StandingInstructionHistoryApiResourceSwagger { private GetStandingInstructionHistoryToAccount() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long productId; - @ApiModelProperty(example = "General Savings") + @Schema(example = "General Savings") public String productName; } @@ -83,19 +82,19 @@ final class StandingInstructionHistoryApiResourceSwagger { private GetStandingInstructionHistoryToClient() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Test client") + @Schema(example = "Test client") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long standingInstructionId; - @ApiModelProperty(example = "ACC Transfer") + @Schema(example = "ACC Transfer") public String name; public StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetFromOfficeStandingInstructionSwagger fromOffice; public GetStandingInstructionHistoryPageItemsFromClient fromClient; @@ -105,17 +104,17 @@ final class StandingInstructionHistoryApiResourceSwagger { public GetStandingInstructionHistoryToAccount toAccount; public StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.GetPageItemsStandingInstructionSwagger.GetToOfficeStandingInstructionSwagger toOffice; public GetStandingInstructionHistoryToClient toClient; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Float amount; - @ApiModelProperty(example = "success") + @Schema(example = "success") public String status; - @ApiModelProperty(example = "[2014, 6, 30]") + @Schema(example = "[2014, 6, 30]") public LocalDate executionTime; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String errorLog; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer totalFilteredRecords; public Set pageItems; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java index fbc68f55d..46b0077ac 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java @@ -20,15 +20,14 @@ package org.apache.fineract.portfolio.accounts.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -67,9 +66,7 @@ import org.springframework.stereotype.Component; @Path("/accounts/{type}") @Component @Scope("singleton") -@Api(tags = { "Share Account" }) -@SwaggerDefinition(tags = { - @Tag(name = "Share Account", description = "Share accounts are instances of a praticular share product created for an individual. An application process around the creation of accounts is also supported.") }) +@Tag(name = "Share Account", description = "Share accounts are instances of a praticular share product created for an individual. An application process around the creation of accounts is also supported.") public class AccountsApiResource { private final ApplicationContext applicationContext; @@ -99,13 +96,14 @@ public class AccountsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Share Account Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Share Account Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Requests:\n" + "\n" + "accounts/share/template?clientId=1\n" + "\n" + "\n" + "accounts/share/template?clientId=1&productId=1") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.GetAccountsTypeTemplateResponse.class) }) - public String template(@PathParam("type") @ApiParam(value = "type") final String accountType, - @QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeTemplateResponse.class))) }) + public String template(@PathParam("type") @Parameter(description = "type") final String accountType, + @QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, @Context final UriInfo uriInfo) { try { this.platformSecurityContext.authenticatedUser(); String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME; @@ -122,12 +120,12 @@ public class AccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a share application/account", httpMethod = "GET", notes = "Retrieves a share application/account\n\n" + @Operation(summary = "Retrieve a share application/account", description = "Retrieves a share application/account\n\n" + "Example Requests :\n" + "\n" + "shareaccount/1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.GetAccountsTypeAccountIdResponse.class) }) - public String retrieveAccount(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @PathParam("type") @ApiParam(value = "type") final String accountType, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeAccountIdResponse.class))) }) + public String retrieveAccount(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @PathParam("type") @Parameter(description = "type") final String accountType, @Context final UriInfo uriInfo) { try { String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME; final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -142,12 +140,13 @@ public class AccountsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List share applications/accounts", httpMethod = "GET", notes = "Lists share applications/accounts\n\n" - + "Example Requests:\n" + "\n" + "shareaccount") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.GetAccountsTypeResponse.class) }) - public String retrieveAllAccounts(@PathParam("type") @ApiParam(value = "type") final String accountType, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, @Context final UriInfo uriInfo) { + @Operation(summary = "List share applications/accounts", description = "Lists share applications/accounts\n\n" + "Example Requests:\n" + + "\n" + "shareaccount") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeResponse.class))) }) + public String retrieveAllAccounts(@PathParam("type") @Parameter(description = "type") final String accountType, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, @Context final UriInfo uriInfo) { try { String serviceName = accountType + AccountsApiConstants.READPLATFORM_NAME; AccountReadPlatformService service = (AccountReadPlatformService) this.applicationContext.getBean(serviceName); @@ -162,15 +161,15 @@ public class AccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Submit new share application", httpMethod = "POST", notes = "Submits new share application\n\n" + @Operation(summary = "Submit new share application", description = "Submits new share application\n\n" + "Mandatory Fields: clientId, productId, submittedDate, savingsAccountId, requestedShares, applicationDate\n\n" + "Optional Fields: accountNo, externalId\n\n" + "Inherited from Product (if not provided): minimumActivePeriod, minimumActivePeriodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountsApiResourceSwagger.PostAccountsTypeRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.PostAccountsTypeResponse.class) }) - public String createAccount(@PathParam("type") @ApiParam(value = "type") final String accountType, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeResponse.class))) }) + public String createAccount(@PathParam("type") @Parameter(description = "type") final String accountType, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = null; this.platformSecurityContext.authenticatedUser(); commandWrapper = new CommandWrapperBuilder().createAccount(accountType).withJson(apiRequestBodyAsJson).build(); @@ -182,7 +181,7 @@ public class AccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve share application | Undo approval share application | Reject share application | Activate a share account | Close a share account | Apply additional shares on a share account | Approve additional shares request on a share account | Reject additional shares request on a share account | Redeem shares on a share account", httpMethod = "POST", notes = "Approve share application:\n\n" + @Operation(summary = "Approve share application | Undo approval share application | Reject share application | Activate a share account | Close a share account | Apply additional shares on a share account | Approve additional shares request on a share account | Reject additional shares request on a share account | Redeem shares on a share account", description = "Approve share application:\n\n" + "Approves share application so long as its in 'Submitted and pending approval' state.\n\n" + "Undo approval share application:\n\n" + "Will move 'approved' share application back to 'Submitted and pending approval' state.\n\n" + "Reject share application:\n\n" @@ -201,14 +200,13 @@ public class AccountsApiResource { + "Mandatory Fields: dateFormat,locale,requestedDate,requestedShares\n\n" + "Showing request/response for 'Reject additional shares request on a share account'\n\n" + "For more info visit this link - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#shareaccounts") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountsApiResourceSwagger.PostAccountsTypeAccountIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.PostAccountsTypeAccountIdResponse.class) }) - public String handleCommands(@PathParam("type") @ApiParam(value = "type") final String accountType, - @PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdResponse.class))) }) + public String handleCommands(@PathParam("type") @Parameter(description = "type") final String accountType, + @PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = null; this.platformSecurityContext.authenticatedUser(); commandWrapper = new CommandWrapperBuilder().createAccountCommand(accountType, accountId, commandParam) @@ -221,14 +219,13 @@ public class AccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Modify a share application", httpMethod = "PUT", notes = "Share application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = AccountsApiResourceSwagger.PutAccountsTypeAccountIdRequest.class) }) + @Operation(summary = "Modify a share application", description = "Share application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PutAccountsTypeAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = AccountsApiResourceSwagger.PutAccountsTypeAccountIdResponse.class) }) - public String updateAccount(@PathParam("type") @ApiParam(value = "type") final String accountType, - @PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PutAccountsTypeAccountIdResponse.class))) }) + public String updateAccount(@PathParam("type") @Parameter(description = "type") final String accountType, + @PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { this.platformSecurityContext.authenticatedUser(); final CommandWrapper commandRequest = new CommandWrapperBuilder().updateAccount(accountType, accountId) .withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResourceSwagger.java index b680846de..8be974be8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.accounts.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.List; import java.util.Set; @@ -31,7 +30,7 @@ final class AccountsApiResourceSwagger { private AccountsApiResourceSwagger() {} - @ApiModel(value = "GetAccountsTypeTemplateResponse") + @Schema(description = "GetAccountsTypeTemplateResponse") public static final class GetAccountsTypeTemplateResponse { private GetAccountsTypeTemplateResponse() {} @@ -40,24 +39,24 @@ final class AccountsApiResourceSwagger { private GetAccountsTypeProductOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Share Product") + @Schema(example = "Share Product") public String name; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String shortName; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Long totalShares; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer clientId; - @ApiModelProperty(example = "Client Name") + @Schema(example = "Client Name") public String clientName; public Set productOptions; } - @ApiModel(value = "GetAccountsTypeAccountIdResponse") + @Schema(description = "GetAccountsTypeAccountIdResponse") public static final class GetAccountsTypeAccountIdResponse { private GetAccountsTypeAccountIdResponse() {} @@ -66,21 +65,21 @@ final class AccountsApiResourceSwagger { private GetAccountsStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "shareAccountStatusType.active") + @Schema(example = "shareAccountStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Active") + public String description; + @Schema(example = "false") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } @@ -88,23 +87,23 @@ final class AccountsApiResourceSwagger { private GetAccountsTimeline() {} - @ApiModelProperty(example = "[2016, 4, 1]") + @Schema(example = "[2016, 4, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; - @ApiModelProperty(example = "[2016, 4, 1]") + @Schema(example = "[2016, 4, 1]") public LocalDate approvedDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String approvedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String approvedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String approvedByLastname; - @ApiModelProperty(example = "[2016, 4, 1]") + @Schema(example = "[2016, 4, 1]") public LocalDate activatedDate; } @@ -112,19 +111,19 @@ final class AccountsApiResourceSwagger { private GetAccountsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -132,17 +131,17 @@ final class AccountsApiResourceSwagger { private GetAccountsSummary() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer totalApprovedShares; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer totalPendingForApprovalShares; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "Conflux Share Product") + @Schema(example = "Conflux Share Product") public String productName; public GetAccountsStatus status; public GetAccountsTimeline timeline; @@ -157,43 +156,43 @@ final class AccountsApiResourceSwagger { private GetAccountsPurchasedSharesStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "purchasedSharesStatusType.approved") + @Schema(example = "purchasedSharesStatusType.approved") public String code; - @ApiModelProperty(example = "Approved") - public String value; + @Schema(example = "Approved") + public String description; } static final class GetAccountsPurchasedSharesType { private GetAccountsPurchasedSharesType() {} - @ApiModelProperty(example = "500") + @Schema(example = "500") public Integer id; - @ApiModelProperty(example = "purchasedSharesType.purchased") + @Schema(example = "purchasedSharesType.purchased") public String code; - @ApiModelProperty(example = "Purchase") - public String value; + @Schema(example = "Purchase") + public String description; } - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer id; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer accountId; - @ApiModelProperty(example = "[2016, 4, 1]") + @Schema(example = "[2016, 4, 1]") public LocalDate purchasedDate; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer numberOfShares; - @ApiModelProperty(example = "0.5") + @Schema(example = "0.5") public Double purchasedPrice; public GetAccountsPurchasedSharesStatus status; public GetAccountsPurchasedSharesType type; - @ApiModelProperty(example = "5.05") + @Schema(example = "5.05") public Double amount; - @ApiModelProperty(example = "0.05") + @Schema(example = "0.05") public Double chargeAmount; - @ApiModelProperty(example = "5.05") + @Schema(example = "5.05") public Double amountPaid; } @@ -201,12 +200,12 @@ final class AccountsApiResourceSwagger { private GetAccountsLockPeriodTypeEnum() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "savings.lockin.sharePeriodFrequencyType.days") + @Schema(example = "savings.lockin.sharePeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetAccountsCharges { @@ -217,112 +216,112 @@ final class AccountsApiResourceSwagger { private GetAccountsChargeTimeType() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; - @ApiModelProperty(example = "chargeTimeType.activation") + @Schema(example = "chargeTimeType.activation") public String code; - @ApiModelProperty(example = "Share Account Activate") - public String value; + @Schema(example = "Share Account Activate") + public String description; } static final class GetAccountsChargeCalculationType { private GetAccountsChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetAccountsChargesCurrency { private GetAccountsChargesCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer id; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer chargeId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer accountId; - @ApiModelProperty(example = "Share Account Activation Flat") + @Schema(example = "Share Account Activation Flat") public String name; public GetAccountsChargeTimeType chargeTimeType; public GetAccountsChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetAccountsChargesCurrency currency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Float amount; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountOutstanding; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Float amountOrPercentage; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Long accountNo; - @ApiModelProperty(example = "000000013") + @Schema(example = "000000013") public Long savingsAccountNumber; - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer clientId; - @ApiModelProperty(example = "Client_FirstName_2KX8C Client_LastName_NWNG") + @Schema(example = "Client_FirstName_2KX8C Client_LastName_NWNG") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "Share Product") + @Schema(example = "Share Product") public String productName; public GetAccountsStatus status; public GetAccountsTimeline timeline; public GetAccountsCurrency currency; public GetAccountsSummary summary; public Set purchasedShares; - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer savingsAccountId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer currentMarketPrice; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer lockinPeriod; public GetAccountsLockPeriodTypeEnum lockPeriodTypeEnum; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minimumActivePeriod; public GetAccountsLockPeriodTypeEnum minimumActivePeriodTypeEnum; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean allowDividendCalculationForInactiveClients; public Set charges; - @ApiModelProperty(example = "") + @Schema(example = "") public List dividends; } - @ApiModel(value = "GetAccountsTypeResponse") + @Schema(description = "GetAccountsTypeResponse") public static final class GetAccountsTypeResponse { private GetAccountsTypeResponse() {} @@ -335,21 +334,21 @@ final class AccountsApiResourceSwagger { private GetAccountsTypeStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "shareAccountStatusType.submitted.and.pending.approval") + @Schema(example = "shareAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } @@ -357,7 +356,7 @@ final class AccountsApiResourceSwagger { private GetAccountsTypeTimeline() {} - @ApiModelProperty(example = "[2013, 3, 1]") + @Schema(example = "[2013, 3, 1]") public LocalDate submittedOnDate; } @@ -365,13 +364,13 @@ final class AccountsApiResourceSwagger { private GetAccountsTypePurchasedShares() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "01 May 2013") + @Schema(example = "01 May 2013") public String purchasedDate; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer numberOfShares; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer purchasedPrice; } @@ -382,17 +381,17 @@ final class AccountsApiResourceSwagger { public GetAccountsTypeAccountIdResponse.GetAccountsCharges.GetAccountsChargesCurrency currency; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Client Name") + @Schema(example = "Client Name") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "Share Product Name") + @Schema(example = "Share Product Name") public String productName; public GetAccountsTypeStatus status; public GetAccountsTypeTimeline timeline; @@ -401,12 +400,12 @@ final class AccountsApiResourceSwagger { public GetAccountsTypeSummary summary; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "PostAccountsTypeRequest") + @Schema(description = "PostAccountsTypeRequest") public static final class PostAccountsTypeRequest { private PostAccountsTypeRequest() {} @@ -415,53 +414,53 @@ final class AccountsApiResourceSwagger { private PostAccountsCharges() {} - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer chargeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amount; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer requestedShares; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer externalId; - @ApiModelProperty(example = "01 May 2016") + @Schema(example = "01 May 2016") public String submittedDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minimumActivePeriod; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer minimumActivePeriodFrequencyType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer lockinPeriodFrequency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer lockinPeriodFrequencyType; - @ApiModelProperty(example = "01 May 2016") + @Schema(example = "01 May 2016") public String applicationDate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean allowDividendCalculationForInactiveClients; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; public Set charges; - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer savingsAccountId; } - @ApiModel(value = "PostAccountsTypeResponse") + @Schema(description = "PostAccountsTypeResponse") public static final class PostAccountsTypeResponse { private PostAccountsTypeResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PostAccountsTypeAccountIdRequest") + @Schema(description = "PostAccountsTypeAccountIdRequest") public static final class PostAccountsTypeAccountIdRequest { private PostAccountsTypeAccountIdRequest() {} @@ -470,38 +469,38 @@ final class AccountsApiResourceSwagger { private PostAccountsRequestedShares() {} - @ApiModelProperty(example = "35") + @Schema(example = "35") public Integer id; } public Set requestedShares; } - @ApiModel(value = "PostAccountsTypeAccountIdResponse") + @Schema(description = "PostAccountsTypeAccountIdResponse") public static final class PostAccountsTypeAccountIdResponse { private PostAccountsTypeAccountIdResponse() {} - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer resourceId; } - @ApiModel(value = "PutAccountsTypeAccountIdRequest") + @Schema(description = "PutAccountsTypeAccountIdRequest") public static final class PutAccountsTypeAccountIdRequest { private PutAccountsTypeAccountIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 April 2016") + @Schema(example = "01 April 2016") public String applicationDate; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer requestedShares; } - @ApiModel(value = "PutAccountsTypeAccountIdResponse") + @Schema(description = "PutAccountsTypeAccountIdResponse") public static final class PutAccountsTypeAccountIdResponse { private PutAccountsTypeAccountIdResponse() {} @@ -510,17 +509,17 @@ final class AccountsApiResourceSwagger { private PutAccountsChanges() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 April 2016") + @Schema(example = "01 April 2016") public String applicationDate; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer requestedShares; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutAccountsChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResources.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResources.java index 42f9f9393..f8a08f1d8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResources.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResources.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.portfolio.address.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -52,11 +53,9 @@ import org.springframework.stereotype.Component; @Path("/fieldconfiguration/{entity}") @Component @Scope("singleton") -@Api(tags = { "Entity Field Configuration" }) -@SwaggerDefinition(tags = { - @Tag(name = "Entity Field Configuration", description = "Entity Field configuration API is a generic and extensible \n" - + "wherein various entities and subentities can be related.\n" - + "Also it gives the user an ability to enable/disable fields,\n" + "add regular expression for validation") }) +@Tag(name = "Entity Field Configuration", description = "Entity Field configuration API is a generic and extensible \n" + + "wherein various entities and subentities can be related.\n" + "Also it gives the user an ability to enable/disable fields,\n" + + "add regular expression for validation") public class EntityFieldConfigurationApiResources { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -88,10 +87,11 @@ public class EntityFieldConfigurationApiResources { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(httpMethod = "GET", value = "Retrieves the Entity Field Configuration", notes = "It retrieves all the Entity Field Configuration") + @Operation(summary = "Retrieves the Entity Field Configuration", description = "It retrieves all the Entity Field Configuration") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = EntityFieldConfigurationApiResourcesSwagger.GetFieldConfigurationEntityResponse.class, responseContainer = "List") }) - public String getAddresses(@PathParam("entity") @ApiParam(value = "entity") final String entityname, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntityFieldConfigurationApiResourcesSwagger.GetFieldConfigurationEntityResponse.class)))) }) + public String getAddresses(@PathParam("entity") @Parameter(description = "entity") final String entityname, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); final Collection fldconfig = this.readPlatformServicefld.retrieveFieldConfiguration(entityname); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResourcesSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResourcesSwagger.java index 9a1e3bd7c..5eaa1a89a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResourcesSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/api/EntityFieldConfigurationApiResourcesSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.address.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by Chirag Gupta on 12/01/17. @@ -28,24 +27,24 @@ final class EntityFieldConfigurationApiResourcesSwagger { private EntityFieldConfigurationApiResourcesSwagger() {} - @ApiModel(value = "GetFieldConfigurationEntityResponse") + @Schema(description = "GetFieldConfigurationEntityResponse") public static final class GetFieldConfigurationEntityResponse { private GetFieldConfigurationEntityResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fieldConfigurationId; - @ApiModelProperty(example = "ADDRESS") + @Schema(example = "ADDRESS") public String entity; - @ApiModelProperty(example = "CLIENT") + @Schema(example = "CLIENT") public String subentity; - @ApiModelProperty(example = "addressType") + @Schema(example = "addressType") public String field; - @ApiModelProperty(example = "true") + @Schema(example = "true") public String is_enabled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public String is_mandatory; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String validation_regex; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java index ee33f9313..db0e23216 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.charge.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -59,11 +59,9 @@ import org.springframework.stereotype.Component; @Path("/charges") @Component @Scope("singleton") -@Api(tags = { "Charges" }) -@SwaggerDefinition(tags = { - @Tag(name = "Charges", description = "Its typical for MFIs to add extra costs for their financial products. These are typically Fees or Penalties.\n" - + "\n" + "A Charge on fineract platform is what we use to model both Fees and Penalties.\n" + "\n" - + "At present we support defining charges for use with Client accounts and both loan and saving products.") }) +@Tag(name = "Charges", description = "Its typical for MFIs to add extra costs for their financial products. These are typically Fees or Penalties.\n" + + "\n" + "A Charge on fineract platform is what we use to model both Fees and Penalties.\n" + "\n" + + "At present we support defining charges for use with Client accounts and both loan and saving products.") public class ChargesApiResource { private final Set CHARGES_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "amount", "currency", "penalty", "active", @@ -94,10 +92,10 @@ public class ChargesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Charges", httpMethod = "GET", notes = "Returns the list of defined charges.\n" + "\n" - + "Example Requests:\n" + "\n" + "charges") + @Operation(summary = "Retrieve Charges", description = "Returns the list of defined charges.\n" + "\n" + "Example Requests:\n" + "\n" + + "charges") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ChargesApiResourceSwagger.GetChargesResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ChargesApiResourceSwagger.GetChargesResponse.class)))) }) public String retrieveAllCharges(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -112,10 +110,12 @@ public class ChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Charge", httpMethod = "GET", notes = "Returns the details of a defined Charge.\n" + "\n" - + "Example Requests:\n" + "\n" + "charges/1") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ChargesApiResourceSwagger.GetChargesResponse.class) }) - public String retrieveCharge(@PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId, @Context final UriInfo uriInfo) { + @Operation(summary = "Retrieve a Charge", description = "Returns the details of a defined Charge.\n" + "\n" + "Example Requests:\n" + + "\n" + "charges/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.GetChargesResponse.class))) }) + public String retrieveCharge(@PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -134,9 +134,10 @@ public class ChargesApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Charge Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "charges/template\n") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ChargesApiResourceSwagger.GetChargesTemplateResponse.class) }) + @Operation(summary = "Retrieve Charge Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "charges/template\n") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.GetChargesTemplateResponse.class))) }) public String retrieveNewChargeDetails(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -150,11 +151,11 @@ public class ChargesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create/Define a Charge", httpMethod = "POST", notes = "Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ChargesApiResourceSwagger.PostChargesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ChargesApiResourceSwagger.PostChargesResponse.class) }) - public String createCharge(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create/Define a Charge", description = "Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.PostChargesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.PostChargesResponse.class))) }) + public String createCharge(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createCharge().withJson(apiRequestBodyAsJson).build(); @@ -167,12 +168,12 @@ public class ChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Charge", httpMethod = "PUT", notes = "Updates the details of a Charge.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ChargesApiResourceSwagger.PutChargesChargeIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ChargesApiResourceSwagger.PutChargesChargeIdResponse.class) }) - public String updateCharge(@PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Charge", description = "Updates the details of a Charge.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.PutChargesChargeIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.PutChargesChargeIdResponse.class))) }) + public String updateCharge(@PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCharge(chargeId).withJson(apiRequestBodyAsJson).build(); @@ -185,9 +186,10 @@ public class ChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Charge", httpMethod = "DELETE", notes = "Deletes a Charge.") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ChargesApiResourceSwagger.DeleteChargesChargeIdResponse.class) }) - public String deleteCharge(@PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId) { + @Operation(summary = "Delete a Charge", description = "Deletes a Charge.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.DeleteChargesChargeIdResponse.class))) }) + public String deleteCharge(@PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCharge(chargeId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResourceSwagger.java index fa567151f..c832dc0b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.charge.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -27,24 +26,24 @@ import java.util.Set; */ final class ChargesApiResourceSwagger { - @ApiModel(value = "GetChargesResponse") + @Schema(description = "GetChargesResponse") public static final class GetChargesResponse { private GetChargesResponse() {} static final class GetChargesCurrencyResponse { - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -52,60 +51,60 @@ final class ChargesApiResourceSwagger { private GetChargesTimeTypeResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeTimeType.disbursement") + @Schema(example = "chargeTimeType.disbursement") public String code; - @ApiModelProperty(example = "Disbursement") - public String value; + @Schema(example = "Disbursement") + public String description; } static final class GetChargesAppliesToResponse { private GetChargesAppliesToResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.loan") + @Schema(example = "chargeAppliesTo.loan") public String code; - @ApiModelProperty(example = "Loan") - public String value; + @Schema(example = "Loan") + public String description; } static final class GetChargesCalculationTypeResponse { private GetChargesCalculationTypeResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetChargesPaymentModeResponse { private GetChargesPaymentModeResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.accounttransfer") + @Schema(example = "chargepaymentmode.accounttransfer") public String code; - @ApiModelProperty(example = "Account Transfer") - public String value; + @Schema(example = "Account Transfer") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Loan Service fee") + @Schema(example = "Loan Service fee") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public String active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public String penalty; public GetChargesCurrencyResponse currency; - @ApiModelProperty(example = "230.56") + @Schema(example = "230.56") public Float amount; public GetChargesTimeTypeResponse chargeTimeType; public GetChargesAppliesToResponse chargeAppliesTo; @@ -113,69 +112,69 @@ final class ChargesApiResourceSwagger { public GetChargesPaymentModeResponse chargePaymentMode; } - @ApiModel(value = "PostChargesRequest") + @Schema(description = "PostChargesRequest") public static final class PostChargesRequest { private PostChargesRequest() {} - @ApiModelProperty(example = "Loan Service fee") + @Schema(example = "Loan Service fee") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeAppliesTo; - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "230.56") + @Schema(example = "230.56") public Float amount; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeTimeType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeCalculationType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargePaymentMode; - @ApiModelProperty(example = "true") + @Schema(example = "true") public String active; } - @ApiModel(value = "PostChargesResponse") + @Schema(description = "PostChargesResponse") public static final class PostChargesResponse { private PostChargesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutChargesChargeIdRequest") + @Schema(description = "PutChargesChargeIdRequest") public static final class PutChargesChargeIdRequest { private PutChargesChargeIdRequest() {} - @ApiModelProperty(example = "Loan service fee(changed)") + @Schema(example = "Loan service fee(changed)") public String name; } - @ApiModel(value = "PutChargesChargeIdResponse") + @Schema(description = "PutChargesChargeIdResponse") public static final class PutChargesChargeIdResponse { private PutChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutChargesChargeIdRequest changes; } - @ApiModel(value = "DeleteChargesChargeIdResponse") + @Schema(description = "DeleteChargesChargeIdResponse") public static final class DeleteChargesChargeIdResponse { private DeleteChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetChargesTemplateResponse") + @Schema(description = "GetChargesTemplateResponse") public static final class GetChargesTemplateResponse { private GetChargesTemplateResponse() {} @@ -184,41 +183,41 @@ final class ChargesApiResourceSwagger { private GetChargesTemplateLoanChargeCalculationTypeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetChargesTemplateLoanChargeTimeTypeOptions { private GetChargesTemplateLoanChargeTimeTypeOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetChargesTemplateFeeFrequencyOptions { private GetChargesTemplateFeeFrequencyOptions() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "loanTermFrequency.periodFrequencyType.days") + @Schema(example = "loanTermFrequency.periodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } - @ApiModelProperty(example = "false") + @Schema(example = "false") public String active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public String penalty; public Set currencyOptions; public Set chargeCalculationTypeOptions; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResources.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResources.java index a88655064..14fd5b9a3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResources.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResources.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -59,9 +59,7 @@ import org.springframework.stereotype.Component; @Path("/client") @Component @Scope("singleton") -@Api(tags = { "Clients Address" }) -@SwaggerDefinition(tags = { - @Tag(name = "Clients Address", description = "Address module is an optional module and can be configured into the system by using GlobalConfiguration setting: enable-address. In order to activate Address module, we need to enable the configuration, enable-address by setting its value to true.") }) +@Tag(name = "Clients Address", description = "Address module is an optional module and can be configured into the system by using GlobalConfiguration setting: enable-address. In order to activate Address module, we need to enable the configuration, enable-address by setting its value to true.") public class ClientAddressApiResources { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("addressId", "street", "addressLine1", "addressLine2", @@ -104,14 +102,13 @@ public class ClientAddressApiResources { @Path("/{clientid}/addresses") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create an address for a Client", notes = "Mandatory Fields : \n" + "type and clientId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesRequest.class) }) + @Operation(summary = "Create an address for a Client", description = "Mandatory Fields : \n" + "type and clientId") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesResponse.class) }) - public String addClientAddress(@QueryParam("type") @ApiParam(value = "type") final long addressTypeId, - @PathParam("clientid") @ApiParam(value = "clientId") final long clientid, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesResponse.class))) }) + public String addClientAddress(@QueryParam("type") @Parameter(description = "type") final long addressTypeId, + @PathParam("clientid") @Parameter(description = "clientId") final long clientid, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().addClientAddress(clientid, addressTypeId) .withJson(apiRequestBodyAsJson).build(); @@ -125,13 +122,13 @@ public class ClientAddressApiResources { @Path("/{clientid}/addresses") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List all addresses for a Client", notes = "Example Requests:\n" + "\n" + "client/1/addresses\n" + "\n" + "\n" - + "clients/1/addresses?status=false,true&&type=1,2,3") + @Operation(summary = "List all addresses for a Client", description = "Example Requests:\n" + "\n" + "client/1/addresses\n" + "\n" + + "\n" + "clients/1/addresses?status=false,true&&type=1,2,3") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = ClientAddressApiResourcesSwagger.GetClientClientIdAddressesResponse.class) }) - public String getAddresses(@QueryParam("status") @ApiParam(value = "status") final String status, - @QueryParam("type") @ApiParam(value = "type") final long addressTypeId, - @PathParam("clientid") @ApiParam(value = "clientId") final long clientid, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.GetClientClientIdAddressesResponse.class)))) }) + public String getAddresses(@QueryParam("status") @Parameter(description = "status") final String status, + @QueryParam("type") @Parameter(description = "type") final long addressTypeId, + @PathParam("clientid") @Parameter(description = "clientId") final long clientid, @Context final UriInfo uriInfo) { Collection address; this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -155,14 +152,13 @@ public class ClientAddressApiResources { @Path("/{clientid}/addresses") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update an address for a Client", notes = "All the address fields can be updated by using update client address API\n" + @Operation(summary = "Update an address for a Client", description = "All the address fields can be updated by using update client address API\n" + "\n" + "Mandatory Fields\n" + "type and addressId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesRequest.class))) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesResponse.class) }) - public String updateClientAddress(@PathParam("clientid") @ApiParam(value = "clientId") final long clientid, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PutClientClientIdAddressesResponse.class))) }) + public String updateClientAddress(@PathParam("clientid") @Parameter(description = "clientId") final long clientid, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateClientAddress(clientid).withJson(apiRequestBodyAsJson) .build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResourcesSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResourcesSwagger.java index d2c97a964..81bcbc941 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResourcesSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResourcesSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by Chirag Gupta on 01/12/18. @@ -28,100 +27,100 @@ final class ClientAddressApiResourcesSwagger { private ClientAddressApiResourcesSwagger() {} - @ApiModel(value = "PostClientClientIdAddressesRequest") + @Schema(description = "PostClientClientIdAddressesRequest") public static final class PostClientClientIdAddressesRequest { private PostClientClientIdAddressesRequest() {} - @ApiModelProperty(example = "Ipca") + @Schema(example = "Ipca") public String street; - @ApiModelProperty(example = "Kandivali") + @Schema(example = "Kandivali") public String addressLine1; - @ApiModelProperty(example = "plot47") + @Schema(example = "plot47") public String addressLine2; - @ApiModelProperty(example = "charkop") + @Schema(example = "charkop") public String addressLine3; - @ApiModelProperty(example = "Mumbai") + @Schema(example = "Mumbai") public String city; - @ApiModelProperty(example = "800") + @Schema(example = "800") public Integer stateProvinceId; - @ApiModelProperty(example = "802") + @Schema(example = "802") public Integer countryId; - @ApiModelProperty(example = "400064") + @Schema(example = "400064") public Long postalCode; } - @ApiModel(value = "PostClientClientIdAddressesResponse") + @Schema(description = "PostClientClientIdAddressesResponse") public static final class PostClientClientIdAddressesResponse { private PostClientClientIdAddressesResponse() {} - @ApiModelProperty(example = "15") + @Schema(example = "15") public Integer resourceId; } - @ApiModel(value = "GetClientClientIdAddressesResponse") + @Schema(description = "GetClientClientIdAddressesResponse") public static final class GetClientClientIdAddressesResponse { private GetClientClientIdAddressesResponse() {} - @ApiModelProperty(example = "111755") + @Schema(example = "111755") public Long client_id; - @ApiModelProperty(example = "PERMANENT ADDRESS") + @Schema(example = "PERMANENT ADDRESS") public String addressType; - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer addressId; - @ApiModelProperty(example = "804") + @Schema(example = "804") public Integer addressTypeId; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isActive; - @ApiModelProperty(example = "anki's home") + @Schema(example = "anki's home") public String street; - @ApiModelProperty(example = "test123") + @Schema(example = "test123") public String addressLine1; - @ApiModelProperty(example = "iuyt") + @Schema(example = "iuyt") public String addressLine2; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String addressLine3; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String townVillage; - @ApiModelProperty(example = "mumbai") + @Schema(example = "mumbai") public String city; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String countyDistrict; - @ApiModelProperty(example = "801") + @Schema(example = "801") public Integer stateProvinceId; - @ApiModelProperty(example = "UNITED STATES") + @Schema(example = "UNITED STATES") public String countryName; - @ApiModelProperty(example = "GUJRAT") + @Schema(example = "GUJRAT") public String stateName; - @ApiModelProperty(example = "807") + @Schema(example = "807") public Integer countryId; - @ApiModelProperty(example = "400095") + @Schema(example = "400095") public Long postalCode; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String createdBy; - @ApiModelProperty(example = " ") + @Schema(example = " ") public String updatedBy; } - @ApiModel(value = "PutClientClientIdAddressesRequest") + @Schema(description = "PutClientClientIdAddressesRequest") public static final class PutClientClientIdAddressesRequest { private PutClientClientIdAddressesRequest() {} - @ApiModelProperty(example = "67") + @Schema(example = "67") public Integer addressId; - @ApiModelProperty(example = "goldensource") + @Schema(example = "goldensource") public String street; } - @ApiModel(value = "PutClientClientIdAddressesResponse") + @Schema(description = "PutClientClientIdAddressesResponse") public static final class PutClientClientIdAddressesResponse { private PutClientClientIdAddressesResponse() {} - @ApiModelProperty(example = "67") + @Schema(example = "67") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResource.java index 495f947ea..03b6a03ff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.Set; @@ -67,11 +66,9 @@ import org.springframework.util.CollectionUtils; @Path("/clients/{clientId}/charges") @Component -@Api(tags = { "Client Charges" }) -@SwaggerDefinition(tags = { - @Tag(name = "Client Charges", description = "It is typical for MFI's to directly associate charges with an implicit Client account. These can be either fees or penalties\n" - + "\n" - + "Client Charges are client specific instances of Charges. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Client account) are described here") }) +@Tag(name = "Client Charges", description = "It is typical for MFI's to directly associate charges with an implicit Client account. These can be either fees or penalties\n" + + "\n" + + "Client Charges are client specific instances of Charges. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Client account) are described here") public class ClientChargesApiResource { private final PlatformSecurityContext context; @@ -101,15 +98,15 @@ public class ClientChargesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Client Charges", notes = "The list capability of client charges supports pagination." + @Operation(summary = "List Client Charges", description = "The list capability of client charges supports pagination." + "Example Requests:\n" + "clients/1/charges\n" + "\nclients/1/charges?offset=0&limit=5") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientChargesApiResourceSwagger.GetClientsClientIdChargesResponse.class) }) - public String retrieveAllClientCharges(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @DefaultValue(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS_VALUE_ALL) @QueryParam(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS) @ApiParam(value = "chargeStatus") final String chargeStatus, - @QueryParam("pendingPayment") @ApiParam(value = "pendingPayment") final Boolean pendingPayment, @Context final UriInfo uriInfo, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.GetClientsClientIdChargesResponse.class))) }) + public String retrieveAllClientCharges(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @DefaultValue(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS_VALUE_ALL) @QueryParam(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS) @Parameter(description = "chargeStatus") final String chargeStatus, + @QueryParam("pendingPayment") @Parameter(description = "pendingPayment") final Boolean pendingPayment, + @Context final UriInfo uriInfo, @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); if (!(is(chargeStatus, ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS_VALUE_ALL) @@ -151,12 +148,12 @@ public class ClientChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client Charge", notes = "Example Requests:\n" + "clients/1/charges/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Client Charge", description = "Example Requests:\n" + "clients/1/charges/1\n" + "\n" + "\n" + "clients/1/charges/1?fields=name,id") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ClientChargesApiResourceSwagger.GetClientsClientIdChargesResponse.GetClientsChargesPageItems.class) }) - public String retrieveClientCharge(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.GetClientsClientIdChargesResponse.GetClientsChargesPageItems.class))) }) + public String retrieveClientCharge(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME); ClientChargeData clientCharge = this.clientChargeReadPlatformService.retrieveClientCharge(clientId, chargeId); @@ -182,14 +179,13 @@ public class ClientChargesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Add Client Charge", notes = " This API associates a Client charge with an implicit Client account\n" + @Operation(summary = "Add Client Charge", description = " This API associates a Client charge with an implicit Client account\n" + "Mandatory Fields : \n" + "chargeId and dueDate \n" + "Optional Fields : \n" + "amount") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientChargesApiResourceSwagger.PostClientsClientIdChargesRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.PostClientsClientIdChargesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = ClientChargesApiResourceSwagger.PostClientsClientIdChargesResponse.class) }) - public String applyClientCharge(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.PostClientsClientIdChargesResponse.class))) }) + public String applyClientCharge(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createClientCharge(clientId).withJson(apiRequestBodyAsJson) .build(); @@ -203,19 +199,18 @@ public class ClientChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Pay a Client Charge | Waive a Client Charge", notes = "Pay a Client Charge:\n\n" + "Mandatory Fields:" + @Operation(summary = "Pay a Client Charge | Waive a Client Charge", description = "Pay a Client Charge:\n\n" + "Mandatory Fields:" + "transactionDate and amount " + "" + "\"Pay either a part of or the entire due amount for a charge.(command=paycharge)\n" + "\n" + "Waive a Client Charge:\n" + "\n" + "\n" + "This API provides the facility of waiving off the remaining amount on a client charge (command=waive)\n\n" + "Showing request/response for 'Pay a Client Charge'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientChargesApiResourceSwagger.PostClientsClientIdChargesChargeIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.PostClientsClientIdChargesChargeIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientChargesApiResourceSwagger.PostClientsClientIdChargesChargeIdResponse.class) }) - public String payOrWaiveClientCharge(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.PostClientsClientIdChargesChargeIdResponse.class))) }) + public String payOrWaiveClientCharge(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String json = ""; if (is(commandParam, ClientApiConstants.CLIENT_CHARGE_COMMAND_WAIVE_CHARGE)) { @@ -250,11 +245,11 @@ public class ClientChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Client Charge", notes = "Deletes a Client Charge on which no transactions have taken place (either payments or waivers). ") + @Operation(summary = "Delete a Client Charge", description = "Deletes a Client Charge on which no transactions have taken place (either payments or waivers). ") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientChargesApiResourceSwagger.DeleteClientsClientIdChargesChargeIdResponse.class) }) - public String deleteClientCharge(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.DeleteClientsClientIdChargesChargeIdResponse.class))) }) + public String deleteClientCharge(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteClientCharge(clientId, chargeId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResourceSwagger.java index 8d77a24b9..cf9da1fb5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.time.LocalDate; import java.util.Set; @@ -31,7 +30,7 @@ final class ClientChargesApiResourceSwagger { private ClientChargesApiResourceSwagger() {} - @ApiModel(value = "GetClientsClientIdChargesResponse") + @Schema(description = "GetClientsClientIdChargesResponse") public static final class GetClientsClientIdChargesResponse { private GetClientsClientIdChargesResponse() {} @@ -44,152 +43,152 @@ final class ClientChargesApiResourceSwagger { private GetClientChargeTimeType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetClientChargeCalculationType { private GetClientChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetClientChargeCurrency { private GetClientChargeCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer chargeId; - @ApiModelProperty(example = "Client Fee 1") + @Schema(example = "Client Fee 1") public String name; public GetClientChargeTimeType chargeTimeType; - @ApiModelProperty(example = "[2015, 8, 17]") + @Schema(example = "[2015, 8, 17]") public LocalDate dueDate; public GetClientChargeCalculationType chargeCalculationType; public GetClientChargeCurrency currency; - @ApiModelProperty(example = "100.000000") + @Schema(example = "100.000000") public BigDecimal amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public BigDecimal amountPaid; - @ApiModelProperty(example = "100.000000") + @Schema(example = "100.000000") public BigDecimal amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public BigDecimal amountWrittenOff; - @ApiModelProperty(example = "0.000000") + @Schema(example = "0.000000") public BigDecimal amountOutstanding; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isPaid; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isWaived; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "PostClientsClientIdChargesRequest") + @Schema(description = "PostClientsClientIdChargesRequest") public static final class PostClientsClientIdChargesRequest { private PostClientsClientIdChargesRequest() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amount; - @ApiModelProperty(example = "226") + @Schema(example = "226") public Integer chargeId; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 September 2015") + @Schema(example = "01 September 2015") public String dueDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModel(value = "PostClientsClientIdChargesResponse") + @Schema(description = "PostClientsClientIdChargesResponse") public static final class PostClientsClientIdChargesResponse { private PostClientsClientIdChargesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "189") + @Schema(example = "189") public Integer chargeId; - @ApiModelProperty(example = "164") + @Schema(example = "164") public Integer resourceId; } - @ApiModel(value = "PostClientsClientIdChargesChargeIdRequest") + @Schema(description = "PostClientsClientIdChargesChargeIdRequest") public static final class PostClientsClientIdChargesChargeIdRequest { private PostClientsClientIdChargesChargeIdRequest() {} - @ApiModelProperty(example = "200") + @Schema(example = "200") public Integer amount; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 September 2015") + @Schema(example = "01 September 2015") public String transactionDate; } - @ApiModel(value = "PostClientsClientIdChargesChargeIdResponse") + @Schema(description = "PostClientsClientIdChargesChargeIdResponse") public static final class PostClientsClientIdChargesChargeIdResponse { private PostClientsClientIdChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "189") + @Schema(example = "189") public Integer clientId; - @ApiModelProperty(example = "157") + @Schema(example = "157") public Integer resourceId; - @ApiModelProperty(example = "221") + @Schema(example = "221") public Integer transactionId; } - @ApiModel(value = "DeleteClientsClientIdChargesChargeIdResponse") + @Schema(description = "DeleteClientsClientIdChargesChargeIdResponse") public static final class DeleteClientsClientIdChargesChargeIdResponse { private DeleteClientsClientIdChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "189") + @Schema(example = "189") public Integer clientId; - @ApiModelProperty(example = "164") + @Schema(example = "164") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResource.java index 72d7fb3a0..6babb0c09 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -64,10 +64,8 @@ import org.springframework.stereotype.Component; @Path("/clients/{clientId}/identifiers") @Component @Scope("singleton") -@Api(tags = { "Client Identifier" }) -@SwaggerDefinition(tags = { - @Tag(name = "Client Identifier", description = "Client Identifiers refer to documents that are used to uniquely identify a customer\n" - + "Ex: Drivers License, Passport, Ration card etc ") }) +@Tag(name = "Client Identifier", description = "Client Identifiers refer to documents that are used to uniquely identify a customer\n" + + "Ex: Drivers License, Passport, Ration card etc ") public class ClientIdentifiersApiResource { private static final Set CLIENT_IDENTIFIER_DATA_PARAMETERS = new HashSet<>( @@ -102,12 +100,12 @@ public class ClientIdentifiersApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List all Identifiers for a Client", notes = "Example Requests:\n" + "clients/1/identifiers\n" + "\n" + "\n" + @Operation(summary = "List all Identifiers for a Client", description = "Example Requests:\n" + "clients/1/identifiers\n" + "\n" + "\n" + "clients/1/identifiers?fields=documentKey,documentType,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = ClientIdentifiersApiResourceSwagger.GetClientsClientIdIdentifiersResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.GetClientsClientIdIdentifiersResponse.class)))) }) public String retrieveAllClientIdentifiers(@Context final UriInfo uriInfo, - @PathParam("clientId") @ApiParam(value = "clientId") final Long clientId) { + @PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -122,10 +120,10 @@ public class ClientIdentifiersApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Client Identifier Details Template", notes = "This is a convenience resource useful for building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + " Field Defaults\n" + " Allowed Value Lists\n" + "\n\nExample Request:\n" + "clients/1/identifiers/template") + @Operation(summary = "Retrieve Client Identifier Details Template", description = "This is a convenience resource useful for building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + " Field Defaults\n" + " Allowed description Lists\n" + "\n\nExample Request:\n" + "clients/1/identifiers/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientIdentifiersApiResourceSwagger.GetClientsClientIdIdentifiersTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.GetClientsClientIdIdentifiersTemplateResponse.class))) }) public String newClientIdentifierDetails(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -140,13 +138,12 @@ public class ClientIdentifiersApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create an Identifier for a Client", notes = "Mandatory Fields\n" + "documentKey, documentTypeId ") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientIdentifiersApiResourceSwagger.PostClientsClientIdIdentifiersRequest.class) }) + @Operation(summary = "Create an Identifier for a Client", description = "Mandatory Fields\n" + "documentKey, documentTypeId ") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.PostClientsClientIdIdentifiersRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientIdentifiersApiResourceSwagger.PostClientsClientIdIdentifiersResponse.class) }) - public String createClientIdentifier(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.PostClientsClientIdIdentifiersResponse.class))) }) + public String createClientIdentifier(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { try { final CommandWrapper commandRequest = new CommandWrapperBuilder().createClientIdentifier(clientId) @@ -172,12 +169,13 @@ public class ClientIdentifiersApiResource { @Path("{identifierId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client Identifier", notes = "Example Requests:\n" + "clients/1/identifier/2\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Client Identifier", description = "Example Requests:\n" + "clients/1/identifier/2\n" + "\n" + "\n" + "clients/1/identifier/2?template=true\n" + "\n" + "clients/1/identifiers/2?fields=documentKey,documentType,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientIdentifiersApiResourceSwagger.GetClientsClientIdIdentifiersResponse.class) }) - public String retrieveClientIdentifiers(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("identifierId") @ApiParam(value = "identifierId") final Long clientIdentifierId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.GetClientsClientIdIdentifiersResponse.class))) }) + public String retrieveClientIdentifiers(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("identifierId") @Parameter(description = "identifierId") final Long clientIdentifierId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -197,14 +195,13 @@ public class ClientIdentifiersApiResource { @Path("{identifierId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Client Identifier", notes = "Updates a Client Identifier") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientIdentifiersApiResourceSwagger.PutClientsClientIdIdentifiersIdentifierIdRequest.class) }) + @Operation(summary = "Update a Client Identifier", description = "Updates a Client Identifier") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.PutClientsClientIdIdentifiersIdentifierIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientIdentifiersApiResourceSwagger.PutClientsClientIdIdentifiersIdentifierIdResponse.class) }) - public String updateClientIdentifer(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("identifierId") @ApiParam(value = "identifierId") final Long clientIdentifierId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.PutClientsClientIdIdentifiersIdentifierIdResponse.class))) }) + public String updateClientIdentifer(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("identifierId") @Parameter(description = "identifierId") final Long clientIdentifierId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { try { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateClientIdentifier(clientId, clientIdentifierId) @@ -229,11 +226,11 @@ public class ClientIdentifiersApiResource { @Path("{identifierId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Client Identifier", notes = "Deletes a Client Identifier") + @Operation(summary = "Delete a Client Identifier", description = "Deletes a Client Identifier") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientIdentifiersApiResourceSwagger.DeleteClientsClientIdIdentifiersIdentifierIdResponse.class) }) - public String deleteClientIdentifier(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("identifierId") @ApiParam(value = "identifierId") final Long clientIdentifierId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.DeleteClientsClientIdIdentifiersIdentifierIdResponse.class))) }) + public String deleteClientIdentifier(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("identifierId") @Parameter(description = "identifierId") final Long clientIdentifierId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteClientIdentifier(clientId, clientIdentifierId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResourceSwagger.java index 3f4f896f5..7db6ed6c0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientIdentifiersApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class ClientIdentifiersApiResourceSwagger { private ClientIdentifiersApiResourceSwagger() {} - @ApiModel(value = "GetClientsClientIdIdentifiersResponse") + @Schema(description = "GetClientsClientIdIdentifiersResponse") public static final class GetClientsClientIdIdentifiersResponse { private GetClientsClientIdIdentifiersResponse() {} @@ -38,24 +37,24 @@ final class ClientIdentifiersApiResourceSwagger { private GetClientsDocumentType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "Drivers License") + @Schema(example = "Drivers License") public String name; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; public GetClientsDocumentType documentType; - @ApiModelProperty(example = "12345") + @Schema(example = "12345") public String documentKey; - @ApiModelProperty(example = "Issued in the year 2--7") + @Schema(example = "Issued in the year 2--7") public String description; } - @ApiModel(value = "GetClientsClientIdIdentifiersTemplateResponse") + @Schema(description = "GetClientsClientIdIdentifiersTemplateResponse") public static final class GetClientsClientIdIdentifiersTemplateResponse { private GetClientsClientIdIdentifiersTemplateResponse() {} @@ -64,80 +63,80 @@ final class ClientIdentifiersApiResourceSwagger { private GetClientsAllowedDocumentTypes() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Passport") + @Schema(example = "Passport") public String name; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } public Set allowedDocumentTypes; } - @ApiModel(value = "PostClientsClientIdIdentifiersRequest") + @Schema(description = "PostClientsClientIdIdentifiersRequest") public static final class PostClientsClientIdIdentifiersRequest { private PostClientsClientIdIdentifiersRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer documentTypeId; - @ApiModelProperty(example = "KA-54677") + @Schema(example = "KA-54677") public String documentKey; - @ApiModelProperty(example = "Document has been verified") + @Schema(example = "Document has been verified") public String description; } - @ApiModel(value = "PutClientsClientIdIdentifiersIdentifierIdRequest") + @Schema(description = "PutClientsClientIdIdentifiersIdentifierIdRequest") public static final class PutClientsClientIdIdentifiersIdentifierIdRequest { private PutClientsClientIdIdentifiersIdentifierIdRequest() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer documentTypeId; - @ApiModelProperty(example = "KA-94667") + @Schema(example = "KA-94667") public String documentKey; - @ApiModelProperty(example = "Document has been updated") + @Schema(example = "Document has been updated") public String description; } - @ApiModel(value = "PutClientsClientIdIdentifiersIdentifierIdResponse") + @Schema(description = "PutClientsClientIdIdentifiersIdentifierIdResponse") public static final class PutClientsClientIdIdentifiersIdentifierIdResponse { private PutClientsClientIdIdentifiersIdentifierIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer resourceId; public PutClientsClientIdIdentifiersIdentifierIdRequest changes; } - @ApiModel(value = "PostClientsClientIdIdentifiersResponse") + @Schema(description = "PostClientsClientIdIdentifiersResponse") public static final class PostClientsClientIdIdentifiersResponse { private PostClientsClientIdIdentifiersResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer resourceId; } - @ApiModel(value = "DeleteClientsClientIdIdentifiersIdentifierIdResponse") + @Schema(description = "DeleteClientsClientIdIdentifiersIdentifierIdResponse") public static final class DeleteClientsClientIdIdentifiersIdentifierIdResponse { private DeleteClientsClientIdIdentifiersIdentifierIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResource.java index eb9c1e175..8532fd630 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -54,9 +54,7 @@ import org.springframework.stereotype.Component; @Path("/clients/{clientId}/transactions") @Component -@Api(tags = { "Client Transaction" }) -@SwaggerDefinition(tags = { - @Tag(name = "Client Transaction", description = "Client Transactions refer to transactions made directly againt a Client's internal account. Currently, these transactions are only created as a result of charge payments/waivers. You are allowed to undo a transaction, however you cannot explicitly create one. ") }) +@Tag(name = "Client Transaction", description = "Client Transactions refer to transactions made directly againt a Client's internal account. Currently, these transactions are only created as a result of charge payments/waivers. You are allowed to undo a transaction, however you cannot explicitly create one. ") public class ClientTransactionsApiResource { private final PlatformSecurityContext context; @@ -81,13 +79,13 @@ public class ClientTransactionsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Client Transactions", notes = "The list capability of client transaction can support pagination." + "\n\n" - + "Example Requests:\n\n" + "clients/189/transactions\n\n" + "clients/189/transactions?offset=10&limit=50") + @Operation(summary = "List Client Transactions", description = "The list capability of client transaction can support pagination." + + "\n\n" + "Example Requests:\n\n" + "clients/189/transactions\n\n" + "clients/189/transactions?offset=10&limit=50") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsResponse.class) }) - public String retrieveAllClientTransactions(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @Context final UriInfo uriInfo, @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsResponse.class))) }) + public String retrieveAllClientTransactions(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @Context final UriInfo uriInfo, @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME); SearchParameters searchParameters = SearchParameters.forPagination(offset, limit); @@ -103,12 +101,13 @@ public class ClientTransactionsApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client Transaction", notes = "Example Requests:\n" + "clients/1/transactions/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Client Transaction", description = "Example Requests:\n" + "clients/1/transactions/1\n" + "\n" + "\n" + "clients/1/transactions/1?fields=id,officeName") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsTransactionIdResponse.class) }) - public String retrieveClientTransaction(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsTransactionIdResponse.class))) }) + public String retrieveClientTransaction(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME); @@ -124,13 +123,13 @@ public class ClientTransactionsApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Undo a Client Transaction", notes = "Undoes a Client Transaction") + @Operation(summary = "Undo a Client Transaction", description = "Undoes a Client Transaction") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ClientTransactionsApiResourceSwagger.PostClientsClientIdTransactionsTransactionIdResponse.class) }) - public String undoClientTransaction(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.PostClientsClientIdTransactionsTransactionIdResponse.class))) }) + public String undoClientTransaction(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String json = ""; if (is(commandParam, ClientApiConstants.CLIENT_TRANSACTION_COMMAND_UNDO)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResourceSwagger.java index 6b8415f63..6c8c74a3c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.time.LocalDate; import java.util.Set; @@ -31,7 +30,7 @@ final class ClientTransactionsApiResourceSwagger { private ClientTransactionsApiResourceSwagger() {} - @ApiModel(value = "GetClientsClientIdTransactionsResponse") + @Schema(description = "GetClientsClientIdTransactionsResponse") public static final class GetClientsClientIdTransactionsResponse { private GetClientsClientIdTransactionsResponse() {} @@ -44,88 +43,88 @@ final class ClientTransactionsApiResourceSwagger { private GetClientsClientIdTransactionsType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "clientTransactionType.payCharge") + @Schema(example = "clientTransactionType.payCharge") public String code; - @ApiModelProperty(example = "PAY_CHARGE") - public String value; + @Schema(example = "PAY_CHARGE") + public String description; } static final class GetClientTransactionsCurrency { private GetClientTransactionsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "226") + @Schema(example = "226") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetClientsClientIdTransactionsType type; - @ApiModelProperty(example = "[2015, 9, 2]") + @Schema(example = "[2015, 9, 2]") public LocalDate date; public GetClientTransactionsCurrency currency; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Double amount; - @ApiModelProperty(example = "[2015, 9, 2]") + @Schema(example = "[2015, 9, 2]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean reversed; } - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetClientsClientIdTransactionsTransactionIdResponse") + @Schema(description = "GetClientsClientIdTransactionsTransactionIdResponse") public static final class GetClientsClientIdTransactionsTransactionIdResponse { private GetClientsClientIdTransactionsTransactionIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetClientsClientIdTransactionsResponse.GetClientsPageItems.GetClientsClientIdTransactionsType type; - @ApiModelProperty(example = "[2015, 8, 17]") + @Schema(example = "[2015, 8, 17]") public LocalDate date; public GetClientsClientIdTransactionsResponse.GetClientsPageItems.GetClientTransactionsCurrency currency; - @ApiModelProperty(example = "60.000000") + @Schema(example = "60.000000") public BigDecimal amount; - @ApiModelProperty(example = "[2015, 8, 17]") + @Schema(example = "[2015, 8, 17]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean reversed; } - @ApiModel(value = "PostClientsClientIdTransactionsTransactionIdResponse") + @Schema(description = "PostClientsClientIdTransactionsTransactionIdResponse") public static final class PostClientsClientIdTransactionsTransactionIdResponse { private PostClientsClientIdTransactionsTransactionIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "189") + @Schema(example = "189") public Integer clientId; - @ApiModelProperty(example = "222") + @Schema(example = "222") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResource.java index 2cd79067a..fc3f163ea 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResource.java @@ -20,15 +20,14 @@ package org.apache.fineract.portfolio.client.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -80,10 +79,8 @@ import org.springframework.stereotype.Component; @Path("/clients") @Component @Scope("singleton") -@Api(tags = { "Client" }) -@SwaggerDefinition(tags = { - @Tag(name = "Client", description = "Clients are people and businesses that have applied (or may apply) to an MFI for loans.\n" - + "\n" + "Clients can be created in Pending or straight into Active state.") }) +@Tag(name = "Client", description = "Clients are people and businesses that have applied (or may apply) to an MFI for loans.\n" + "\n" + + "Clients can be created in Pending or straight into Active state.") public class ClientsApiResource { private final PlatformSecurityContext context; @@ -125,13 +122,14 @@ public class ClientsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Client Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Client Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Request:\n" + "\n" + "clients/template") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.GetClientsTemplateResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo, - @ApiParam(value = "officeId") @QueryParam("officeId") final Long officeId, - @QueryParam("commandParam") @ApiParam(value = "commandParam") final String commandParam, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { + @Parameter(description = "officeId") @QueryParam("officeId") final Long officeId, + @QueryParam("commandParam") @Parameter(description = "commandParam") final String commandParam, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_RESOURCE_NAME); @@ -156,23 +154,24 @@ public class ClientsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Clients", notes = "The list capability of clients can support pagination and sorting.\n\n" + @Operation(summary = "List Clients", description = "The list capability of clients can support pagination and sorting.\n\n" + "Example Requests:\n" + "\n" + "clients\n" + "\n" + "clients?fields=displayName,officeName,timeline\n" + "\n" + "clients?offset=10&limit=50\n" + "\n" + "clients?orderBy=displayName&sortOrder=DESC") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.GetClientsResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("displayName") @ApiParam(value = "displayName") final String displayName, - @QueryParam("firstName") @ApiParam(value = "firstName") final String firstname, - @QueryParam("lastName") @ApiParam(value = "lastName") final String lastname, - @QueryParam("underHierarchy") @ApiParam(value = "underHierarchy") final String hierarchy, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("orphansOnly") @ApiParam(value = "orphansOnly") final Boolean orphansOnly) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("displayName") @Parameter(description = "displayName") final String displayName, + @QueryParam("firstName") @Parameter(description = "firstName") final String firstname, + @QueryParam("lastName") @Parameter(description = "lastName") final String lastname, + @QueryParam("underHierarchy") @Parameter(description = "underHierarchy") final String hierarchy, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("orphansOnly") @Parameter(description = "orphansOnly") final Boolean orphansOnly) { return this.retrieveAll(uriInfo, sqlSearch, officeId, externalId, displayName, firstname, lastname, hierarchy, offset, limit, orderBy, sortOrder, orphansOnly, false); @@ -197,11 +196,13 @@ public class ClientsApiResource { @Path("{clientId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client", notes = "Example Requests:\n" + "\n" + "clients/1\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Client", description = "Example Requests:\n" + "\n" + "clients/1\n" + "\n" + "\n" + "clients/1?template=true\n" + "\n" + "\n" + "clients/1?fields=id,displayName,officeName") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.GetClientsClientIdResponse.class) }) - public String retrieveOne(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, @Context final UriInfo uriInfo, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsClientIdResponse.class))) }) + public String retrieveOne(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @Context final UriInfo uriInfo, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_RESOURCE_NAME); @@ -224,15 +225,15 @@ public class ClientsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Client", httpMethod = "POST", notes = "Note:\n\n" + @Operation(summary = "Create a Client", description = "Note:\n\n" + "1. You can enter either:firstname/middlename/lastname - for a person (middlename is optional) OR fullname - for a business or organisation (or person known by one name).\n" + "\n" + "2.If address is enable(enable-address=true), then additional field called address has to be passed.\n\n" + "Mandatory Fields: firstname and lastname OR fullname, officeId, active=true and activationDate OR active=false, if(address enabled) address\n\n" + "Optional Fields: groupId, externalId, accountNo, staffId, mobileNo, savingsProductId, genderId, clientTypeId, clientClassificationId") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", dataType = "ClientData", required = true, type = "body", dataTypeClass = ClientsApiResourceSwagger.PostClientsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.PostClientsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createClient() // @@ -248,15 +249,15 @@ public class ClientsApiResource { @Path("{clientId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Client", notes = "Note: You can update any of the basic attributes of a client (but not its associations) using this API.\n" + @Operation(summary = "Update a Client", description = "Note: You can update any of the basic attributes of a client (but not its associations) using this API.\n" + "\n" + "Changing the relationship between a client and its office is not supported through this API. An API specific to handling transfers of clients between offices is available for the same.\n" + "\n" + "The relationship between a client and a group must be removed through the Groups API.") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "body", dataType = "ClientData", required = true, type = "body", dataTypeClass = ClientsApiResourceSwagger.PutClientsClientIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.PutClientsClientIdResponse.class) }) - public String update(@ApiParam(value = "clientId") @PathParam("clientId") final Long clientId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PutClientsClientIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PutClientsClientIdResponse.class))) }) + public String update(@Parameter(description = "clientId") @PathParam("clientId") final Long clientId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateClient(clientId) // @@ -272,12 +273,11 @@ public class ClientsApiResource { @Path("{clientId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Client", notes = "If a client is in Pending state, you are allowed to Delete it. The delete is a 'hard delete' and cannot be recovered from. Once clients become active or have loans or savings associated with them, you cannot delete the client but you may Close the client if they have left the program.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientsApiResourceSwagger.DeleteClientsClientIdRequest.class) }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.DeleteClientsClientIdResponse.class) }) - public String delete(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId) { + @Operation(summary = "Delete a Client", description = "If a client is in Pending state, you are allowed to Delete it. The delete is a 'hard delete' and cannot be recovered from. Once clients become active or have loans or savings associated with them, you cannot delete the client but you may Close the client if they have left the program.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.DeleteClientsClientIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.DeleteClientsClientIdResponse.class))) }) + public String delete(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteClient(clientId) // @@ -292,7 +292,7 @@ public class ClientsApiResource { @Path("{clientId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Activate a Client | Close a Client | Reject a Client | Withdraw a Client | Reactivate a Client | UndoReject a Client | UndoWithdraw a Client | Assign a Staff | Unassign a Staff | Update Default Savings Account | Propose a Client Transfer | Withdraw a Client Transfer | Reject a Client Transfer | Accept a Client Transfer | Propose and Accept a Client Transfer", notes = "Activate a Client:\n\n" + @Operation(summary = "Activate a Client | Close a Client | Reject a Client | Withdraw a Client | Reactivate a Client | UndoReject a Client | UndoWithdraw a Client | Assign a Staff | Unassign a Staff | Update Default Savings Account | Propose a Client Transfer | Withdraw a Client Transfer | Reject a Client Transfer | Accept a Client Transfer | Propose and Accept a Client Transfer", description = "Activate a Client:\n\n" + "Clients can be created in a Pending state. This API exists to enable client activation (for when a client becomes an approved member of the financial Institution).\n" + "\n" + "If the client happens to be already active this API will result in an error.\n\n" + "Close a Client:\n\n" + "Clients can be closed if they do not have any non-closed loans/savingsAccount. This API exists to close a client .\n" + "\n" @@ -322,12 +322,12 @@ public class ClientsApiResource { + "Propose and Accept a Client Transfer:\n\n" + "Abstraction over the Propose and Accept Client Transfer API's which enable a user with Data Scope over both the Target and Destination Branches to directly transfer a Client to the destination Office.\n\n" + "Showing request/response for 'Reject a Client Transfer'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ClientsApiResourceSwagger.PostClientsClientIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.PostClientsClientIdResponse.class) }) - public String activate(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsClientIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsClientIdResponse.class))) }) + public String activate(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -399,12 +399,13 @@ public class ClientsApiResource { @Path("{clientId}/accounts") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve client accounts overview", notes = "An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application.\n" + @Operation(summary = "Retrieve client accounts overview", description = "An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application.\n" + "It is quite reasonable to add resources like this to simplify User Interface development.\n" + "\n" + "Example Requests:\n " + "\n" + "clients/1/accounts\n" + "\n" + "clients/1/accounts?fields=loanAccounts,savingsAccounts") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ClientsApiResourceSwagger.GetClientsClientIdAccountsResponse.class), - @ApiResponse(code = 400, message = "Bad Request") }) - public String retrieveAssociatedAccounts(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsClientIdAccountsResponse.class))), + @ApiResponse(responseCode = "400", description = "Bad Request") }) + public String retrieveAssociatedAccounts(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_RESOURCE_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResourceSwagger.java index 548eb76e0..e45b2f06e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.client.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.List; import java.util.Set; @@ -31,7 +30,7 @@ final class ClientsApiResourceSwagger { private ClientsApiResourceSwagger() {} - @ApiModel(value = "GetClientsTemplateResponse") + @Schema(description = "GetClientsTemplateResponse") public static final class GetClientsTemplateResponse { private GetClientsTemplateResponse() {} @@ -40,11 +39,11 @@ final class ClientsApiResourceSwagger { private GetClientsOfficeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; } @@ -52,21 +51,21 @@ final class ClientsApiResourceSwagger { private GetClientsStaffOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "xyz") + @Schema(example = "xyz") public String firstname; - @ApiModelProperty(example = "sjs") + @Schema(example = "sjs") public String lastname; - @ApiModelProperty(example = "sjs, xyz") + @Schema(example = "sjs, xyz") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isLoanOfficer; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; } @@ -74,13 +73,13 @@ final class ClientsApiResourceSwagger { private GetClientsSavingProductOptions() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "account overdraft") + @Schema(example = "account overdraft") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawalFeeForTransfers; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean allowOverdraft; } @@ -92,32 +91,32 @@ final class ClientsApiResourceSwagger { private GetClientsColumnHeaderData() {} - @ApiModelProperty(example = "client_id") + @Schema(example = "client_id") public String columnName; - @ApiModelProperty(example = "bigint") + @Schema(example = "bigint") public String columnType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer columnLength; - @ApiModelProperty(example = "INTEGER") + @Schema(example = "INTEGER") public String columnDisplayType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isColumnNullable; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isColumnPrimaryKey; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List columnValues; } - @ApiModelProperty(example = "m_client") + @Schema(example = "m_client") public String applicationTableName; - @ApiModelProperty(example = "Address Details") + @Schema(example = "Address Details") public String registeredTableName; public Set columnHeaderData; } - @ApiModelProperty(example = "[2014, 3, 4]") + @Schema(example = "[2014, 3, 4]") public LocalDate activationDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; public Set officeOptions; public Set staffOptions; @@ -125,7 +124,7 @@ final class ClientsApiResourceSwagger { public Set datatables; } - @ApiModel(value = "GetClientsResponse") + @Schema(description = "GetClientsResponse") public static final class GetClientsResponse { private GetClientsResponse() {} @@ -138,37 +137,37 @@ final class ClientsApiResourceSwagger { private GetClientStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "clientStatusType.pending") + @Schema(example = "clientStatusType.pending") public String code; - @ApiModelProperty(example = "Pending") - public String value; + @Schema(example = "Pending") + public String description; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public String accountNo; public GetClientStatus status; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "Home Farm Produce") + @Schema(example = "Home Farm Produce") public String fullname; - @ApiModelProperty(example = "Home Farm Produce") + @Schema(example = "Home Farm Produce") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetClientsClientIdResponse") + @Schema(description = "GetClientsClientIdResponse") public static final class GetClientsClientIdResponse { private GetClientsClientIdResponse() {} @@ -177,164 +176,164 @@ final class ClientsApiResourceSwagger { private GetClientsClientIdStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "clientStatusType.active") + @Schema(example = "clientStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; + @Schema(example = "Active") + public String description; } static final class GetClientsTimeline { private GetClientsTimeline() {} - @ApiModelProperty(example = "[2013, 1, 1]") + @Schema(example = "[2013, 1, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; - @ApiModelProperty(example = "[2013, 1, 1]") + @Schema(example = "[2013, 1, 1]") public LocalDate activatedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String activatedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String activatedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String activatedByLastname; } - @ApiModelProperty(example = "27") + @Schema(example = "27") public Integer id; - @ApiModelProperty(example = "000000027") + @Schema(example = "000000027") public Long accountNo; public GetClientsClientIdStatus status; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "[2013, 1, 1]") + @Schema(example = "[2013, 1, 1]") public LocalDate activationDate; - @ApiModelProperty(example = "savings") + @Schema(example = "savings") public String firstname; - @ApiModelProperty(example = "test") + @Schema(example = "test") public String lastname; - @ApiModelProperty(example = "savings test") + @Schema(example = "savings test") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetClientsTimeline timeline; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer savingsProductId; - @ApiModelProperty(example = "account overdraft") + @Schema(example = "account overdraft") public String savingsProductName; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List groups; } - @ApiModel(value = "PostClientsRequest") + @Schema(description = "PostClientsRequest") public static final class PostClientsRequest { private PostClientsRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Client of group") + @Schema(example = "Client of group") public String fullname; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer groupId; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "04 March 2009") + @Schema(example = "04 March 2009") public String activationDate; } - @ApiModel(value = "PostClientsResponse") + @Schema(description = "PostClientsResponse") public static final class PostClientsResponse { private PostClientsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer groupId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } - @ApiModel(value = "PutClientsClientIdRequest") + @Schema(description = "PutClientsClientIdRequest") public static final class PutClientsClientIdRequest { private PutClientsClientIdRequest() {} - @ApiModelProperty(example = "786444UUUYYH7") + @Schema(example = "786444UUUYYH7") public String externalId; } - @ApiModel(value = "PutClientsClientIdResponse") + @Schema(description = "PutClientsClientIdResponse") public static final class PutClientsClientIdResponse { private PutClientsClientIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutClientsClientIdRequest changes; } - @ApiModel(value = "DeleteClientsClientIdRequest") + @Schema(description = "DeleteClientsClientIdRequest") public static final class DeleteClientsClientIdRequest { private DeleteClientsClientIdRequest() {} } - @ApiModel(value = "DeleteClientsClientIdResponse") + @Schema(description = "DeleteClientsClientIdResponse") public static final class DeleteClientsClientIdResponse { private DeleteClientsClientIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer clientId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer resourceId; } - @ApiModel(value = "PostClientsClientIdRequest") + @Schema(description = "PostClientsClientIdRequest") public static final class PostClientsClientIdRequest { private PostClientsClientIdRequest() {} - @ApiModelProperty(example = "We cannot accept transfers of clients having loans with less than 1 repayment left") + @Schema(example = "We cannot accept transfers of clients having loans with less than 1 repayment left") public String note; } - @ApiModel(value = "PostClientsClientIdResponse") + @Schema(description = "PostClientsClientIdResponse") public static final class PostClientsClientIdResponse { private PostClientsClientIdResponse() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } - @ApiModel(value = "GetClientsClientIdAccountsResponse") + @Schema(description = "GetClientsClientIdAccountsResponse") public static final class GetClientsClientIdAccountsResponse { private GetClientsClientIdAccountsResponse() {} @@ -347,27 +346,27 @@ final class ClientsApiResourceSwagger { private GetClientsLoanAccountsStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "loanStatusType.active") + @Schema(example = "loanStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Active") + public String description; + @Schema(example = "false") public Boolean pendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } @@ -375,27 +374,27 @@ final class ClientsApiResourceSwagger { private GetClientsLoanAccountsType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "loanType.individual") + @Schema(example = "loanType.individual") public String code; - @ApiModelProperty(example = "Individual") - public String value; + @Schema(example = "Individual") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "456") + @Schema(example = "456") public Integer externalId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "TestOne") + @Schema(example = "TestOne") public String productName; public GetClientsLoanAccountsStatus status; public GetClientsLoanAccountsType loanType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanCycle; } @@ -407,17 +406,17 @@ final class ClientsApiResourceSwagger { private GetClientsSavingsAccountsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -425,33 +424,33 @@ final class ClientsApiResourceSwagger { private GetClientsSavingsAccountsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer id; - @ApiModelProperty(example = "000000007") + @Schema(example = "000000007") public Long accountNo; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer productId; - @ApiModelProperty(example = "Other product") + @Schema(example = "Other product") public String productName; public GetClientsSavingsAccountsStatus status; public GetClientsSavingsAccountsCurrency currency; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResource.java index b7cd47787..c612dffc2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.collateral.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -62,9 +62,7 @@ import org.springframework.stereotype.Component; @Path("/loans/{loanId}/collaterals") @Component @Scope("singleton") -@Api(tags = { "Loan Collateral" }) -@SwaggerDefinition(tags = { - @Tag(name = "Loan Collateral", description = "In lending agreements, collateral is a borrower's pledge of specific property to a lender, to secure repayment of a loan. The collateral serves as protection for a lender against a borrower's default - that is, any borrower failing to pay the principal and interest under the terms of a loan obligation. If a borrower does default on a loan (due to insolvency or other event), that borrower forfeits (gives up) the property pledged as collateral - and the lender then becomes the owner of the collateral") }) +@Tag(name = "Loan Collateral", description = "In lending agreements, collateral is a borrower's pledge of specific property to a lender, to secure repayment of a loan. The collateral serves as protection for a lender against a borrower's default - that is, any borrower failing to pay the principal and interest under the terms of a loan obligation. If a borrower does default on a loan (due to insolvency or other event), that borrower forfeits (gives up) the property pledged as collateral - and the lender then becomes the owner of the collateral") public class CollateralsApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -96,10 +94,10 @@ public class CollateralsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Collateral Details Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Collateral Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "loans/1/collaterals/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollateralsApiResourceSwagger.GetLoansLoanIdCollateralsTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.GetLoansLoanIdCollateralsTemplateResponse.class))) }) public String newCollateralTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); @@ -115,12 +113,12 @@ public class CollateralsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Loan Collaterals", httpMethod = "GET", notes = "Example Requests:\n" + "\n" + "loans/1/collaterals\n" + "\n" - + "\n" + "loans/1/collaterals?fields=value,description") + @Operation(summary = "List Loan Collaterals", description = "Example Requests:\n" + "\n" + "loans/1/collaterals\n" + "\n" + "\n" + + "loans/1/collaterals?fields=value,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollateralsApiResourceSwagger.GetLoansLoanIdCollateralsResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CollateralsApiResourceSwagger.GetLoansLoanIdCollateralsResponse.class)))) }) public String retrieveCollateralDetails(@Context final UriInfo uriInfo, - @PathParam("loanId") @ApiParam(value = "loanId") final Long loanId) { + @PathParam("loanId") @Parameter(description = "loanId") final Long loanId) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); final List CollateralDatas = this.collateralReadPlatformService.retrieveCollateralsForValidLoan(loanId); @@ -134,13 +132,13 @@ public class CollateralsApiResource { @Path("{collateralId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Collateral", httpMethod = "GET", notes = "Example Requests:\n" + "\n" + "/loans/1/collaterals/1\n" - + "\n" + "\n" + "/loans/1/collaterals/1?fields=value,description") + @Operation(summary = "Retrieve a Collateral", description = "Example Requests:\n" + "\n" + "/loans/1/collaterals/1\n" + "\n" + "\n" + + "/loans/1/collaterals/1?fields=description,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollateralsApiResourceSwagger.GetLoansLoanIdCollateralsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.GetLoansLoanIdCollateralsResponse.class))) }) public String retrieveCollateralDetails(@Context final UriInfo uriInfo, - @PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("collateralId") @ApiParam(value = "collateralId") final Long CollateralId) { + @PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("collateralId") @Parameter(description = "collateralId") final Long CollateralId) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission); CollateralData collateralData = this.collateralReadPlatformService.retrieveCollateral(loanId, CollateralId); @@ -158,13 +156,12 @@ public class CollateralsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Collateral", httpMethod = "POST", notes = "Note: Currently, Collaterals may be added only before a Loan is approved") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CollateralsApiResourceSwagger.PostLoansLoanIdCollateralsRequest.class) }) + @Operation(summary = "Create a Collateral", description = "Note: Currently, Collaterals may be added only before a Loan is approved") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.PostLoansLoanIdCollateralsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollateralsApiResourceSwagger.PostLoansLoanIdCollateralsResponse.class) }) - public String createCollateral(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.PostLoansLoanIdCollateralsResponse.class))) }) + public String createCollateral(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createCollateral(loanId).withJson(apiRequestBodyAsJson).build(); @@ -177,14 +174,13 @@ public class CollateralsApiResource { @Path("{collateralId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Collateral", httpMethod = "PUT") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CollateralsApiResourceSwagger.PutLoansLoandIdCollateralsCollateralIdRequest.class) }) + @Operation(summary = "Update a Collateral") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.PutLoansLoandIdCollateralsCollateralIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollateralsApiResourceSwagger.PutLoansLoanIdCollateralsCollateralIdResponse.class) }) - public String updateCollateral(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("collateralId") @ApiParam(value = "collateralId") final Long collateralId, - @ApiParam(hidden = true) final String jsonRequestBody) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.PutLoansLoanIdCollateralsCollateralIdResponse.class))) }) + public String updateCollateral(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId, + @Parameter(hidden = true) final String jsonRequestBody) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateCollateral(loanId, collateralId).withJson(jsonRequestBody) .build(); @@ -197,11 +193,11 @@ public class CollateralsApiResource { @Path("{collateralId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Remove a Collateral", httpMethod = "DELETE", notes = "Note: A collateral can only be removed from Loans that are not yet approved.") + @Operation(summary = "Remove a Collateral", description = "Note: A collateral can only be removed from Loans that are not yet approved.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollateralsApiResourceSwagger.DeleteLoansLoanIdCollateralsCollateralIdResponse.class) }) - public String deleteCollateral(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("collateralId") @ApiParam(value = "collateralId") final Long collateralId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollateralsApiResourceSwagger.DeleteLoansLoanIdCollateralsCollateralIdResponse.class))) }) + public String deleteCollateral(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteCollateral(loanId, collateralId).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResourceSwagger.java index dc3d679f6..e966aa6ff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.collateral.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class CollateralsApiResourceSwagger { private CollateralsApiResourceSwagger() {} - @ApiModel(value = "GetLoansLoanIdCollateralsResponse") + @Schema(description = "GetLoansLoanIdCollateralsResponse") public static final class GetLoansLoanIdCollateralsResponse { private GetLoansLoanIdCollateralsResponse() {} @@ -38,9 +37,9 @@ final class CollateralsApiResourceSwagger { private GetCollateralTypeResponse() {} - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer id; - @ApiModelProperty(example = "Gold") + @Schema(example = "Gold") public String name; } @@ -48,72 +47,72 @@ final class CollateralsApiResourceSwagger { private GetCollateralCurrencyResponse() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; public GetCollateralTypeResponse type; - @ApiModelProperty(example = "50000") + @Schema(example = "50000") public Long value; - @ApiModelProperty(example = "24 Carat Gold chain weighing 12 grams") + @Schema(example = "24 Carat Gold chain weighing 12 grams") public String description; public GetCollateralCurrencyResponse currency; } - @ApiModel(value = "PostLoansLoanIdCollateralsRequest") + @Schema(description = "PostLoansLoanIdCollateralsRequest") public static final class PostLoansLoanIdCollateralsRequest { private PostLoansLoanIdCollateralsRequest() {} - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer collateralTypeId; } - @ApiModel(value = "PostLoansLoanIdCollateralsResponse") + @Schema(description = "PostLoansLoanIdCollateralsResponse") public static final class PostLoansLoanIdCollateralsResponse { private PostLoansLoanIdCollateralsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer resourceId; } - @ApiModel(value = "PutLoansLoandIdCollateralsCollateralIdRequest") + @Schema(description = "PutLoansLoandIdCollateralsCollateralIdRequest") public static final class PutLoansLoandIdCollateralsCollateralIdRequest { private PutLoansLoandIdCollateralsCollateralIdRequest() {} - @ApiModelProperty(example = "22 Carat Gold chain weighing 12 grams") + @Schema(example = "22 Carat Gold chain weighing 12 grams") public String description; } - @ApiModel(value = "PutLoansLoanIdCollateralsCollateralIdResponse") + @Schema(description = "PutLoansLoanIdCollateralsCollateralIdResponse") public static final class PutLoansLoanIdCollateralsCollateralIdResponse { private PutLoansLoanIdCollateralsCollateralIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer resourceId; public PutLoansLoandIdCollateralsCollateralIdRequest changes; } - @ApiModel(value = "GetLoansLoanIdCollateralsTemplateResponse") + @Schema(description = "GetLoansLoanIdCollateralsTemplateResponse") public static final class GetLoansLoanIdCollateralsTemplateResponse { private GetLoansLoanIdCollateralsTemplateResponse() {} @@ -122,25 +121,25 @@ final class CollateralsApiResourceSwagger { private GetCollateralsTemplateAllowedTypes() {} - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer id; - @ApiModelProperty(example = "Silver") + @Schema(example = "Silver") public String name; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } public Set allowedCollateralTypes; } - @ApiModel(value = "DeleteLoansLoanIdCollateralsCollateralIdResponse") + @Schema(description = "DeleteLoansLoanIdCollateralsCollateralIdResponse") public static final class DeleteLoansLoanIdCollateralsCollateralIdResponse { private DeleteLoansLoanIdCollateralsCollateralIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourceSwagger.java index 07be5c9f5..63fc6b8f5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.collectionsheet.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; /** @@ -29,7 +28,7 @@ final class CollectionSheetApiResourceSwagger { private CollectionSheetApiResourceSwagger() {} - @ApiModel(value = "PostCollectionSheetRequest") + @Schema(description = "PostCollectionSheetRequest") public static final class PostCollectionSheetRequest { private PostCollectionSheetRequest() {} @@ -38,30 +37,30 @@ final class CollectionSheetApiResourceSwagger { private PostCollectionSheetBulkRepaymentTransactions() {} - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer loanId; - @ApiModelProperty(example = "1221.36") + @Schema(example = "1221.36") public Double transactionAmount; - @ApiModelProperty(example = "19") + @Schema(example = "19") public Integer paymentTypeId; - @ApiModelProperty(example = "1245356") + @Schema(example = "1245356") public Long receiptNumber; } - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "04 May 2014") + @Schema(example = "04 May 2014") public String transactionDate; - @ApiModelProperty(example = "04 May 2014") + @Schema(example = "04 May 2014") public String actualDisbursementDate; public List bulkDisbursementTransactions; public PostCollectionSheetBulkRepaymentTransactions bulkRepaymentTransactions; public List bulkSavingsDueTransactions; } - @ApiModel(value = "PostCollectionSheetResponse") + @Schema(description = "PostCollectionSheetResponse") public static final class PostCollectionSheetResponse { private PostCollectionSheetResponse() {} @@ -70,19 +69,19 @@ final class CollectionSheetApiResourceSwagger { private PostCollectionSheetChanges() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "[15]") + @Schema(example = "[15]") public List loanTransactions; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List SavingsTransactions; } - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer groupId; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer resourceId; public PostCollectionSheetChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourse.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourse.java index bbf052fdc..02c3366eb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourse.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/api/CollectionSheetApiResourse.java @@ -19,13 +19,13 @@ package org.apache.fineract.portfolio.collectionsheet.api; import com.google.gson.JsonElement; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -55,7 +55,7 @@ import org.springframework.stereotype.Component; @Path("/collectionsheet") @Component @Scope("singleton") -@Api(value = "Collection Sheet", description = "") + public class CollectionSheetApiResourse { private final CollectionSheetReadPlatformService collectionSheetReadPlatformService; @@ -81,16 +81,15 @@ public class CollectionSheetApiResourse { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Generate Individual Collection Sheet | Save Collection Sheet", httpMethod = "POST", notes = "Generate Individual Collection Sheet:\n\n" + @Operation(summary = "Generate Individual Collection Sheet | Save Collection Sheet", description = "Generate Individual Collection Sheet:\n\n" + "This Api retrieves repayment details of all individual loans under a office as on a specified meeting date.\n\n" + "Save Collection Sheet:\n\n" + "This Api allows the loan officer to perform bulk repayments of individual loans and deposit of mandatory savings on a given meeting date.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CollectionSheetApiResourceSwagger.PostCollectionSheetRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CollectionSheetApiResourceSwagger.PostCollectionSheetRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CollectionSheetApiResourceSwagger.PostCollectionSheetResponse.class) }) - public String generateCollectionSheet(@QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CollectionSheetApiResourceSwagger.PostCollectionSheetResponse.class))) }) + public String generateCollectionSheet(@QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); CommandProcessingResult result = null; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java index 0005dab47..0c0af43ca 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.floatingrates.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -58,9 +58,7 @@ import org.springframework.stereotype.Component; @Path("/floatingrates") @Component @Scope("singleton") -@Api(tags = { "Floating Rates" }) -@SwaggerDefinition(tags = { - @Tag(name = "Floating Rates", description = "It lets you create, list, retrieve and upload the floating rates") }) +@Tag(name = "Floating Rates", description = "It lets you create, list, retrieve and upload the floating rates") public class FloatingRatesApiResource { private static final String RESOURCE_NAME = "FLOATINGRATE"; @@ -90,12 +88,12 @@ public class FloatingRatesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a new Floating Rate", httpMethod = "POST", notes = "Creates a new Floating Rate\n" - + "Mandatory Fields: name\n" + "Optional Fields: isBaseLendingRate, isActive, ratePeriods") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FloatingRatesApiResourceSwagger.PostFloatingRatesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = FloatingRatesApiResourceSwagger.PostFloatingRatesResponse.class) }) - public String createFloatingRate(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a new Floating Rate", description = "Creates a new Floating Rate\n" + "Mandatory Fields: name\n" + + "Optional Fields: isBaseLendingRate, isActive, ratePeriods") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.PostFloatingRatesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.PostFloatingRatesResponse.class))) }) + public String createFloatingRate(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createFloatingRate().withJson(apiRequestBodyAsJson).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); @@ -105,9 +103,9 @@ public class FloatingRatesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Floating Rates", httpMethod = "GET", notes = "Lists Floating Rates") + @Operation(summary = "List Floating Rates", description = "Lists Floating Rates") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FloatingRatesApiResourceSwagger.GetFloatingRatesResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.GetFloatingRatesResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME); final List floatingRates = this.floatingRatesReadPlatformService.retrieveAll(); @@ -119,10 +117,10 @@ public class FloatingRatesApiResource { @Path("{floatingRateId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Floating Rate", httpMethod = "GET", notes = "Retrieves Floating Rate") + @Operation(summary = "Retrieve Floating Rate", description = "Retrieves Floating Rate") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FloatingRatesApiResourceSwagger.GetFloatingRatesFloatingRateIdResponse.class) }) - public String retrieveOne(@PathParam("floatingRateId") @ApiParam(value = "floatingRateId") final Long floatingRateId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.GetFloatingRatesFloatingRateIdResponse.class))) }) + public String retrieveOne(@PathParam("floatingRateId") @Parameter(description = "floatingRateId") final Long floatingRateId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME); final FloatingRateData floatingRates = this.floatingRatesReadPlatformService.retrieveOne(floatingRateId); @@ -134,13 +132,12 @@ public class FloatingRatesApiResource { @Path("{floatingRateId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Floating Rate", httpMethod = "PUT", notes = "Updates new Floating Rate. Rate Periods in the past cannot be modified. All the future rateperiods would be replaced with the new ratePeriods data sent.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FloatingRatesApiResourceSwagger.PutFloatingRatesFloatingRateIdRequest.class) }) + @Operation(summary = "Update Floating Rate", description = "Updates new Floating Rate. Rate Periods in the past cannot be modified. All the future rateperiods would be replaced with the new ratePeriods data sent.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.PutFloatingRatesFloatingRateIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FloatingRatesApiResourceSwagger.PutFloatingRatesFloatingRateIdResponse.class) }) - public String updateFloatingRate(@PathParam("floatingRateId") @ApiParam(value = "floatingRateId") final Long floatingRateId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.PutFloatingRatesFloatingRateIdResponse.class))) }) + public String updateFloatingRate(@PathParam("floatingRateId") @Parameter(description = "floatingRateId") final Long floatingRateId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateFloatingRate(floatingRateId).withJson(apiRequestBodyAsJson) .build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResourceSwagger.java index 9a37e31f3..81d5a88df 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.floatingrates.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class FloatingRatesApiResourceSwagger { private FloatingRatesApiResourceSwagger() {} - @ApiModel(value = "PostFloatingRatesRequest") + @Schema(description = "PostFloatingRatesRequest") public static final class PostFloatingRatesRequest { private PostFloatingRatesRequest() {} @@ -38,58 +37,58 @@ final class FloatingRatesApiResourceSwagger { private PostFloatingRatesRatePeriods() {} - @ApiModelProperty(example = "19 November 2015") + @Schema(example = "19 November 2015") public String fromDate; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Double interestRate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; } - @ApiModelProperty(example = "Floating Rate 1") + @Schema(example = "Floating Rate 1") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isBaseLendingRate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; public Set ratePeriods; } - @ApiModel(value = "PostFloatingRatesResponse") + @Schema(description = "PostFloatingRatesResponse") public static final class PostFloatingRatesResponse { private PostFloatingRatesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetFloatingRatesResponse") + @Schema(description = "GetFloatingRatesResponse") public static final class GetFloatingRatesResponse { private GetFloatingRatesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Floating Rate 1") + @Schema(example = "Floating Rate 1") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isBaseLendingRate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdBy; - @ApiModelProperty(example = "Nov 18, 2015") + @Schema(example = "Nov 18, 2015") public String createdOn; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String modifiedBy; - @ApiModelProperty(example = "Nov 18, 2015") + @Schema(example = "Nov 18, 2015") public String modifiedOn; } - @ApiModel(value = "GetFloatingRatesFloatingRateIdResponse") + @Schema(description = "GetFloatingRatesFloatingRateIdResponse") public static final class GetFloatingRatesFloatingRateIdResponse { private GetFloatingRatesFloatingRateIdResponse() {} @@ -98,60 +97,60 @@ final class FloatingRatesApiResourceSwagger { private GetFloatingRatesRatePeriods() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Dec 15, 2015") + @Schema(example = "Dec 15, 2015") public String fromDate; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Double interestRate; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isDifferentialToBaseLendingRate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdBy; - @ApiModelProperty(example = "Nov 18, 2015") + @Schema(example = "Nov 18, 2015") public String createdOn; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String modifiedBy; - @ApiModelProperty(example = "Nov 18, 2015") + @Schema(example = "Nov 18, 2015") public String modifiedOn; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Floating Rate 1") + @Schema(example = "Floating Rate 1") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isBaseLendingRate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdBy; - @ApiModelProperty(example = "Nov 18, 2015") + @Schema(example = "Nov 18, 2015") public String createdOn; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String modifiedBy; - @ApiModelProperty(example = "Nov 18, 2015") + @Schema(example = "Nov 18, 2015") public String modifiedOn; public Set ratePeriods; } - @ApiModel(value = "PutFloatingRatesFloatingRateIdRequest") + @Schema(description = "PutFloatingRatesFloatingRateIdRequest") public static final class PutFloatingRatesFloatingRateIdRequest { private PutFloatingRatesFloatingRateIdRequest() {} - @ApiModelProperty(example = "Floating Rate 1") + @Schema(example = "Floating Rate 1") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isBaseLendingRate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; public Set ratePeriods; } - @ApiModel(value = "PutFloatingRatesFloatingRateIdResponse") + @Schema(description = "PutFloatingRatesFloatingRateIdResponse") public static final class PutFloatingRatesFloatingRateIdResponse { private PutFloatingRatesFloatingRateIdResponse() {} @@ -163,7 +162,7 @@ final class FloatingRatesApiResourceSwagger { public Set ratePeriods; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutFloatingRatesChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResource.java index b3b4ceb19..b54f14615 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.portfolio.fund.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -57,7 +58,7 @@ import org.springframework.stereotype.Component; @Path("/funds") @Component @Scope("singleton") -@Api(value = "Funds", description = "") + public class FundsApiResource { /** @@ -87,10 +88,9 @@ public class FundsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Funds", httpMethod = "GET", notes = "Returns the list of funds.\n" + "\n" + "Example Requests:\n" + "\n" - + "funds") + @Operation(summary = "Retrieve Funds", description = "Returns the list of funds.\n" + "\n" + "Example Requests:\n" + "\n" + "funds") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FundsApiResourceSwagger.GetFundsResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FundsApiResourceSwagger.GetFundsResponse.class)))) }) public String retrieveFunds(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -104,11 +104,11 @@ public class FundsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Fund", httpMethod = "POST", notes = "Creates a Fund") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FundsApiResourceSwagger.PostFundsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = FundsApiResourceSwagger.PostFundsResponse.class) }) - public String createFund(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a Fund", description = "Creates a Fund") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FundsApiResourceSwagger.PostFundsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FundsApiResourceSwagger.PostFundsResponse.class))) }) + public String createFund(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createFund().withJson(apiRequestBodyAsJson).build(); @@ -121,10 +121,11 @@ public class FundsApiResource { @Path("{fundId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Fund", httpMethod = "GET", notes = "Returns the details of a Fund.\n" + "\n" + "Example Requests:\n" - + "\n" + "funds/1") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = FundsApiResourceSwagger.GetFundsResponse.class) }) - public String retreiveFund(@PathParam("fundId") @ApiParam(value = "fundId") final Long fundId, @Context final UriInfo uriInfo) { + @Operation(summary = "Retrieve a Fund", description = "Returns the details of a Fund.\n" + "\n" + "Example Requests:\n" + "\n" + + "funds/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FundsApiResourceSwagger.GetFundsResponse.class))) }) + public String retreiveFund(@PathParam("fundId") @Parameter(description = "fundId") final Long fundId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -138,12 +139,12 @@ public class FundsApiResource { @Path("{fundId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Fund", httpMethod = "PUT", notes = "Updates the details of a fund.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FundsApiResourceSwagger.PutFundsFundIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = FundsApiResourceSwagger.PutFundsFundIdResponse.class) }) - public String updateFund(@PathParam("fundId") @ApiParam(value = "fundId") final Long fundId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Fund", description = "Updates the details of a fund.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FundsApiResourceSwagger.PutFundsFundIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FundsApiResourceSwagger.PutFundsFundIdResponse.class))) }) + public String updateFund(@PathParam("fundId") @Parameter(description = "fundId") final Long fundId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateFund(fundId).withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResourceSwagger.java index f8dc0e691..2dd3c8b7b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/api/FundsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.fund.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by Chirag Gupta on 12/08/17. @@ -28,50 +27,50 @@ final class FundsApiResourceSwagger { private FundsApiResourceSwagger() {} - @ApiModel(value = "GetFundsResponse") + @Schema(description = "GetFundsResponse") public static final class GetFundsResponse { private GetFundsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "EU Agri Fund") + @Schema(example = "EU Agri Fund") public String name; } - @ApiModel(value = "PostFundsRequest") + @Schema(description = "PostFundsRequest") public static final class PostFundsRequest { private PostFundsRequest() {} - @ApiModelProperty(example = "EU Agri Fund") + @Schema(example = "EU Agri Fund") public String name; } - @ApiModel(value = "PostFundsResponse") + @Schema(description = "PostFundsResponse") public static final class PostFundsResponse { private PostFundsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutFundsFundIdRequest") + @Schema(description = "PutFundsFundIdRequest") public static final class PutFundsFundIdRequest { private PutFundsFundIdRequest() {} - @ApiModelProperty(example = "EU Agri Fund (2010-2020)") + @Schema(example = "EU Agri Fund (2010-2020)") public String name; } - @ApiModel(value = "PutFundsFundIdResponse") + @Schema(description = "PutFundsFundIdResponse") public static final class PutFundsFundIdResponse { private PutFundsFundIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutFundsFundIdRequest changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResource.java index 7e444843c..2456c0489 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResource.java @@ -21,15 +21,14 @@ package org.apache.fineract.portfolio.group.api; import com.google.gson.JsonElement; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -96,9 +95,7 @@ import org.springframework.stereotype.Component; @Path("/centers") @Component @Scope("singleton") -@Api(tags = { "Centers" }) -@SwaggerDefinition(tags = { - @Tag(name = "Centers", description = "Centers along with Groups are used to provided a distinctive banking distribution channel used in microfinance. Its common in areas such as Southern Asia to use Centers and Group as administrative units in grameen style lending. Typically groups will contain one to five people and centers themselves will be made of anywhere between 2-10 groups.") }) +@Tag(name = "Centers", description = "Centers along with Groups are used to provided a distinctive banking distribution channel used in microfinance. Its common in areas such as Southern Asia to use Centers and Group as administrative units in grameen style lending. Typically groups will contain one to five people and centers themselves will be made of anywhere between 2-10 groups.") public class CentersApiResource { private final PlatformSecurityContext context; @@ -150,13 +147,14 @@ public class CentersApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Center Template", httpMethod = "GET", notes = "Retrieves a Center Template\n\n" - + "Example Requests:\n\n" + "\n\n" + "centers/template\n\n" + "\n\n" + "centers/template?officeId=2") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.GetCentersTemplateResponse.class) }) + @Operation(summary = "Retrieve a Center Template", description = "Retrieves a Center Template\n\n" + "Example Requests:\n\n" + "\n\n" + + "centers/template\n\n" + "\n\n" + "centers/template?officeId=2") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.CENTER_RESOURCE_NAME); @@ -179,25 +177,26 @@ public class CentersApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Centers", httpMethod = "GET", notes = "The default implementation supports pagination and sorting with the default pagination size set to 200 records. The parameter limit with value -1 will return all entries.\n\n" + @Operation(summary = "List Centers", description = "The default implementation supports pagination and sorting with the default pagination size set to 200 records. The parameter limit with description -1 will return all entries.\n\n" + "Example Requests:\n\n" + "\n\n" + "centers\n\n" + "\n\n" + "centers?fields=name,officeName,joinedDate\n\n" + "\n\n" + "centers?offset=10&limit=50\n\n" + "\n\n" + "centers?orderBy=name&sortOrder=DESC") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.GetCentersResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @QueryParam("staffId") @ApiParam(value = "staffId") final Long staffId, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("name") @ApiParam(value = "name") final String name, - @QueryParam("underHierarchy") @ApiParam(value = "underHierarchy") final String hierarchy, - @QueryParam("paged") @ApiParam(value = "paged") final Boolean paged, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("meetingDate") @ApiParam(value = "meetingDate") final DateParam meetingDateParam, - @QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat, - @QueryParam("locale") @ApiParam(value = "locale") final String locale) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @QueryParam("staffId") @Parameter(description = "staffId") final Long staffId, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("name") @Parameter(description = "name") final String name, + @QueryParam("underHierarchy") @Parameter(description = "underHierarchy") final String hierarchy, + @QueryParam("paged") @Parameter(description = "paged") final Boolean paged, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("meetingDate") @Parameter(description = "meetingDate") final DateParam meetingDateParam, + @QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat, + @QueryParam("locale") @Parameter(description = "locale") final String locale) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.CENTER_RESOURCE_NAME); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -225,11 +224,13 @@ public class CentersApiResource { @Path("{centerId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Center", httpMethod = "GET", notes = "Retrieves a Center\n\n" + "Example Requests:\n\n" + "\n\n" - + "centers/1\n\n" + "\n\n" + "centers/1?associations=groupMembers") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.GetCentersCenterIdResponse.class) }) - public String retrieveOne(@Context final UriInfo uriInfo, @PathParam("centerId") @ApiParam(value = "centerId") final Long centerId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { + @Operation(summary = "Retrieve a Center", description = "Retrieves a Center\n\n" + "Example Requests:\n\n" + "\n\n" + "centers/1\n\n" + + "\n\n" + "centers/1?associations=groupMembers") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdResponse.class))) }) + public String retrieveOne(@Context final UriInfo uriInfo, + @PathParam("centerId") @Parameter(description = "centerId") final Long centerId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.CENTER_RESOURCE_NAME); final Set associationParameters = ApiParameterHelper.extractAssociationsForResponseIfProvided(uriInfo.getQueryParameters()); @@ -277,13 +278,13 @@ public class CentersApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Center", httpMethod = "POST", notes = "Creates a Center\n\n" + @Operation(summary = "Create a Center", description = "Creates a Center\n\n" + "Mandatory Fields: name, officeId, active, activationDate (if active=true)\n\n" + "Optional Fields: externalId, staffId, groupMembers") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CentersApiResourceSwagger.PostCentersRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.PostCentersResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createCenter() // @@ -298,12 +299,12 @@ public class CentersApiResource { @Path("{centerId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Center", httpMethod = "PUT", notes = "Updates a Center") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CentersApiResourceSwagger.PutCentersCenterIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.PutCentersCenterIdResponse.class) }) - public String update(@PathParam("centerId") @ApiParam(value = "centerId") final Long centerId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Center", description = "Updates a Center") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdResponse.class))) }) + public String update(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateCenter(centerId) // @@ -317,9 +318,10 @@ public class CentersApiResource { @Path("{centerId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Center", httpMethod = "DELETE", notes = "A Center can be deleted if it is in pending state and has no association - groups, loans or savings") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.DeleteCentersCenterIdResponse.class) }) - public String delete(@PathParam("centerId") @ApiParam(value = "centerId") final Long centerId) { + @Operation(summary = "Delete a Center", description = "A Center can be deleted if it is in pending state and has no association - groups, loans or savings") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.DeleteCentersCenterIdResponse.class))) }) + public String delete(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteCenter(centerId) // @@ -332,7 +334,7 @@ public class CentersApiResource { @Path("{centerId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Activate a Center | Generate Collection Sheet | Save Collection Sheet | Close a Center | Associate Groups | Disassociate Groups", httpMethod = "POST", notes = "Activate a Center:\n\n" + @Operation(summary = "Activate a Center | Generate Collection Sheet | Save Collection Sheet | Close a Center | Associate Groups | Disassociate Groups", description = "Activate a Center:\n\n" + "Centers can be created in a Pending state. This API exists to enable center activation. If the center happens to be already active, this API will result in an error.\n\n" + "Close a Center:\n\n" + "Centers can be closed if they don't have any non-closed groups or saving accounts. If the Center has any active groups or savings accounts, this API will result in an error.\n\n" @@ -343,12 +345,12 @@ public class CentersApiResource { + "Save Collection Sheet:\n\n" + "This Api allows the loan officer to perform bulk repayments of JLG loans for a center on a given meeting date.\n\n" + "Showing Request/Response for Close a Center") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = CentersApiResourceSwagger.PostCentersCenterIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.PostCentersCenterIdResponse.class) }) - public String activate(@PathParam("centerId") @ApiParam(value = "centerId") final Long centerId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdResponse.class))) }) + public String activate(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -395,12 +397,12 @@ public class CentersApiResource { @Path("{centerId}/accounts") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Center accounts overview", httpMethod = "GET", notes = "An example of how a savings summary for a Center can be provided. This is requested in a specific use case of the reference application.\n\n" + @Operation(summary = "Retrieve Center accounts overview", description = "An example of how a savings summary for a Center can be provided. This is requested in a specific use case of the reference application.\n\n" + "It is quite reasonable to add resources like this to simplify User Interface development.\n\n" + "\n\n" + "Example Requests:\n\n" + "\n\n" + "centers/9/accounts") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = CentersApiResourceSwagger.GetCentersCenterIdAccountsResponse.class) }) - public String retrieveGroupAccount(@PathParam("centerId") @ApiParam(value = "centerId") final Long centerId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdAccountsResponse.class))) }) + public String retrieveGroupAccount(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.CENTER_RESOURCE_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResourceSwagger.java index c260f649c..b72c92229 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/CentersApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.group.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class CentersApiResourceSwagger { private CentersApiResourceSwagger() {} - @ApiModel(value = "GetCentersTemplateResponse") + @Schema(description = "GetCentersTemplateResponse") public static final class GetCentersTemplateResponse { private GetCentersTemplateResponse() {} @@ -39,11 +38,11 @@ final class CentersApiResourceSwagger { private GetCentersOfficeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; } @@ -51,23 +50,23 @@ final class CentersApiResourceSwagger { private GetCentersStaffOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "D, Mary") + @Schema(example = "D, Mary") public String displayName; } - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "[2013, 4, 18]") + @Schema(example = "[2013, 4, 18]") public LocalDate activationDate; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; public Set officeOptions; public Set staffOptions; } - @ApiModel(value = "GetCentersResponse") + @Schema(description = "GetCentersResponse") public static final class GetCentersResponse { private GetCentersResponse() {} @@ -80,90 +79,90 @@ final class CentersApiResourceSwagger { private GetCentersStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "groupingStatusType.pending") + @Schema(example = "groupingStatusType.pending") public String code; - @ApiModelProperty(example = "Pending") - public String value; + @Schema(example = "Pending") + public String description; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; public GetCentersStatus status; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "Center 1") + @Schema(example = "Center 1") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = ".2.") + @Schema(example = ".2.") public String hierarchy; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetCentersCenterIdResponse") + @Schema(description = "GetCentersCenterIdResponse") public static final class GetCentersCenterIdResponse { private GetCentersCenterIdResponse() {} - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer id; public GetCentersResponse.GetCentersPageItems.GetCentersStatus status; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "First Center (No groups)") + @Schema(example = "First Center (No groups)") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = ".8.") + @Schema(example = ".8.") public String hierarchy; } - @ApiModel(value = "PostCentersRequest") + @Schema(description = "PostCentersRequest") public static final class PostCentersRequest { private PostCentersRequest() {} - @ApiModelProperty(example = "First Center (No groups)") + @Schema(example = "First Center (No groups)") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; } - @ApiModel(value = "PostCentersResponse") + @Schema(description = "PostCentersResponse") public static final class PostCentersResponse { private PostCentersResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer groupId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer resourceId; } - @ApiModel(value = "PutCentersCenterIdRequest") + @Schema(description = "PutCentersCenterIdRequest") public static final class PutCentersCenterIdRequest { private PutCentersCenterIdRequest() {} - @ApiModelProperty(example = "First Center (No groups)") + @Schema(example = "First Center (No groups)") public String name; } - @ApiModel(value = "PutCentersCenterIdResponse") + @Schema(description = "PutCentersCenterIdResponse") public static final class PutCentersCenterIdResponse { private PutCentersCenterIdResponse() {} @@ -172,20 +171,20 @@ final class CentersApiResourceSwagger { private PutCentersChanges() {} - @ApiModelProperty(example = "First Center (No groups) - modified") + @Schema(example = "First Center (No groups) - modified") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer groupId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer resourceId; public PutCentersChanges changes; } - @ApiModel(value = "DeleteCentersCenterIdResponse") + @Schema(description = "DeleteCentersCenterIdResponse") public static final class DeleteCentersCenterIdResponse { private DeleteCentersCenterIdResponse() {} @@ -195,36 +194,36 @@ final class CentersApiResourceSwagger { private DeleteCentersChanges() {} } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public DeleteCentersChanges changes; } - @ApiModel(value = "PostCentersCenterIdRequest") + @Schema(description = "PostCentersCenterIdRequest") public static final class PostCentersCenterIdRequest { private PostCentersCenterIdRequest() {} - @ApiModelProperty(example = "32") + @Schema(example = "32") public Integer closureReasonId; - @ApiModelProperty(example = "05 May 2014") + @Schema(example = "05 May 2014") public String closureDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; } - @ApiModel(value = "PostCentersCenterIdResponse") + @Schema(description = "PostCentersCenterIdResponse") public static final class PostCentersCenterIdResponse { private PostCentersCenterIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetCentersCenterIdAccountsResponse") + @Schema(description = "GetCentersCenterIdAccountsResponse") public static final class GetCentersCenterIdAccountsResponse { private GetCentersCenterIdAccountsResponse() {} @@ -237,29 +236,29 @@ final class CentersApiResourceSwagger { private GetCentersCenterIdStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean prematureClosed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean transferInProgress; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean transferOnHold; } @@ -267,19 +266,19 @@ final class CentersApiResourceSwagger { private GetCentersCenterIdCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -287,25 +286,25 @@ final class CentersApiResourceSwagger { private GetCentersAccountType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.group") + @Schema(example = "accountType.group") public String code; - @ApiModelProperty(example = "Group") - public String value; + @Schema(example = "Group") + public String description; } static final class GetCentersTimeline { private GetCentersTimeline() {} - @ApiModelProperty(example = "[2014, 5, 1]") + @Schema(example = "[2014, 5, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; } @@ -313,21 +312,21 @@ final class CentersApiResourceSwagger { private GetCentersDepositType() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "depositAccountType.savingsDeposit") + @Schema(example = "depositAccountType.savingsDeposit") public String code; - @ApiModelProperty(example = "Savings") - public String value; + @Schema(example = "Savings") + public String description; } - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "000000016") + @Schema(example = "000000016") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "Voluntary savings") + @Schema(example = "Voluntary savings") public String productName; public GetCentersCenterIdStatus status; public GetCentersCenterIdCurrency currency; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResource.java index f54a2cc04..3ac463f52 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResource.java @@ -21,15 +21,14 @@ package org.apache.fineract.portfolio.group.api; import com.google.gson.JsonElement; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -104,11 +103,9 @@ import org.springframework.util.CollectionUtils; @Path("/groups") @Component @Scope("singleton") -@Api(tags = { "Groups" }) -@SwaggerDefinition(tags = { - @Tag(name = "Groups", description = "Groups are used to provide a distinctive banking distribution channel used in microfinances throughout the world. The Group is an administrative unit. It can contain as few as 5 people or as many as 40 depending on how its used.\n" - + "\n" - + "Different styles of group lending - Joint-Liability Group, Grameen Model (Center-Group), Self-Help Groups, Village/Communal Banks)") }) +@Tag(name = "Groups", description = "Groups are used to provide a distinctive banking distribution channel used in microfinances throughout the world. The Group is an administrative unit. It can contain as few as 5 people or as many as 40 depending on how its used.\n" + + "\n" + + "Different styles of group lending - Joint-Liability Group, Grameen Model (Center-Group), Self-Help Groups, Village/Communal Banks)") public class GroupsApiResource { private final PlatformSecurityContext context; @@ -182,17 +179,18 @@ public class GroupsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Group Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n" + @Operation(summary = "Retrieve Group Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n" + "\n\n" + "Field Defaults\n\n" + "Allowed Value Lists\n\n" + "Example Requests:\n\n" + "\n\n" + "groups/template\n\n" + "\n\n" + "groups/template?officeId=2\n\n" + "\n\n" + "groups/template?centerId=1\n\n" + "\n\n" + "groups/template?centerId=1&staffInSelectedOfficeOnly=true") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.GetGroupsTemplateResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.GetGroupsTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @QueryParam("center") @ApiParam(value = "center") final boolean isCenterGroup, - @QueryParam("centerId") @ApiParam(value = "centerId") final Long centerId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @QueryParam("center") @Parameter(description = "center") final boolean isCenterGroup, + @QueryParam("centerId") @Parameter(description = "centerId") final Long centerId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.GROUP_RESOURCE_NAME); @@ -225,23 +223,24 @@ public class GroupsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Groups", httpMethod = "GET", notes = "The default implementation of listing Groups returns 200 entries with support for pagination and sorting. Using the parameter limit with value -1 returns all entries.\n\n" + @Operation(summary = "List Groups", description = "The default implementation of listing Groups returns 200 entries with support for pagination and sorting. Using the parameter limit with description -1 returns all entries.\n\n" + "Example Requests:\n\n" + "\n\n" + "groups\n\n" + "\n\n" + "groups?fields=name,officeName,joinedDate\n\n" + "\n\n" + "groups?offset=10&limit=50\n\n" + "\n\n" + "groups?orderBy=name&sortOrder=DESC") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.GetGroupsResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.GetGroupsResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("officeId") @ApiParam(value = "officeId") final Long officeId, - @QueryParam("staffId") @ApiParam(value = "staffId") final Long staffId, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, - @QueryParam("name") @ApiParam(value = "name") final String name, - @QueryParam("underHierarchy") @ApiParam(value = "underHierarchy") final String hierarchy, - @QueryParam("paged") @ApiParam(value = "paged") final Boolean paged, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("orphansOnly") @ApiParam(value = "orphansOnly") final Boolean orphansOnly) { + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, + @QueryParam("staffId") @Parameter(description = "staffId") final Long staffId, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, + @QueryParam("name") @Parameter(description = "name") final String name, + @QueryParam("underHierarchy") @Parameter(description = "underHierarchy") final String hierarchy, + @QueryParam("paged") @Parameter(description = "paged") final Boolean paged, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("orphansOnly") @Parameter(description = "orphansOnly") final Boolean orphansOnly) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.GROUP_RESOURCE_NAME); final PaginationParameters parameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder); @@ -262,12 +261,13 @@ public class GroupsApiResource { @Path("{groupId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Group", httpMethod = "GET", notes = "Retrieve group information.\n\n" + "Example Requests:\n\n" - + "\n\n" + "groups/1\n\n" + "\n\n" + "groups/1?associations=clientMembers") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.GetGroupsGroupIdResponse.class) }) - public String retrieveOne(@Context final UriInfo uriInfo, @PathParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, - @QueryParam("roleId") @ApiParam(value = "roleId") final Long roleId) { + @Operation(summary = "Retrieve a Group", description = "Retrieve group information.\n\n" + "Example Requests:\n\n" + "\n\n" + + "groups/1\n\n" + "\n\n" + "groups/1?associations=clientMembers") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.GetGroupsGroupIdResponse.class))) }) + public String retrieveOne(@Context final UriInfo uriInfo, @PathParam("groupId") @Parameter(description = "groupId") final Long groupId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @QueryParam("roleId") @Parameter(description = "roleId") final Long roleId) { this.context.authenticatedUser().validateHasReadPermission(GroupingTypesApiConstants.GROUP_RESOURCE_NAME); final Set associationParameters = ApiParameterHelper.extractAssociationsForResponseIfProvided(uriInfo.getQueryParameters()); @@ -362,13 +362,13 @@ public class GroupsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Group", httpMethod = "POST", notes = "Creates a Group\n\n" + @Operation(summary = "Create a Group", description = "Creates a Group\n\n" + "Mandatory Fields: name, officeId, active, activationDate (if active=true)\n\n" + "Optional Fields: externalId, staffId, clientMembers") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = GroupsApiResourceSwagger.PostGroupsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.PostGroupsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createGroup() // @@ -382,14 +382,12 @@ public class GroupsApiResource { @Path("{groupId}/command/unassign_staff") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Unassign a Staff", httpMethod = "POST", notes = "Allows you to unassign the Staff.\n\n" - + "Mandatory Fields: staffId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = GroupsApiResourceSwagger.PostGroupsGroupIdCommandUnassignStaffRequest.class) }) + @Operation(summary = "Unassign a Staff", description = "Allows you to unassign the Staff.\n\n" + "Mandatory Fields: staffId") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdCommandUnassignStaffRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.PostGroupsGroupIdCommandUnassignStaffResponse.class) }) - public String unassignLoanOfficer(@PathParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdCommandUnassignStaffResponse.class))) }) + public String unassignLoanOfficer(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .unassignGroupStaff(groupId) // @@ -404,12 +402,12 @@ public class GroupsApiResource { @Path("{groupId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Group", httpMethod = "PUT", notes = "Updates a Group") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = GroupsApiResourceSwagger.PutGroupsGroupIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.PutGroupsGroupIdResponse.class) }) - public String update(@PathParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Group", description = "Updates a Group") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PutGroupsGroupIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PutGroupsGroupIdResponse.class))) }) + public String update(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateGroup(groupId) // @@ -423,9 +421,10 @@ public class GroupsApiResource { @Path("{groupId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Group", httpMethod = "DELETE", notes = "A group can be deleted if it is in pending state and has no associations - clients, loans or savings") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.DeleteGroupsGroupIdResponse.class) }) - public String delete(@PathParam("groupId") @ApiParam(value = "groupId") final Long groupId) { + @Operation(summary = "Delete a Group", description = "A group can be deleted if it is in pending state and has no associations - clients, loans or savings") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.DeleteGroupsGroupIdResponse.class))) }) + public String delete(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteGroup(groupId) // @@ -438,7 +437,7 @@ public class GroupsApiResource { @Path("{groupId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Activate a Group | Associate Clients | Disassociate Clients | Transfer Clients across groups | Generate Collection Sheet | Save Collection Sheet | Unassign a Staff | Assign a Staff | Close a Group | Unassign a Role | Update a Role", httpMethod = "POST", notes = "Activate a Group:\n\n" + @Operation(summary = "Activate a Group | Associate Clients | Disassociate Clients | Transfer Clients across groups | Generate Collection Sheet | Save Collection Sheet | Unassign a Staff | Assign a Staff | Close a Group | Unassign a Role | Update a Role", description = "Activate a Group:\n\n" + "Groups can be created in a Pending state. This API exists to enable group activation.\n\n" + "\n\n" + "If the group happens to be already active this API will result in an error.\n\n" + "Mandatory Fields: activationDate\n\n" + "Associate Clients:\n\n" + "This API allows to associate existing clients to a group.\n\n" + "\n\n" @@ -469,13 +468,13 @@ public class GroupsApiResource { + "Allows you to unassign Roles associated tp Group members.\n\n" + "Update a Role:\n\n" + "Allows you to update the member Role.\n\n" + "Mandatory Fields: role\n\n" + "Showing request/response for Transfer Clients across groups") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = GroupsApiResourceSwagger.PostGroupsGroupIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.PostGroupsGroupIdResponse.class) }) - public String activateOrGenerateCollectionSheet(@PathParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @QueryParam("roleId") @ApiParam(value = "roleId") final Long roleId, @ApiParam(hidden = true) final String apiRequestBodyAsJson, - @Context final UriInfo uriInfo) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdResponse.class))) }) + public String activateOrGenerateCollectionSheet(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @QueryParam("roleId") @Parameter(description = "roleId") final Long roleId, + @Parameter(hidden = true) final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); CommandProcessingResult result = null; @@ -545,11 +544,13 @@ public class GroupsApiResource { @Path("{groupId}/accounts") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Group accounts overview", httpMethod = "GET", notes = "Retrieves details of all Loan and Savings accounts associated with this group.\n\n" + @Operation(summary = "Retrieve Group accounts overview", description = "Retrieves details of all Loan and Savings accounts associated with this group.\n\n" + "\n\n" + "Example Requests:\n\n" + "\n\n" + "groups/1/accounts\n\n" + "\n\n" + "\n\n" + "groups/1/accounts?fields=loanAccounts,savingsAccounts,memberLoanAccounts,\n\n" + "memberSavingsAccounts") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = GroupsApiResourceSwagger.GetGroupsGroupIdAccountsResponse.class) }) - public String retrieveAccounts(@PathParam("groupId") @ApiParam(value = "groupId") final Long groupId, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.GetGroupsGroupIdAccountsResponse.class))) }) + public String retrieveAccounts(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission("GROUP"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResourceSwagger.java index 670da0940..03a5e32c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.group.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class GroupsApiResourceSwagger { private GroupsApiResourceSwagger() {} - @ApiModel(value = "GetGroupsTemplateResponse") + @Schema(description = "GetGroupsTemplateResponse") public static final class GetGroupsTemplateResponse { private GetGroupsTemplateResponse() {} @@ -39,11 +38,11 @@ final class GroupsApiResourceSwagger { private GetGroupsTemplateOfficeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String name; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String nameDecorated; } @@ -51,9 +50,9 @@ final class GroupsApiResourceSwagger { private GetGroupsTemplateStaffOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "C, Mike") + @Schema(example = "C, Mike") public String displayName; } @@ -61,13 +60,13 @@ final class GroupsApiResourceSwagger { private GetGroupsTemplateClientOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Petra Yton") + @Schema(example = "Petra Yton") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } @@ -84,29 +83,29 @@ final class GroupsApiResourceSwagger { private GetGroupsTemplateColumnValues() {} } - @ApiModelProperty(example = "group_id") + @Schema(example = "group_id") public String columnName; - @ApiModelProperty(example = "bigint") + @Schema(example = "bigint") public String columnType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer columnLength; - @ApiModelProperty(example = "INTEGER") + @Schema(example = "INTEGER") public String columnDisplayType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isColumnNullable; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isColumnPrimaryKey; public Set columnValues; } - @ApiModelProperty(example = "m_group") + @Schema(example = "m_group") public String applicationTableName; - @ApiModelProperty(example = "Group Activation Data") + @Schema(example = "Group Activation Data") public String registeredTableName; public Set columnHeaderData; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; public Set officeOptions; public Set staffOptions; @@ -114,7 +113,7 @@ final class GroupsApiResourceSwagger { public Set datatables; } - @ApiModel(value = "GetGroupsResponse") + @Schema(description = "GetGroupsResponse") public static final class GetGroupsResponse { private GetGroupsResponse() {} @@ -127,35 +126,35 @@ final class GroupsApiResourceSwagger { private GetGroupsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "clientStatusType.pending") + @Schema(example = "clientStatusType.pending") public String code; - @ApiModelProperty(example = "Pending") - public String value; + @Schema(example = "Pending") + public String description; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "AnotherGroup") + @Schema(example = "AnotherGroup") public String name; public GetGroupsStatus status; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = ".4.") + @Schema(example = ".4.") public String hierarchy; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetGroupsGroupIdResponse") + @Schema(description = "GetGroupsGroupIdResponse") public static final class GetGroupsGroupIdResponse { private GetGroupsGroupIdResponse() {} @@ -164,80 +163,80 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdTimeline() {} - @ApiModelProperty(example = "[2013, 11, 14]") + @Schema(example = "[2013, 11, 14]") public LocalDate activatedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String activatedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String activatedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String activatedByLastname; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "First Group") + @Schema(example = "First Group") public String name; - @ApiModelProperty(example = "000-1A") + @Schema(example = "000-1A") public String externalId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = ".1.") + @Schema(example = ".1.") public String hierarchy; public GetGroupsGroupIdTimeline timeline; } - @ApiModel(value = "PostGroupsRequest") + @Schema(description = "PostGroupsRequest") public static final class PostGroupsRequest { private PostGroupsRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Pending Group") + @Schema(example = "Pending Group") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; } - @ApiModel(value = "PostGroupsResponse") + @Schema(description = "PostGroupsResponse") public static final class PostGroupsResponse { private PostGroupsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer groupId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } - @ApiModel(value = "DeleteGroupsGroupIdResponse") + @Schema(description = "DeleteGroupsGroupIdResponse") public static final class DeleteGroupsGroupIdResponse { private DeleteGroupsGroupIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer groupId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } - @ApiModel(value = "PostGroupsGroupIdCommandUnassignStaffRequest") + @Schema(description = "PostGroupsGroupIdCommandUnassignStaffRequest") public static final class PostGroupsGroupIdCommandUnassignStaffRequest { private PostGroupsGroupIdCommandUnassignStaffRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer staffId; } - @ApiModel(value = "PostGroupsGroupIdCommandUnassignStaffResponse") + @Schema(description = "PostGroupsGroupIdCommandUnassignStaffResponse") public static final class PostGroupsGroupIdCommandUnassignStaffResponse { private PostGroupsGroupIdCommandUnassignStaffResponse() {} @@ -247,25 +246,25 @@ final class GroupsApiResourceSwagger { private PostGroupsGroupIdCommandUnassignStaffChanges() {} } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer groupId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PostGroupsGroupIdCommandUnassignStaffChanges changes; } - @ApiModel(value = "PutGroupsGroupIdRequest") + @Schema(description = "PutGroupsGroupIdRequest") public static final class PutGroupsGroupIdRequest { private PutGroupsGroupIdRequest() {} - @ApiModelProperty(example = "First Group (changed)") + @Schema(example = "First Group (changed)") public String name; } - @ApiModel(value = "PutGroupsGroupIdResponse") + @Schema(description = "PutGroupsGroupIdResponse") public static final class PutGroupsGroupIdResponse { private PutGroupsGroupIdResponse() {} @@ -274,20 +273,20 @@ final class GroupsApiResourceSwagger { private PutGroupsGroupIdChanges() {} - @ApiModelProperty(example = "First Group (changed)") + @Schema(example = "First Group (changed)") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer groupId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutGroupsGroupIdChanges changes; } - @ApiModel(value = "GetGroupsGroupIdAccountsResponse") + @Schema(description = "GetGroupsGroupIdAccountsResponse") public static final class GetGroupsGroupIdAccountsResponse { private GetGroupsGroupIdAccountsResponse() {} @@ -300,27 +299,27 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "loanStatusType.submitted.and.pending.approval") + @Schema(example = "loanStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean pendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } @@ -328,21 +327,21 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsLoanType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.group") + @Schema(example = "accountType.group") public String code; - @ApiModelProperty(example = "Group") - public String value; + @Schema(example = "Group") + public String description; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "000000003") + @Schema(example = "000000003") public Long accountNo; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer productId; - @ApiModelProperty(example = "daily product") + @Schema(example = "daily product") public String productName; public GetGroupsGroupIdAccountsStatus status; public GetGroupsGroupIdAccountsLoanType loanType; @@ -356,23 +355,23 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsSavingStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } @@ -380,17 +379,17 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsSavingCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -398,21 +397,21 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsSavingAccountType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.group") + @Schema(example = "accountType.group") public String code; - @ApiModelProperty(example = "Group") - public String value; + @Schema(example = "Group") + public String description; } - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer id; - @ApiModelProperty(example = "000000009") + @Schema(example = "000000009") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "p_sav") + @Schema(example = "p_sav") public String productName; public GetGroupsGroupIdAccountsSavingStatus status; public GetGroupsGroupIdAccountsSavingCurrency currency; @@ -427,27 +426,27 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsMemberLoanStatus() {} - @ApiModelProperty(example = "200") + @Schema(example = "200") public Integer id; - @ApiModelProperty(example = "loanStatusType.approved") + @Schema(example = "loanStatusType.approved") public String code; - @ApiModelProperty(example = "Approved") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Approved") + public String description; + @Schema(example = "false") public Boolean pendingApproval; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } @@ -455,21 +454,21 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsMemberLoanType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "accountType.jlg") + @Schema(example = "accountType.jlg") public String code; - @ApiModelProperty(example = "JLG") - public String value; + @Schema(example = "JLG") + public String description; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "000000004") + @Schema(example = "000000004") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "testLoan") + @Schema(example = "testLoan") public String productName; public GetGroupsGroupIdAccountsMemberLoanStatus status; public GetGroupsGroupIdAccountsMemberLoanType loanType; @@ -479,13 +478,13 @@ final class GroupsApiResourceSwagger { private GetGroupsGroupIdAccountsMemberSavingsAccounts() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "000000003") + @Schema(example = "000000003") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "p_sav") + @Schema(example = "p_sav") public String productName; public GetGroupsGroupIdAccountsSavingAccounts.GetGroupsGroupIdAccountsSavingStatus status; public GetGroupsGroupIdAccountsSavingAccounts.GetGroupsGroupIdAccountsSavingCurrency currency; @@ -498,7 +497,7 @@ final class GroupsApiResourceSwagger { public Set memberSavingsAccounts; } - @ApiModel(value = "PostGroupsGroupIdRequest") + @Schema(description = "PostGroupsGroupIdRequest") public static final class PostGroupsGroupIdRequest { private PostGroupsGroupIdRequest() {} @@ -507,21 +506,21 @@ final class GroupsApiResourceSwagger { private PostGroupsGroupIdClients() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer destinationGroupId; public Set clients; } - @ApiModel(value = "PostGroupsGroupIdResponse") + @Schema(description = "PostGroupsGroupIdResponse") public static final class PostGroupsGroupIdResponse { private PostGroupsGroupIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResource.java index 3c545d961..ea1e0bd60 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResource.java @@ -29,15 +29,15 @@ import static org.apache.fineract.portfolio.interestratechart.InterestRateChartS import static org.apache.fineract.portfolio.interestratechart.InterestRateChartSlabApiConstants.periodTypeParamName; import static org.apache.fineract.portfolio.interestratechart.InterestRateChartSlabApiConstants.toPeriodParamName; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -71,9 +71,7 @@ import org.springframework.stereotype.Component; @Path("/interestratecharts/{chartId}/chartslabs") @Component @Scope("singleton") -@Api(tags = { "Interest Rate Slab (A.K.A interest bands)" }) -@SwaggerDefinition(tags = { - @Tag(name = "Interest Rate Slab (A.K.A interest bands)", description = "The slabs a.k.a interest bands are associated with Interest Rate Chart. These bands allow to define different interest rates for different deposit term periods.") }) +@Tag(name = "Interest Rate Slab (A.K.A interest bands)", description = "The slabs a.k.a interest bands are associated with Interest Rate Chart. These bands allow to define different interest rates for different deposit term periods.") public class InterestRateChartSlabsApiResource { private final InterestRateChartSlabReadPlatformService interestRateChartSlabReadPlatformService; @@ -112,11 +110,12 @@ public class InterestRateChartSlabsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve all Slabs", httpMethod = "GET", notes = "Retrieve list of slabs associated with a chart\n" + "\n" + @Operation(summary = "Retrieve all Slabs", description = "Retrieve list of slabs associated with a chart\n" + "\n" + "Example Requests:\n" + "\n" + "interestratecharts/1/chartslabs") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartSlabsApiResourceSwagger.GetInterestRateChartsChartIdChartSlabsResponse.class, responseContainer = "List") }) - public String retrieveAll(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.GetInterestRateChartsChartIdChartSlabsResponse.class)))) }) + public String retrieveAll(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(INTERESTRATE_CHART_SLAB_RESOURCE_NAME); Collection chartSlabs = this.interestRateChartSlabReadPlatformService.retrieveAll(chartId); @@ -129,12 +128,12 @@ public class InterestRateChartSlabsApiResource { @Path("{chartSlabId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Slab", httpMethod = "GET", notes = "Retrieve a slab associated with an Interest rate chart\n" + "\n" + @Operation(summary = "Retrieve a Slab", description = "Retrieve a slab associated with an Interest rate chart\n" + "\n" + "Example Requests:\n" + "\n" + "interestratecharts/1/chartslabs/1\n") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartSlabsApiResourceSwagger.GetInterestRateChartsChartIdChartSlabsResponse.class) }) - public String retrieveOne(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, - @PathParam("chartSlabId") @ApiParam(value = "chartSlabId") final Long chartSlabId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.GetInterestRateChartsChartIdChartSlabsResponse.class))) }) + public String retrieveOne(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @PathParam("chartSlabId") @Parameter(description = "chartSlabId") final Long chartSlabId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(INTERESTRATE_CHART_SLAB_RESOURCE_NAME); @@ -150,15 +149,14 @@ public class InterestRateChartSlabsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Slab", httpMethod = "POST", notes = "Creates a new interest rate slab for an interest rate chart.\n" + @Operation(summary = "Create a Slab", description = "Creates a new interest rate slab for an interest rate chart.\n" + "Mandatory Fields\n" + "periodType, fromPeriod, annualInterestRate\n" + "Optional Fields\n" + "toPeriod and description\n" + "Example Requests:\n" + "\n" + "interestratecharts/1/chartslabs") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InterestRateChartSlabsApiResourceSwagger.PostInterestRateChartsChartIdChartSlabsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.PostInterestRateChartsChartIdChartSlabsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartSlabsApiResourceSwagger.PostInterestRateChartsChartIdChartSlabsResponse.class) }) - public String create(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.PostInterestRateChartsChartIdChartSlabsResponse.class))) }) + public String create(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createInterestRateChartSlab(chartId) .withJson(apiRequestBodyAsJson).build(); @@ -172,14 +170,13 @@ public class InterestRateChartSlabsApiResource { @Path("{chartSlabId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Slab", httpMethod = "PUT", notes = "It updates the Slab from chart") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InterestRateChartSlabsApiResourceSwagger.PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest.class) }) + @Operation(summary = "Update a Slab", description = "It updates the Slab from chart") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartSlabsApiResourceSwagger.PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse.class) }) - public String update(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, - @PathParam("chartSlabId") @ApiParam(value = "chartSlabId") final Long chartSlabId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse.class))) }) + public String update(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @PathParam("chartSlabId") @Parameter(description = "chartSlabId") final Long chartSlabId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateInterestRateChartSlab(chartId, chartSlabId) .withJson(apiRequestBodyAsJson).build(); @@ -193,11 +190,11 @@ public class InterestRateChartSlabsApiResource { @Path("{chartSlabId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Slab", httpMethod = "DELETE", notes = "Delete a Slab from a chart") + @Operation(summary = "Delete a Slab", description = "Delete a Slab from a chart") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartSlabsApiResourceSwagger.DeleteInterestRateChartsChartIdChartSlabsResponse.class) }) - public String delete(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, - @PathParam("chartSlabId") @ApiParam(value = "chartSlabId") final Long chartSlabId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsApiResourceSwagger.DeleteInterestRateChartsChartIdChartSlabsResponse.class))) }) + public String delete(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @PathParam("chartSlabId") @Parameter(description = "chartSlabId") final Long chartSlabId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteInterestRateChartSlab(chartId, chartSlabId).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.toApiJsonSerializer.serialize(result); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResourceSwagger.java index 1223b6701..2cbe318f2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartSlabsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.interestratechart.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class InterestRateChartSlabsApiResourceSwagger { private InterestRateChartSlabsApiResourceSwagger() {} - @ApiModel(value = "GetInterestRateChartsChartIdChartSlabsResponse") + @Schema(description = "GetInterestRateChartsChartIdChartSlabsResponse") public static final class GetInterestRateChartsChartIdChartSlabsResponse { private GetInterestRateChartsChartIdChartSlabsResponse() {} @@ -42,80 +41,80 @@ final class InterestRateChartSlabsApiResourceSwagger { private GetInterestRateChartsChartIdChartSlabsEntityType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "InterestIncentiveEntityType.customer") + @Schema(example = "InterestIncentiveEntityType.customer") public Integer code; - @ApiModelProperty(example = "Customer") - public Integer value; + @Schema(example = "Customer") + public Integer description; } static final class GetInterestRateChartsChartIdChartSlabsAttributeName { private GetInterestRateChartsChartIdChartSlabsAttributeName() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "InterestIncentiveAttributeName.gender") + @Schema(example = "InterestIncentiveAttributeName.gender") public Integer code; - @ApiModelProperty(example = "Gender") - public Integer value; + @Schema(example = "Gender") + public Integer description; } static final class GetInterestRateChartsChartIdChartSlabsConditionType { private GetInterestRateChartsChartIdChartSlabsConditionType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "incentiveConditionType.equal") + @Schema(example = "incentiveConditionType.equal") public Integer code; - @ApiModelProperty(example = "equal") - public Integer value; + @Schema(example = "equal") + public Integer description; } static final class GetInterestRateChartsChartIdChartSlabsIncentiveType { private GetInterestRateChartsChartIdChartSlabsIncentiveType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "InterestIncentiveType.incentive") + @Schema(example = "InterestIncentiveType.incentive") public Integer code; - @ApiModelProperty(example = "Incentive") - public Integer value; + @Schema(example = "Incentive") + public Integer description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; public GetInterestRateChartsChartIdChartSlabsEntityType entityType; public GetInterestRateChartsChartIdChartSlabsAttributeName attributeName; public GetInterestRateChartsChartIdChartSlabsConditionType conditionType; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer attributeValue; - @ApiModelProperty(example = "FEMALE") + @Schema(example = "FEMALE") public String attributeValueDesc; public GetInterestRateChartsChartIdChartSlabsIncentiveType incentiveType; - @ApiModelProperty(example = "-1.000000") + @Schema(example = "-1.000000") public Float amount; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "5% interest from 1 day till 180 days of deposit") + @Schema(example = "5% interest from 1 day till 180 days of deposit") public String description; public InterestRateChartsApiResourceSwagger.GetInterestRateChartsTemplateResponse.GetInterestRateChartsTemplatePeriodTypes periodTypes; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromPeriod; - @ApiModelProperty(example = "180") + @Schema(example = "180") public Integer toPeriod; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Double annualInterestRate; public InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.GetInterestRateChartsCurrency currency; public Set incentives; } - @ApiModel(value = "PostInterestRateChartsChartIdChartSlabsRequest") + @Schema(description = "PostInterestRateChartsChartIdChartSlabsRequest") public static final class PostInterestRateChartsChartIdChartSlabsRequest { private PostInterestRateChartsChartIdChartSlabsRequest() {} @@ -124,71 +123,71 @@ final class InterestRateChartSlabsApiResourceSwagger { private PostInterestRateChartsChartIdChartSlabsIncentives() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer entityType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer attributeName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer conditionType; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer attributeValue; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer incentiveType; - @ApiModelProperty(example = "-1") + @Schema(example = "-1") public Float amount; } - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer periodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromPeriod; - @ApiModelProperty(example = "180") + @Schema(example = "180") public Integer toPeriod; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Double annualInterestRate; - @ApiModelProperty(example = "5% interest from 1 day till 180 days of deposit") + @Schema(example = "5% interest from 1 day till 180 days of deposit") public String description; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; public Set incentives; } - @ApiModel(value = "PostInterestRateChartsChartIdChartSlabsResponse") + @Schema(description = "PostInterestRateChartsChartIdChartSlabsResponse") public static final class PostInterestRateChartsChartIdChartSlabsResponse { private PostInterestRateChartsChartIdChartSlabsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest") + @Schema(description = "PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest") public static final class PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest { private PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest() {} - @ApiModelProperty(example = "6") + @Schema(example = "6") public Double annualInterestRate; - @ApiModelProperty(example = "Interest rate changed to 6%") + @Schema(example = "Interest rate changed to 6%") public String description; } - @ApiModel(value = "PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse") + @Schema(description = "PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse") public static final class PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse { private PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest changes; } - @ApiModel(value = "DeleteInterestRateChartsChartIdChartSlabsResponse") + @Schema(description = "DeleteInterestRateChartsChartIdChartSlabsResponse") public static final class DeleteInterestRateChartsChartIdChartSlabsResponse { private DeleteInterestRateChartsChartIdChartSlabsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResource.java index 5927459c7..4c4893db1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResource.java @@ -26,15 +26,15 @@ import static org.apache.fineract.portfolio.interestratechart.InterestRateChartA import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.isPrimaryGroupingByAmountParamName; import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.nameParamName; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -70,9 +70,7 @@ import org.springframework.stereotype.Component; @Path("/interestratecharts") @Component @Scope("singleton") -@Api(tags = { "Interest Rate Chart" }) -@SwaggerDefinition(tags = { - @Tag(name = "Interest Rate Chart", description = "This defines an interest rate scheme that can be associated to a term deposit product. This will have a slab (band or range) of deposit periods and the associated interest rates applicable along with incentives for each band.") }) +@Tag(name = "Interest Rate Chart", description = "This defines an interest rate scheme that can be associated to a term deposit product. This will have a slab (band or range) of deposit periods and the associated interest rates applicable along with incentives for each band.") public class InterestRateChartsApiResource { private final InterestRateChartReadPlatformService chartReadPlatformService; @@ -101,10 +99,10 @@ public class InterestRateChartsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Chart Details Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for creating a chart. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Chart Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for creating a chart. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "interestratecharts/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartsApiResourceSwagger.GetInterestRateChartsTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.GetInterestRateChartsTemplateResponse.class))) }) public String template(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(InterestRateChartApiConstants.INTERESTRATE_CHART_RESOURCE_NAME); @@ -117,12 +115,12 @@ public class InterestRateChartsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve all Charts", httpMethod = "GET", notes = "Retrieve list of charts associated with a term deposit product(FD or RD).\n" + @Operation(summary = "Retrieve all Charts", description = "Retrieve list of charts associated with a term deposit product(FD or RD).\n" + "Example Requests:\n" + "\n" + "interestratecharts?productId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId) { + @QueryParam("productId") @Parameter(description = "productId") final Long productId) { this.context.authenticatedUser().validateHasReadPermission(InterestRateChartApiConstants.INTERESTRATE_CHART_RESOURCE_NAME); @@ -136,11 +134,12 @@ public class InterestRateChartsApiResource { @Path("{chartId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Chart", httpMethod = "GET", notes = "It retrieves the Interest Rate Chart\n" + "Example Requests:\n" - + "\n" + "interestratecharts/1") + @Operation(summary = "Retrieve a Chart", description = "It retrieves the Interest Rate Chart\n" + "Example Requests:\n" + "\n" + + "interestratecharts/1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.class) }) - public String retrieveOne(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.class))) }) + public String retrieveOne(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(InterestRateChartApiConstants.INTERESTRATE_CHART_RESOURCE_NAME); @@ -163,12 +162,11 @@ public class InterestRateChartsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Chart", httpMethod = "POST", notes = "Creates a new chart which can be attached to a term deposit products (FD or RD).") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InterestRateChartsApiResourceSwagger.PostInterestRateChartsRequest.class) }) + @Operation(summary = "Create a Chart", description = "Creates a new chart which can be attached to a term deposit products (FD or RD).") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.PostInterestRateChartsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartsApiResourceSwagger.PostInterestRateChartsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.PostInterestRateChartsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createInterestRateChart().withJson(apiRequestBodyAsJson).build(); @@ -181,13 +179,12 @@ public class InterestRateChartsApiResource { @Path("{chartId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Chart", notes = "It updates the Chart.", httpMethod = "PUT") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = InterestRateChartsApiResourceSwagger.PutInterestRateChartsChartIdRequest.class) }) + @Operation(summary = "Update a Chart", description = "It updates the chart") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.PutInterestRateChartsChartIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartsApiResourceSwagger.PutInterestRateChartsChartIdResponse.class) }) - public String update(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.PutInterestRateChartsChartIdResponse.class))) }) + public String update(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateInterestRateChart(chartId).withJson(apiRequestBodyAsJson) .build(); @@ -201,10 +198,10 @@ public class InterestRateChartsApiResource { @Path("{chartId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Chart", notes = "It deletes the chart", httpMethod = "DELETE") + @Operation(summary = "Delete a Chart", description = "It deletes the chart") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = InterestRateChartsApiResourceSwagger.DeleteInterestRateChartsChartIdResponse.class) }) - public String delete(@PathParam("chartId") @ApiParam(value = "chartId") final Long chartId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.DeleteInterestRateChartsChartIdResponse.class))) }) + public String delete(@PathParam("chartId") @Parameter(description = "chartId") final Long chartId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteInterestRateChart(chartId).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.toApiJsonSerializer.serialize(result); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResourceSwagger.java index f5652cca1..b7811aaf6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/api/InterestRateChartsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.interestratechart.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class InterestRateChartsApiResourceSwagger { private InterestRateChartsApiResourceSwagger() {} - @ApiModel(value = "GetInterestRateChartsTemplateResponse") + @Schema(description = "GetInterestRateChartsTemplateResponse") public static final class GetInterestRateChartsTemplateResponse { private GetInterestRateChartsTemplateResponse() {} @@ -39,18 +38,18 @@ final class InterestRateChartsApiResourceSwagger { private GetInterestRateChartsTemplatePeriodTypes() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.days") + @Schema(example = "interestChartPeriodType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } public Set periodTypes; } - @ApiModel(value = "GetInterestRateChartsResponse") + @Schema(description = "GetInterestRateChartsResponse") public static final class GetInterestRateChartsResponse { private GetInterestRateChartsResponse() {} @@ -59,12 +58,12 @@ final class InterestRateChartsApiResourceSwagger { private GetInterestRateChartsChartSlabs() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; public GetInterestRateChartsTemplateResponse.GetInterestRateChartsTemplatePeriodTypes periodTypes; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromPeriod; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer annualInterestRate; public GetInterestRateChartsCurrency currency; } @@ -73,85 +72,85 @@ final class InterestRateChartsApiResourceSwagger { private GetInterestRateChartsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "[2014, 1, 1]") + @Schema(example = "[2014, 1, 1]") public LocalDate fromDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsProductId; - @ApiModelProperty(example = "Fixed Deposit Product 001") + @Schema(example = "Fixed Deposit Product 001") public String savingsProductName; public Set chartSlabs; } - @ApiModel(value = "PostInterestRateChartsRequest") + @Schema(description = "PostInterestRateChartsRequest") public static final class PostInterestRateChartsRequest { private PostInterestRateChartsRequest() {} - @ApiModelProperty(example = "Chart - 2014") + @Schema(example = "Chart - 2014") public String name; - @ApiModelProperty(example = "This chart is applicable for year 2014") + @Schema(example = "This chart is applicable for year 2014") public String description; - @ApiModelProperty(example = "Document") + @Schema(example = "Document") public String type; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 Jan 2014") + @Schema(example = "01 Jan 2014") public String fromDate; } - @ApiModel(value = "PostInterestRateChartsResponse") + @Schema(description = "PostInterestRateChartsResponse") public static final class PostInterestRateChartsResponse { private PostInterestRateChartsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutInterestRateChartsChartIdRequest") + @Schema(description = "PutInterestRateChartsChartIdRequest") public static final class PutInterestRateChartsChartIdRequest { private PutInterestRateChartsChartIdRequest() {} - @ApiModelProperty(example = "Interest rate chart for 2014") + @Schema(example = "Interest rate chart for 2014") public String name; - @ApiModelProperty(example = "Interest rate chart for 2014") + @Schema(example = "Interest rate chart for 2014") public String description; } - @ApiModel(value = "PutInterestRateChartsChartIdResponse") + @Schema(description = "PutInterestRateChartsChartIdResponse") public static final class PutInterestRateChartsChartIdResponse { private PutInterestRateChartsChartIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "DeleteInterestRateChartsChartIdResponse") + @Schema(description = "DeleteInterestRateChartsChartIdResponse") public static final class DeleteInterestRateChartsChartIdResponse { private DeleteInterestRateChartsChartIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResource.java index cb7cecd05..e27f62f13 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -66,11 +66,9 @@ import org.springframework.stereotype.Component; @Path("/loans/{loanId}/charges") @Component @Scope("singleton") -@Api(tags = { "Loan Charges" }) -@SwaggerDefinition(tags = { - @Tag(name = "Loan Charges", description = "Its typical for MFIs to add extra costs for their loan products. They can be either Fees or Penalties.\n" - + "\n" - + "Loan Charges are instances of Charges and represent either fees and penalties for loan products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Loan) are described here") }) +@Tag(name = "Loan Charges", description = "Its typical for MFIs to add extra costs for their loan products. They can be either Fees or Penalties.\n" + + "\n" + + "Loan Charges are instances of Charges and represent either fees and penalties for loan products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Loan) are described here") public class LoanChargesApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -107,11 +105,11 @@ public class LoanChargesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Loan Charges", httpMethod = "GET", notes = "It lists all the Loan Charges specific to a Loan \n\n" - + "Example Requests:\n" + "\n" + "loans/1/charges\n" + "\n" + "\n" + "loans/1/charges?fields=name,amountOrPercentage") + @Operation(summary = "List Loan Charges", description = "It lists all the Loan Charges specific to a Loan \n\n" + "Example Requests:\n" + + "\n" + "loans/1/charges\n" + "\n" + "\n" + "loans/1/charges?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class) }) - public String retrieveAllLoanCharges(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class)))) }) + public String retrieveAllLoanCharges(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -126,11 +124,12 @@ public class LoanChargesApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Loan Charges Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "loans/1/charges/template\n" + "\n") + @Operation(summary = "Retrieve Loan Charges Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "loans/1/charges/template\n" + "\n") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesTemplateResponse.class) }) - public String retrieveTemplate(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesTemplateResponse.class))) }) + public String retrieveTemplate(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -146,12 +145,12 @@ public class LoanChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Loan Charge", httpMethod = "GET", notes = "Retrieves Loan Charge according to the Loan ID and Charge ID" + @Operation(summary = "Retrieve a Loan Charge", description = "Retrieves Loan Charge according to the Loan ID and Charge ID" + "Example Requests:\n" + "\n" + "/loans/1/charges/1\n" + "\n" + "\n" + "/loans/1/charges/1?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class) }) - public String retrieveLoanCharge(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long loanChargeId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class))) }) + public String retrieveLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long loanChargeId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -169,14 +168,13 @@ public class LoanChargesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Loan Charge", httpMethod = "POST", notes = "It Creates a Loan Charge") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesRequest.class) }) + @Operation(summary = "Create a Loan Charge", description = "It Creates a Loan Charge") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesResponse.class) }) - public String executeLoanCharge(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesResponse.class))) }) + public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandProcessingResult result = null; if (is(commandParam, "pay")) { @@ -196,14 +194,13 @@ public class LoanChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Loan Charge", httpMethod = "PUT", notes = "Currently Loan Charges may be updated only if the Loan is not yet approved") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdRequest.class) }) + @Operation(summary = "Update a Loan Charge", description = "Currently Loan Charges may be updated only if the Loan is not yet approved") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdResponse.class) }) - public String updateLoanCharge(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long loanChargeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdResponse.class))) }) + public String updateLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long loanChargeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateLoanCharge(loanId, loanChargeId) .withJson(apiRequestBodyAsJson).build(); @@ -217,15 +214,14 @@ public class LoanChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Pay Loan Charge", httpMethod = "POST", notes = "Loan Charge will be paid if the loan is linked with a savings account") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdRequest.class) }) + @Operation(summary = "Pay Loan Charge", description = "Loan Charge will be paid if the loan is linked with a savings account") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdResponse.class) }) - public String executeLoanCharge(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long loanChargeId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdResponse.class))) }) + public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long loanChargeId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); CommandProcessingResult result = null; @@ -248,11 +244,11 @@ public class LoanChargesApiResource { @Path("{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Loan Charge", httpMethod = "DELETE", notes = "Note: Currently, A Loan Charge may only be removed from Loans that are not yet approved.") + @Operation(summary = "Delete a Loan Charge", description = "Note: Currently, A Loan Charge may only be removed from Loans that are not yet approved.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanChargesApiResourceSwagger.DeleteLoansLoanIdChargesChargeIdResponse.class) }) - public String deleteLoanCharge(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long loanChargeId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.DeleteLoansLoanIdChargesChargeIdResponse.class))) }) + public String deleteLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long loanChargeId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteLoanCharge(loanId, loanChargeId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResourceSwagger.java index 8e3b3ef22..c40d27572 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanChargesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class LoanChargesApiResourceSwagger { private LoanChargesApiResourceSwagger() {} - @ApiModel(value = "GetLoansLoanIdChargesChargeIdResponse") + @Schema(description = "GetLoansLoanIdChargesChargeIdResponse") public static final class GetLoansLoanIdChargesChargeIdResponse { private GetLoansLoanIdChargesChargeIdResponse() {} @@ -38,74 +37,74 @@ final class LoanChargesApiResourceSwagger { private GetLoanChargeTimeType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeTimeType.disbursement") + @Schema(example = "chargeTimeType.disbursement") public String code; - @ApiModelProperty(example = "Disbursement") - public String value; + @Schema(example = "Disbursement") + public String description; } static final class GetLoanChargeCalculationType { private GetLoanChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetLoanChargeCurrency { private GetLoanChargeCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeId; - @ApiModelProperty(example = "Loan Processing fee") + @Schema(example = "Loan Processing fee") public String name; public GetLoanChargeTimeType chargeTimeType; public GetLoanChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetLoanChargeCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOutstanding; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOrPercentage; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = "GetLoansLoanIdChargesTemplateResponse") + @Schema(description = "GetLoansLoanIdChargesTemplateResponse") public static final class GetLoansLoanIdChargesTemplateResponse { private GetLoansLoanIdChargesTemplateResponse() {} @@ -118,158 +117,158 @@ final class LoanChargesApiResourceSwagger { private GetLoanChargeTemplateChargeTimeType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetLoanChargeTemplateChargeAppliesTo { private GetLoanChargeTemplateChargeAppliesTo() {} - @ApiModelProperty(example = "1 ") + @Schema(example = "1 ") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.loan") + @Schema(example = "chargeAppliesTo.loan") public String code; - @ApiModelProperty(example = "Loan") - public String value; + @Schema(example = "Loan") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Collection fee") + @Schema(example = "Collection fee") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; public GetLoansLoanIdChargesChargeIdResponse.GetLoanChargeCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; public GetLoanChargeTemplateChargeTimeType chargeTimeType; public GetLoanChargeTemplateChargeAppliesTo chargeAppliesTo; public GetLoansLoanIdChargesChargeIdResponse.GetLoanChargeCalculationType chargeCalculationType; } - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; public Set chargeOptions; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = " PostLoansLoanIdChargesRequest") + @Schema(description = " PostLoansLoanIdChargesRequest") public static final class PostLoansLoanIdChargesRequest { private PostLoansLoanIdChargesRequest() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer chargeId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "29 April 2013") + @Schema(example = "29 April 2013") public String dueDate; } - @ApiModel(value = " PostLoansLoanIdChargesResponse") + @Schema(description = " PostLoansLoanIdChargesResponse") public static final class PostLoansLoanIdChargesResponse { private PostLoansLoanIdChargesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long loanId; - @ApiModelProperty(example = "31") + @Schema(example = "31") public Integer resourceId; } - @ApiModel(value = " PutLoansLoanIdChargesChargeIdRequest") + @Schema(description = " PutLoansLoanIdChargesChargeIdRequest") public static final class PutLoansLoanIdChargesChargeIdRequest { private PutLoansLoanIdChargesChargeIdRequest() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "60") + @Schema(example = "60") public Float amount; - @ApiModelProperty(example = "27 March 2013") + @Schema(example = "27 March 2013") public String dueDate; } - @ApiModel(value = "PutLoansLoanIdChargesChargeIdResponse") + @Schema(description = "PutLoansLoanIdChargesChargeIdResponse") public static final class PutLoansLoanIdChargesChargeIdResponse { private PutLoansLoanIdChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long loanId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer resourceId; public PutLoansLoanIdChargesChargeIdRequest changes; } - @ApiModel(value = "PostLoansLoanIdChargesChargeIdRequest") + @Schema(description = "PostLoansLoanIdChargesChargeIdRequest") public static final class PostLoansLoanIdChargesChargeIdRequest { private PostLoansLoanIdChargesChargeIdRequest() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "19 September 2013") + @Schema(example = "19 September 2013") public String transactionDate; } - @ApiModel(value = "PostLoansLoanIdChargesChargeIdResponse") + @Schema(description = "PostLoansLoanIdChargesChargeIdResponse") public static final class PostLoansLoanIdChargesChargeIdResponse { private PostLoansLoanIdChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long clientId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Long loanId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long savingsId; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer resourceId; } - @ApiModel(value = "DeleteLoansLoanIdChargesChargeIdResponse") + @Schema(description = "DeleteLoansLoanIdChargesChargeIdResponse") public static final class DeleteLoansLoanIdChargesChargeIdResponse { private DeleteLoansLoanIdChargesChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long loanId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java index 425d67ec9..6d793b72a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.HashSet; import javax.ws.rs.Consumes; import javax.ws.rs.POST; @@ -55,9 +54,7 @@ import org.springframework.stereotype.Component; @Path("/loans/{loanId}/schedule") @Component @Scope("singleton") -@Api(tags = { "Loan Rescheduling" }) -@SwaggerDefinition(tags = { - @Tag(name = "Loan Rescheduling", description = "Loan Term Variations provides the ability to change due dates, amounts and number of instalments before loan approval.") }) +@Tag(name = "Loan Rescheduling", description = "Loan Term Variations provides the ability to change due dates, amounts and number of instalments before loan approval.") public class LoanScheduleApiResource { private final String resourceNameForPermissions = "LOAN"; @@ -83,18 +80,17 @@ public class LoanScheduleApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Calculate loan repayment schedule based on Loan term variations | Updates loan repayment schedule based on Loan term variations | Updates loan repayment schedule by removing Loan term variations", httpMethod = "POST", notes = "Calculate loan repayment schedule based on Loan term variations:\n\n" + @Operation(summary = "Calculate loan repayment schedule based on Loan term variations | Updates loan repayment schedule based on Loan term variations | Updates loan repayment schedule by removing Loan term variations", description = "Calculate loan repayment schedule based on Loan term variations:\n\n" + "Mandatory Fields: exceptions,locale,dateFormat\n\n" + "Updates loan repayment schedule based on Loan term variations:\n\n" + "Mandatory Fields: exceptions,locale,dateFormat\n\n" + "Updates loan repayment schedule by removing Loan term variations:\n\n" + "It updates the loan repayment schedule by removing Loan term variations\n\n" + "Showing request/response for 'Updates loan repayment schedule by removing Loan term variations'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanScheduleApiResourceSwagger.PostLoansLoanIdScheduleRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanScheduleApiResourceSwagger.PostLoansLoanIdScheduleRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanScheduleApiResourceSwagger.PostLoansLoanIdScheduleResponse.class) }) - public String calculateLoanScheduleOrSubmitVariableSchedule(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanScheduleApiResourceSwagger.PostLoansLoanIdScheduleResponse.class))) }) + public String calculateLoanScheduleOrSubmitVariableSchedule(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandRequest = null; if (is(commandParam, "calculateLoanSchedule")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResourceSwagger.java index 6528b0bb2..8d6edb9d3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; /** @@ -29,13 +28,13 @@ final class LoanScheduleApiResourceSwagger { private LoanScheduleApiResourceSwagger() {} - @ApiModel(value = "PostLoansLoanIdScheduleRequest") + @Schema(description = "PostLoansLoanIdScheduleRequest") public static final class PostLoansLoanIdScheduleRequest { private PostLoansLoanIdScheduleRequest() {} } - @ApiModel(value = "PostLoansLoanIdScheduleResponse") + @Schema(description = "PostLoansLoanIdScheduleResponse") public static final class PostLoansLoanIdScheduleResponse { private PostLoansLoanIdScheduleResponse() {} @@ -44,11 +43,11 @@ final class LoanScheduleApiResourceSwagger { private PostLoanChanges() {} - @ApiModelProperty(example = "[21, 22]") + @Schema(example = "[21, 22]") public List removedEntityIds; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; public PostLoanChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java index bf23d9c7c..b3951fa7c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -66,9 +65,7 @@ import org.springframework.stereotype.Component; @Path("/loans/{loanId}/transactions") @Component @Scope("singleton") -@Api(tags = { "Loan Transactions" }) -@SwaggerDefinition(tags = { - @Tag(name = "Loan Transactions", description = "Capabilities include loan repayment's, interest waivers and the ability to 'adjust' an existing transaction. An 'adjustment' of a transaction is really a 'reversal' of existing transaction followed by creation of a new transaction with the provided details.") }) +@Tag(name = "Loan Transactions", description = "Capabilities include loan repayment's, interest waivers and the ability to 'adjust' an existing transaction. An 'adjustment' of a transaction is really a 'reversal' of existing transaction followed by creation of a new transaction with the provided details.") public class LoanTransactionsApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -108,16 +105,16 @@ public class LoanTransactionsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Loan Transaction Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Loan Transaction Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Request:\n" + "\n" + "loans/1/transactions/template?command=repayment") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTemplateResponse.class) }) - public String retrieveTransactionTemplate(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo, - @QueryParam("dateFormat") @ApiParam(value = "dateFormat") final String dateFormat, - @QueryParam("transactionDate") @ApiParam(value = "transactionDate") final DateParam transactionDateParam, - @QueryParam("locale") @ApiParam(value = "locale") final String locale) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTemplateResponse.class))) }) + public String retrieveTransactionTemplate(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, + @QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat, + @QueryParam("transactionDate") @Parameter(description = "transactionDate") final DateParam transactionDateParam, + @QueryParam("locale") @Parameter(description = "locale") final String locale) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -170,12 +167,13 @@ public class LoanTransactionsApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Transaction Details", httpMethod = "GET", notes = "Retrieves a Transaction Details\n\n" - + "Example Request:\n" + "\n" + "loans/5/transactions/3") + @Operation(summary = "Retrieve a Transaction Details", description = "Retrieves a Transaction Details\n\n" + "Example Request:\n" + "\n" + + "loans/5/transactions/3") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTransactionIdResponse.class) }) - public String retrieveTransaction(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTransactionIdResponse.class))) }) + public String retrieveTransaction(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -193,15 +191,14 @@ public class LoanTransactionsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Make a Repayment | Make a Refund of an Active Loan by Cash | Foreclosure of an Active Loan | Waive Interest | Write-off Loan | Make Recovery Payment | Undo Loan Write-off Transaction", httpMethod = "POST", notes = "Make Recovery Payment:\n\n" + @Operation(summary = "Make a Repayment | Make a Refund of an Active Loan by Cash | Foreclosure of an Active Loan | Waive Interest | Write-off Loan | Make Recovery Payment | Undo Loan Write-off Transaction", description = "Make Recovery Payment:\n\n" + "This API allows collecting recovery payments for written-off loans") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class) }) - public String executeLoanTransaction(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class))) }) + public String executeLoanTransaction(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -246,15 +243,14 @@ public class LoanTransactionsApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Adjust a Transaction", httpMethod = "POST", notes = "Note: there is no need to specify command={transactionType} parameter.\n\n" + @Operation(summary = "Adjust a Transaction", description = "Note: there is no need to specify command={transactionType} parameter.\n\n" + "Mandatory Fields: transactionDate, transactionAmount") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdResponse.class) }) - public String adjustLoanTransaction(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdResponse.class))) }) + public String adjustLoanTransaction(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); final CommandWrapper commandRequest = builder.adjustTransaction(loanId, transactionId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResourceSwagger.java index 0c3ee82a6..53b1c669f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; /** @@ -29,7 +28,7 @@ final class LoanTransactionsApiResourceSwagger { private LoanTransactionsApiResourceSwagger() {} - @ApiModel(value = "GetLoansLoanIdTransactionsTemplateResponse") + @Schema(description = "GetLoansLoanIdTransactionsTemplateResponse") public static final class GetLoansLoanIdTransactionsTemplateResponse { private GetLoansLoanIdTransactionsTemplateResponse() {} @@ -38,47 +37,47 @@ final class LoanTransactionsApiResourceSwagger { private GetLoansTransactionType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "loanTransactionType.repayment") + @Schema(example = "loanTransactionType.repayment") public String code; - @ApiModelProperty(example = "Repayment") - public String value; + @Schema(example = "Repayment") + public String description; } static final class GetLoansTotal { private GetLoansTotal() {} - @ApiModelProperty(example = "XOF") + @Schema(example = "XOF") public String currencyCode; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer digitsAfterDecimal; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "471") + @Schema(example = "471") public Float amount; - @ApiModelProperty(example = "CFA Franc BCEAO") + @Schema(example = "CFA Franc BCEAO") public String defaultName; - @ApiModelProperty(example = "currency.XOF") + @Schema(example = "currency.XOF") public String nameCode; - @ApiModelProperty(example = "CFA") + @Schema(example = "CFA") public String displaySymbol; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean zero; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean greaterThanZero; - @ApiModelProperty(example = "471 CFA") + @Schema(example = "471 CFA") public String displaySymbolValue; } public GetLoansTransactionType transactionType; - @ApiModelProperty(example = "[2009, 8, 1]") + @Schema(example = "[2009, 8, 1]") public LocalDate date; public GetLoansTotal total; } - @ApiModel(value = "GetLoansLoanIdTransactionsTransactionIdResponse") + @Schema(description = "GetLoansLoanIdTransactionsTransactionIdResponse") public static final class GetLoansLoanIdTransactionsTransactionIdResponse { private GetLoansLoanIdTransactionsTransactionIdResponse() {} @@ -87,27 +86,27 @@ final class LoanTransactionsApiResourceSwagger { private GetLoansType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "loanTransactionType.repayment") + @Schema(example = "loanTransactionType.repayment") public String code; - @ApiModelProperty(example = "Repayment") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Repayment") + public String description; + @Schema(example = "false") public Boolean disbursement; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean repaymentAtDisbursement; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean repayment; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean contra; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waiveInterest; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waiveCharges; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean writeOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean recoveryRepayment; } @@ -115,76 +114,76 @@ final class LoanTransactionsApiResourceSwagger { private GetLoansCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; public GetLoansType type; - @ApiModelProperty(example = "[2012, 5, 14]") + @Schema(example = "[2012, 5, 14]") public LocalDate date; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean manuallyReversed; public GetLoansCurrency currency; - @ApiModelProperty(example = "559.88") + @Schema(example = "559.88") public Double amount; - @ApiModelProperty(example = "559.88") + @Schema(example = "559.88") public Double interestPortion; } - @ApiModel(value = "PostLoansLoanIdTransactionsRequest") + @Schema(description = "PostLoansLoanIdTransactionsRequest") public static final class PostLoansLoanIdTransactionsRequest { private PostLoansLoanIdTransactionsRequest() {} } - @ApiModel(value = "PostLoansLoanIdTransactionsResponse") + @Schema(description = "PostLoansLoanIdTransactionsResponse") public static final class PostLoansLoanIdTransactionsResponse { private PostLoansLoanIdTransactionsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Integer resourceId; } - @ApiModel(value = "PostLoansLoanIdTransactionsTransactionIdRequest") + @Schema(description = "PostLoansLoanIdTransactionsTransactionIdRequest") public static final class PostLoansLoanIdTransactionsTransactionIdRequest { private PostLoansLoanIdTransactionsTransactionIdRequest() {} - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "25 May 2012") + @Schema(example = "25 May 2012") public String transactionDate; - @ApiModelProperty(example = "50,000.00") + @Schema(example = "50,000.00") public Double transactionAmount; - @ApiModelProperty(example = "An optional note about why your adjusting or changing the transaction.") + @Schema(example = "An optional note about why your adjusting or changing the transaction.") public String note; } - @ApiModel(value = "PostLoansLoanIdTransactionsTransactionIdResponse") + @Schema(description = "PostLoansLoanIdTransactionsTransactionIdResponse") public static final class PostLoansLoanIdTransactionsTransactionIdResponse { private PostLoansLoanIdTransactionsTransactionIdResponse() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java index fe46eebfc..1f4c7f6e8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java @@ -23,15 +23,14 @@ import static org.apache.fineract.portfolio.loanproduct.service.LoanEnumerations import com.google.gson.JsonElement; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; @@ -146,67 +145,57 @@ import org.springframework.util.CollectionUtils; @Path("/loans") @Component @Scope("singleton") -@Api(tags = { "Loans" }) -@SwaggerDefinition(tags = { - @Tag(name = "Loans", description = "The API concept of loans models the loan application process and the loan contract/monitoring process.\n" - + "\n" + "Field Descriptions\n" + "accountNo\n" - + "The account no. associated with this loan. Is auto generated if not provided at loan application creation time.\n" - + "externalId\n" + "A place to put an external reference for this loan e.g. The ID another system uses.\n" - + "If provided, it must be unique.\n" + "fundId\n" + "Optional: For associating a loan with a given fund.\n" - + "loanOfficerId\n" + "Optional: For associating a loan with a given staff member who is a loan officer.\n" - + "loanPurposeId\n" - + "Optional: For marking a loan with a given loan purpose option. Loan purposes are configurable and can be setup by system admin through code/code values screens.\n" - + "principal\n" + "The loan amount to be disbursed to through loan.\n" + "loanTermFrequency\n" + "The length of loan term\n" - + "Used like: loanTermFrequency loanTermFrequencyType\n" + "e.g. 12 Months\n" + "loanTermFrequencyType\n" - + "The loan term period to use. Used like: loanTermFrequency loanTermFrequencyType\n" - + "e.g. 12 Months Example Values: 0=Days, 1=Weeks, 2=Months, 3=Years\n" + "numberOfRepayments\n" - + "Number of installments to repay.\n" + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" - + "e.g. 10 (repayments) Every 12 Weeks\n" + "repaymentEvery\n" - + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + "e.g. 10 (repayments) Every 12 Weeks\n" - + "repaymentFrequencyType\n" + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" - + "e.g. 10 (repayments) Every 12 Weeks \n" + "Example Values: 0=Days, 1=Weeks, 2=Months\n" + "interestRatePerPeriod\n" - + "Interest Rate.\n" + "Used like: interestRatePerPeriod % interestRateFrequencyType - interestType\n" - + "e.g. 12.0000% Per year - Declining Balance\n" + "interestRateFrequencyType\n" - + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" - + "e.g. 12.0000% Per year - Declining Balance \n" + "Example Values: 2=Per month, 3=Per year\n" - + "graceOnPrincipalPayment\n" - + "Optional: Integer - represents the number of repayment periods that grace should apply to the principal component of a repayment period.\n" - + "graceOnInterestPayment\n" - + "Optional: Integer - represents the number of repayment periods that grace should apply to the interest component of a repayment period. Interest is still calculated but offset to later repayment periods.\n" - + "graceOnInterestCharged\n" - + "Optional: Integer - represents the number of repayment periods that should be interest-free.\n" - + "graceOnArrearsAgeing\n" - + "Optional: Integer - Used in Arrears calculation to only take into account loans that are more than graceOnArrearsAgeing days overdue.\n" - + "interestChargedFromDate\n" + "Optional: Date - The date from with interest is to start being charged.\n" - + "expectedDisbursementDate\n" - + "The proposed disbursement date of the loan so a proposed repayment schedule can be provided.\n" + "submittedOnDate\n" - + "The date the loan application was submitted by applicant.\n" + "linkAccountId\n" - + "The Savings Account id for linking with loan account for payments.\n" + "amortizationType\n" - + "Example Values: 0=Equal principle payments, 1=Equal installments\n" + "interestType\n" - + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" - + "e.g. 12.0000% Per year - Declining Balance \n" + "Example Values: 0=Declining Balance, 1=Flat\n" - + "interestCalculationPeriodType\n" + "Example Values: 0=Daily, 1=Same as repayment period\n" - + "allowPartialPeriodInterestCalcualtion\n" - + "This value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\n" - + "inArrearsTolerance\n" - + "The amount that can be 'waived' at end of all loan payments because it is too small to worry about.\n" - + "This is also the tolerance amount assessed when determining if a loan is in arrears.\n" - + "transactionProcessingStrategyId\n" - + "An enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\n" - + "A number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n" - + "\n" - + "Refer to the Payment Application Logic / Transaction Processing Strategy section in the appendix for more detailed overview of each available payment application logic provided out of the box.\n" - + "\n" + "List of current approaches:\n" + "1 = Mifos style (Similar to Old Mifos)\n" - + "2 = Heavensfamily (Custom MFI approach)\n" + "3 = Creocore (Custom MFI approach)\n" + "4 = RBI (India)\n" - + "5 = Principal Interest Penalties Fees Order\n" + "6 = Interest Principal Penalties Fees Order\n" - + "7 = Early Payment Strategy\n" + "loanType\n" + "To represent different type of loans.\n" - + "At present there are three type of loans are supported. \n" + "Available loan types:\n" - + "individual: Loan given to individual member\n" + "group: Loan given to group as a whole\n" - + "jlg: Joint liability group loan given to members in a group on individual basis. JLG loan can be given to one or more members in a group.\n" - + "recalculationRestFrequencyDate\n" - + "Specifies rest frequency start date for interest recalculation. This date must be before or equal to disbursement date\n" - + "recalculationCompoundingFrequencyDate\n" - + "Specifies compounding frequency start date for interest recalculation. This date must be equal to disbursement date") }) +@Tag(name = "Loans", description = "The API concept of loans models the loan application process and the loan contract/monitoring process.\n" + + "\n" + "Field Descriptions\n" + "accountNo\n" + + "The account no. associated with this loan. Is auto generated if not provided at loan application creation time.\n" + + "externalId\n" + "A place to put an external reference for this loan e.g. The ID another system uses.\n" + + "If provided, it must be unique.\n" + "fundId\n" + "Optional: For associating a loan with a given fund.\n" + "loanOfficerId\n" + + "Optional: For associating a loan with a given staff member who is a loan officer.\n" + "loanPurposeId\n" + + "Optional: For marking a loan with a given loan purpose option. Loan purposes are configurable and can be setup by system admin through code/code values screens.\n" + + "principal\n" + "The loan amount to be disbursed to through loan.\n" + "loanTermFrequency\n" + "The length of loan term\n" + + "Used like: loanTermFrequency loanTermFrequencyType\n" + "e.g. 12 Months\n" + "loanTermFrequencyType\n" + + "The loan term period to use. Used like: loanTermFrequency loanTermFrequencyType\n" + + "e.g. 12 Months Example Values: 0=Days, 1=Weeks, 2=Months, 3=Years\n" + "numberOfRepayments\n" + + "Number of installments to repay.\n" + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + + "e.g. 10 (repayments) Every 12 Weeks\n" + "repaymentEvery\n" + + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + "e.g. 10 (repayments) Every 12 Weeks\n" + + "repaymentFrequencyType\n" + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + + "e.g. 10 (repayments) Every 12 Weeks \n" + "Example Values: 0=Days, 1=Weeks, 2=Months\n" + "interestRatePerPeriod\n" + + "Interest Rate.\n" + "Used like: interestRatePerPeriod % interestRateFrequencyType - interestType\n" + + "e.g. 12.0000% Per year - Declining Balance\n" + "interestRateFrequencyType\n" + + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" + "e.g. 12.0000% Per year - Declining Balance \n" + + "Example Values: 2=Per month, 3=Per year\n" + "graceOnPrincipalPayment\n" + + "Optional: Integer - represents the number of repayment periods that grace should apply to the principal component of a repayment period.\n" + + "graceOnInterestPayment\n" + + "Optional: Integer - represents the number of repayment periods that grace should apply to the interest component of a repayment period. Interest is still calculated but offset to later repayment periods.\n" + + "graceOnInterestCharged\n" + "Optional: Integer - represents the number of repayment periods that should be interest-free.\n" + + "graceOnArrearsAgeing\n" + + "Optional: Integer - Used in Arrears calculation to only take into account loans that are more than graceOnArrearsAgeing days overdue.\n" + + "interestChargedFromDate\n" + "Optional: Date - The date from with interest is to start being charged.\n" + + "expectedDisbursementDate\n" + "The proposed disbursement date of the loan so a proposed repayment schedule can be provided.\n" + + "submittedOnDate\n" + "The date the loan application was submitted by applicant.\n" + "linkAccountId\n" + + "The Savings Account id for linking with loan account for payments.\n" + "amortizationType\n" + + "Example Values: 0=Equal principle payments, 1=Equal installments\n" + "interestType\n" + + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" + "e.g. 12.0000% Per year - Declining Balance \n" + + "Example Values: 0=Declining Balance, 1=Flat\n" + "interestCalculationPeriodType\n" + + "Example Values: 0=Daily, 1=Same as repayment period\n" + "allowPartialPeriodInterestCalcualtion\n" + + "This value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\n" + + "inArrearsTolerance\n" + "The amount that can be 'waived' at end of all loan payments because it is too small to worry about.\n" + + "This is also the tolerance amount assessed when determining if a loan is in arrears.\n" + "transactionProcessingStrategyId\n" + + "An enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\n" + + "A number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n" + + "\n" + + "Refer to the Payment Application Logic / Transaction Processing Strategy section in the appendix for more detailed overview of each available payment application logic provided out of the box.\n" + + "\n" + "List of current approaches:\n" + "1 = Mifos style (Similar to Old Mifos)\n" + "2 = Heavensfamily (Custom MFI approach)\n" + + "3 = Creocore (Custom MFI approach)\n" + "4 = RBI (India)\n" + "5 = Principal Interest Penalties Fees Order\n" + + "6 = Interest Principal Penalties Fees Order\n" + "7 = Early Payment Strategy\n" + "loanType\n" + + "To represent different type of loans.\n" + "At present there are three type of loans are supported. \n" + + "Available loan types:\n" + "individual: Loan given to individual member\n" + "group: Loan given to group as a whole\n" + + "jlg: Joint liability group loan given to members in a group on individual basis. JLG loan can be given to one or more members in a group.\n" + + "recalculationRestFrequencyDate\n" + + "Specifies rest frequency start date for interest recalculation. This date must be before or equal to disbursement date\n" + + "recalculationCompoundingFrequencyDate\n" + + "Specifies compounding frequency start date for interest recalculation. This date must be equal to disbursement date") public class LoansApiResource { private final Set LOAN_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "accountNo", "status", "externalId", "clientId", @@ -333,8 +322,9 @@ public class LoansApiResource { @Path("{loanId}/template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String retrieveApprovalTemplate(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("templateType") @ApiParam(value = "templateType") final String templateType, @Context final UriInfo uriInfo) { + public String retrieveApprovalTemplate(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("templateType") @Parameter(description = "templateType") final String templateType, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -356,17 +346,18 @@ public class LoansApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Loan Details Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Requests:\n" + "\n" + @Operation(summary = "Retrieve Loan Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Requests:\n" + "\n" + "loans/template?templateType=individual&clientId=1\n" + "\n" + "\n" + "loans/template?templateType=individual&clientId=1&productId=1") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.GetLoansTemplateResponse.class) }) - public String template(@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, - @QueryParam("templateType") @ApiParam(value = "templateType") final String templateType, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, - @DefaultValue("false") @QueryParam("activeOnly") @ApiParam(value = "activeOnly") final boolean onlyActive, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansTemplateResponse.class))) }) + public String template(@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("groupId") @Parameter(description = "groupId") final Long groupId, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, + @QueryParam("templateType") @Parameter(description = "templateType") final String templateType, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @DefaultValue("false") @QueryParam("activeOnly") @Parameter(description = "activeOnly") final boolean onlyActive, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -489,13 +480,14 @@ public class LoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Loan", httpMethod = "GET", notes = "Note: template=true parameter doesn't apply to this resource." + @Operation(summary = "Retrieve a Loan", description = "Note: template=true parameter doesn't apply to this resource." + "Example Requests:\n" + "\n" + "loans/1\n" + "\n" + "\n" + "loans/1?fields=id,principal,annualInterestRate\n" + "\n" + "\n" + "loans/1?associations=all\n" + "\n" + "loans/1?associations=all&exclude=guarantors\n" + "\n" + "\n" + "loans/1?fields=id,principal,annualInterestRate&associations=repaymentSchedule,transactions") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.GetLoansLoanIdResponse.class) }) - public String retrieveLoan(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansLoanIdResponse.class))) }) + public String retrieveLoan(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, @Context final UriInfo uriInfo) { long start = System.currentTimeMillis(); this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -749,19 +741,20 @@ public class LoansApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Loans", httpMethod = "GET", notes = "The list capability of loans can support pagination and sorting.\n" + @Operation(summary = "List Loans", description = "The list capability of loans can support pagination and sorting.\n" + "Example Requests:\n" + "\n" + "loans\n" + "\n" + "loans?fields=accountNo\n" + "\n" + "loans?offset=10&limit=50\n" + "\n" + "loans?orderBy=accountNo&sortOrder=DESC") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.GetLoansResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, // @QueryParam("underHierarchy") final String hierarchy, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder, - @QueryParam("accountNo") @ApiParam(value = "accountNo") final String accountNo) { + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder, + @QueryParam("accountNo") @Parameter(description = "accountNo") final String accountNo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -777,19 +770,19 @@ public class LoansApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Calculate loan repayment schedule | Submit a new Loan Application", httpMethod = "POST", notes = "It calculates the loan repayment Schedule\n" + @Operation(summary = "Calculate loan repayment schedule | Submit a new Loan Application", description = "It calculates the loan repayment Schedule\n" + "Submits a new loan application\n" + "Mandatory Fields: clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, loanType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, expectedDisbursementDate, submittedOnDate, loanType\n" + "Optional Fields: graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, linkAccountId, allowPartialPeriodInterestCalcualtion, fixedEmiAmount, maxOutstandingLoanBalance, disbursementData, graceOnArrearsAgeing, createStandingInstructionAtDisbursement (requires linkedAccountId if set to true)\n" + "Additional Mandatory Fields if interest recalculation is enabled for product and Rest frequency not same as repayment period: recalculationRestFrequencyDate\n" + "Additional Mandatory Fields if interest recalculation with interest/fee compounding is enabled for product and compounding frequency not same as repayment period: recalculationCompoundingFrequencyDate\n" + "Additional Mandatory Field if Entity-Datatable Check is enabled for the entity of type loan: datatables") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoansApiResourceSwagger.PostLoansRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.PostLoansResponse.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PostLoansRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PostLoansResponse.class))) }) public String calculateLoanScheduleOrSubmitLoanApplication( - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { if (is(commandParam, "calculateLoanSchedule")) { @@ -813,12 +806,12 @@ public class LoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Modify a loan application", httpMethod = "PUT", notes = "Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoansApiResourceSwagger.PutLoansLoanIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.PutLoansLoanIdResponse.class) }) - public String modifyLoanApplication(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Modify a loan application", description = "Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansLoanIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansLoanIdResponse.class))) }) + public String modifyLoanApplication(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateLoanApplication(loanId).withJson(apiRequestBodyAsJson) .build(); @@ -832,9 +825,10 @@ public class LoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Loan Application", httpMethod = "DELETE", notes = "Note: Only loans in \"Submitted and awaiting approval\" status can be deleted.") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.DeleteLoansLoanIdResponse.class) }) - public String deleteLoanApplication(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId) { + @Operation(summary = "Delete a Loan Application", description = "Note: Only loans in \"Submitted and awaiting approval\" status can be deleted.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.DeleteLoansLoanIdResponse.class))) }) + public String deleteLoanApplication(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteLoanApplication(loanId).build(); @@ -847,7 +841,7 @@ public class LoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve Loan Application | Recover Loan Guarantee | Undo Loan Application Approval | Assign a Loan Officer | Unassign a Loan Officer | Reject Loan Application | Applicant Withdraws from Loan Application | Disburse Loan Disburse Loan To Savings Account | Undo Loan Disbursal", httpMethod = "POST", notes = "Approve Loan Application:\n" + @Operation(summary = "Approve Loan Application | Recover Loan Guarantee | Undo Loan Application Approval | Assign a Loan Officer | Unassign a Loan Officer | Reject Loan Application | Applicant Withdraws from Loan Application | Disburse Loan Disburse Loan To Savings Account | Undo Loan Disbursal", description = "Approve Loan Application:\n" + "Mandatory Fields: approvedOnDate\n" + "Optional Fields: approvedLoanAmount and expectedDisbursementDate\n" + "Approves the loan application\n\n" + "Recover Loan Guarantee:\n" + "Recovers the loan guarantee\n\n" + "Undo Loan Application Approval:\n" + "Undoes the Loan Application Approval\n\n" + "Assign a Loan Officer:\n" @@ -859,12 +853,12 @@ public class LoansApiResource { + "Disburses the Loan\n\n" + "Disburse Loan To Savings Account:\n" + "Mandatory Fields: actualDisbursementDate\n" + "Optional Fields: transactionAmount and fixedEmiAmount\n" + "Disburses the loan to Saving Account\n\n" + "Undo Loan Disbursal:\n" + "Undoes the Loan Disbursal\n" + "Showing request and response for Assign a Loan Officer") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoansApiResourceSwagger.PostLoansLoanIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.PostLoansLoanIdResponse.class) }) - public String stateTransitions(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PostLoansLoanIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PostLoansLoanIdResponse.class))) }) + public String stateTransitions(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -943,7 +937,7 @@ public class LoansApiResource { @Path("glimAccount/{glimId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve GLIM Application | Undo GLIM Application Approval | Reject GLIM Application | Disburse Loan Disburse Loan To Savings Account | Undo Loan Disbursal", httpMethod = "POST", notes = "Approve GLIM Application:\n" + @Operation(summary = "Approve GLIM Application | Undo GLIM Application Approval | Reject GLIM Application | Disburse Loan Disburse Loan To Savings Account | Undo Loan Disbursal", description = "Approve GLIM Application:\n" + "Mandatory Fields: approvedOnDate\n" + "Optional Fields: approvedLoanAmount and expectedDisbursementDate\n" + "Approves the GLIM application\n\n" + "Undo GLIM Application Approval:\n" + "Undoes the GLIM Application Approval\n\n" + "Reject GLIM Application:\n" + "Mandatory Fields: rejectedOnDate\n" + "Allows you to reject the GLIM application\n\n" @@ -951,9 +945,9 @@ public class LoansApiResource { + "Disburses the Loan\n\n" + "Disburse Loan To Savings Account:\n" + "Mandatory Fields: actualDisbursementDate\n" + "Optional Fields: transactionAmount and fixedEmiAmount\n" + "Disburses the loan to Saving Account\n\n" + "Undo Loan Disbursal:\n" + "Undoes the Loan Disbursal\n") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoansApiResourceSwagger.PostLoansLoanIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoansApiResourceSwagger.PostLoansLoanIdResponse.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PostLoansLoanIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PostLoansLoanIdResponse.class))) }) public String glimStateTransitions(@PathParam("glimId") final Long glimId, @QueryParam("command") final String commandParam, final String apiRequestBodyAsJson) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java index 875521b40..58e95ab0b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.loanaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class LoansApiResourceSwagger { private LoansApiResourceSwagger() {} - @ApiModel(value = "GetLoansTemplateResponse") + @Schema(description = "GetLoansTemplateResponse") public static final class GetLoansTemplateResponse { private GetLoansTemplateResponse() {} @@ -39,7 +38,7 @@ final class LoansApiResourceSwagger { private GetLoansTemplateTimeline() {} - @ApiModelProperty(example = "[2013, 3, 8]") + @Schema(example = "[2013, 3, 8]") public LocalDate expectedDisbursementDate; } @@ -47,23 +46,23 @@ final class LoansApiResourceSwagger { private GetLoansTemplateProductOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Kampala Product (with cash accounting)") + @Schema(example = "Kampala Product (with cash accounting)") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long clientId; - @ApiModelProperty(example = "Kampala first Client") + @Schema(example = "Kampala first Client") public String clientName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientOfficeId; public GetLoansTemplateTimeline timeline; public Set productOptions; } - @ApiModel(value = "GetLoansLoanIdResponse") + @Schema(description = "GetLoansLoanIdResponse") public static final class GetLoansLoanIdResponse { private GetLoansLoanIdResponse() {} @@ -72,27 +71,27 @@ final class LoansApiResourceSwagger { private GetLoansLoanIdStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "loanStatusType.active") + @Schema(example = "loanStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Active") + public String description; + @Schema(example = "false") public Boolean pendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } @@ -100,29 +99,29 @@ final class LoansApiResourceSwagger { private GetLoansLoanIdLoanType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "loanType.individual") + @Schema(example = "loanType.individual") public String code; - @ApiModelProperty(example = "Individual") - public String value; + @Schema(example = "Individual") + public String description; } static final class GetLoansLoanIdCurrency { private GetLoansLoanIdCurrency() {} - @ApiModelProperty(example = "UGX") + @Schema(example = "UGX") public String code; - @ApiModelProperty(example = "Uganda Shilling") + @Schema(example = "Uganda Shilling") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "USh") + @Schema(example = "USh") public String displaySymbol; - @ApiModelProperty(example = "currency.UGX") + @Schema(example = "currency.UGX") public String nameCode; - @ApiModelProperty(example = "Uganda Shilling (USh)") + @Schema(example = "Uganda Shilling (USh)") public String displayLabel; } @@ -130,105 +129,105 @@ final class LoansApiResourceSwagger { private GetLoansLoanIdTermPeriodFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "termFrequency.periodFrequencyType.months") + @Schema(example = "termFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetLoansLoanIdRepaymentFrequencyType { private GetLoansLoanIdRepaymentFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "repaymentFrequency.periodFrequencyType.months") + @Schema(example = "repaymentFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetLoansLoanIdInterestRateFrequencyType { private GetLoansLoanIdInterestRateFrequencyType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "interestRateFrequency.periodFrequencyType.years") + @Schema(example = "interestRateFrequency.periodFrequencyType.years") public String code; - @ApiModelProperty(example = "Per year") - public String value; + @Schema(example = "Per year") + public String description; } static final class GetLoansLoanIdAmortizationType { private GetLoansLoanIdAmortizationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "amortizationType.equal.installments") + @Schema(example = "amortizationType.equal.installments") public String code; - @ApiModelProperty(example = "Equal installments") - public String value; + @Schema(example = "Equal installments") + public String description; } static final class GetLoansLoanIdInterestType { private GetLoansLoanIdInterestType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestType.flat") + @Schema(example = "interestType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetLoansLoanIdInterestCalculationPeriodType { private GetLoansLoanIdInterestCalculationPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestCalculationPeriodType.same.as.repayment.period") + @Schema(example = "interestCalculationPeriodType.same.as.repayment.period") public String code; - @ApiModelProperty(example = "Same as repayment period") - public String value; + @Schema(example = "Same as repayment period") + public String description; } static final class GetLoansLoanIdTimeline { private GetLoansLoanIdTimeline() {} - @ApiModelProperty(example = "[2012, 4, 3]") + @Schema(example = "[2012, 4, 3]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "admin") + @Schema(example = "admin") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; - @ApiModelProperty(example = "[2012, 4, 3]") + @Schema(example = "[2012, 4, 3]") public LocalDate approvedOnDate; - @ApiModelProperty(example = "admin") + @Schema(example = "admin") public String approvedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String approvedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String approvedByLastname; - @ApiModelProperty(example = "[2012, 4, 10]") + @Schema(example = "[2012, 4, 10]") public LocalDate expectedDisbursementDate; - @ApiModelProperty(example = "[2012, 4, 10]") + @Schema(example = "[2012, 4, 10]") public LocalDate actualDisbursementDate; - @ApiModelProperty(example = "admin") + @Schema(example = "admin") public String disbursedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String disbursedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String disbursedByLastname; - @ApiModelProperty(example = "[2012, 4, 10]") + @Schema(example = "[2012, 4, 10]") public LocalDate expectedMaturityDate; } @@ -245,9 +244,9 @@ final class LoansApiResourceSwagger { private GetLoansLoanIdLinkedAccount() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; } @@ -255,13 +254,13 @@ final class LoansApiResourceSwagger { private GetLoansLoanIdDisbursementDetails() {} - @ApiModelProperty(example = "71") + @Schema(example = "71") public Integer id; - @ApiModelProperty(example = "[2013, 11, 1]") + @Schema(example = "[2013, 11, 1]") public LocalDate expectedDisbursementDate; - @ApiModelProperty(example = "22000.000000") + @Schema(example = "22000.000000") public Float principal; - @ApiModelProperty(example = "22000.000000") + @Schema(example = "22000.000000") public Float approvedPrincipal; } @@ -273,252 +272,252 @@ final class LoansApiResourceSwagger { private GetLoansLoanIdChargeTimeType() {} - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer id; - @ApiModelProperty(example = "chargeTimeType.overdueInstallment") + @Schema(example = "chargeTimeType.overdueInstallment") public String code; - @ApiModelProperty(example = "overdue fees") - public String value; + @Schema(example = "overdue fees") + public String description; } static final class GetLoansLoanIdChargeCalculationType { private GetLoansLoanIdChargeCalculationType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.percent.of.amount") + @Schema(example = "chargeCalculationType.percent.of.amount") public String code; - @ApiModelProperty(example = "% Amount") - public String value; + @Schema(example = "% Amount") + public String description; } static final class GetLoansLoanIdChargePaymentMode { private GetLoansLoanIdChargePaymentMode() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.regular") + @Schema(example = "chargepaymentmode.regular") public String code; - @ApiModelProperty(example = "Regular") - public String value; + @Schema(example = "Regular") + public String description; } static final class GetLoansLoanIdFeeFrequency { private GetLoansLoanIdFeeFrequency() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "feeFrequencyperiodFrequencyType.weeks") + @Schema(example = "feeFrequencyperiodFrequencyType.weeks") public String code; - @ApiModelProperty(example = "Weeks") - public String value; + @Schema(example = "Weeks") + public String description; } - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer id; - @ApiModelProperty(example = "overdraft penality") + @Schema(example = "overdraft penality") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; public LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.GetLoanChargeCurrency currency; - @ApiModelProperty(example = "3.000000") + @Schema(example = "3.000000") public Float amount; public GetLoansLoanIdChargeTimeType chargeTimeType; public LoanChargesApiResourceSwagger.GetLoansLoanIdChargesTemplateResponse.GetLoanChargeTemplateChargeOptions.GetLoanChargeTemplateChargeAppliesTo chargeAppliesTo; public GetLoansLoanIdChargeCalculationType chargeCalculationType; public GetLoansLoanIdChargePaymentMode chargePaymentMode; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer feeInterval; public GetLoansLoanIdFeeFrequency feeFrequency; } public GetLoansLoanIdCurrency currency; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long principalDisbursed; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long principalPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long principalWrittenOff; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long principalOutstanding; - @ApiModelProperty(example = "833333.3") + @Schema(example = "833333.3") public Double principalOverdue; - @ApiModelProperty(example = "240000") + @Schema(example = "240000") public Long interestCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long interestPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long interestWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long interestWrittenOff; - @ApiModelProperty(example = "240000") + @Schema(example = "240000") public Long interestOutstanding; - @ApiModelProperty(example = "200000") + @Schema(example = "200000") public Long interestOverdue; - @ApiModelProperty(example = "18000") + @Schema(example = "18000") public Long feeChargesCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesDueAtDisbursementCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesWrittenOff; - @ApiModelProperty(example = "18000") + @Schema(example = "18000") public Long feeChargesOutstanding; - @ApiModelProperty(example = "15000") + @Schema(example = "15000") public Long feeChargesOverdue; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesWrittenOff; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesOutstanding; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesOverdue; - @ApiModelProperty(example = "1258000") + @Schema(example = "1258000") public Long totalExpectedRepayment; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalRepayment; - @ApiModelProperty(example = "258000") + @Schema(example = "258000") public Long totalExpectedCostOfLoan; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalCostOfLoan; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalWrittenOff; - @ApiModelProperty(example = "1258000") + @Schema(example = "1258000") public Long totalOutstanding; - @ApiModelProperty(example = "1048333.3") + @Schema(example = "1048333.3") public Double totalOverdue; - @ApiModelProperty(example = "[2012, 5, 10]") + @Schema(example = "[2012, 5, 10]") public LocalDate overdueSinceDate; public GetLoansLoanIdLinkedAccount linkedAccount; public Set disbursementDetails; - @ApiModelProperty(example = "1100.000000") + @Schema(example = "1100.000000") public Float fixedEmiAmount; - @ApiModelProperty(example = "35000") + @Schema(example = "35000") public Long maxOutstandingLoanBalance; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean canDisburse; public Set emiAmountVariations; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean inArrears; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isNPA; public Set overdueCharges; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; public GetLoansLoanIdStatus status; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Kampala first Client") + @Schema(example = "Kampala first Client") public String clientName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanProductId; - @ApiModelProperty(example = "Kampala Product (with cash accounting)") + @Schema(example = "Kampala Product (with cash accounting)") public String loanProductName; - @ApiModelProperty(example = "Typical Kampala loan product with cash accounting enabled for testing.") + @Schema(example = "Typical Kampala loan product with cash accounting enabled for testing.") public String loanProductDescription; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Integer loanPurposeId; - @ApiModelProperty(example = "option.HousingImprovement") + @Schema(example = "option.HousingImprovement") public String loanPurposeName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer loanOfficerId; - @ApiModelProperty(example = "LoanOfficer, Kampala") + @Schema(example = "LoanOfficer, Kampala") public String loanOfficerName; public GetLoansLoanIdLoanType loanType; public GetLoansLoanIdCurrency currency; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long principal; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer termFrequency; public GetLoansLoanIdTermPeriodFrequencyType termPeriodFrequencyType; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; public GetLoansLoanIdRepaymentFrequencyType repaymentFrequencyType; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer interestRatePerPeriod; public GetLoansLoanIdInterestRateFrequencyType interestRateFrequencyType; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer annualInterestRate; public GetLoansLoanIdAmortizationType amortizationType; public GetLoansLoanIdInterestType interestType; public GetLoansLoanIdInterestCalculationPeriodType interestCalculationPeriodType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer transactionProcessingStrategyId; public GetLoansLoanIdTimeline timeline; public GetLoansLoanIdSummary summary; } - @ApiModel(value = "GetLoansResponse") + @Schema(description = "GetLoansResponse") public static final class GetLoansResponse { private GetLoansResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "PostLoansRequest") + @Schema(description = "PostLoansRequest") public static final class PostLoansRequest { private PostLoansRequest() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "100,000.00") + @Schema(example = "100,000.00") public Double principal; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer loanTermFrequency; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer loanTermFrequencyType; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer repaymentFrequencyType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer interestRatePerPeriod; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amortizationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCalculationPeriodType; - @ApiModelProperty(example = "20 September 2011") + @Schema(example = "20 September 2011") public String expectedDisbursementDate; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer transactionProcessingStrategyId; } - @ApiModel(value = "PostLoansResponse") + @Schema(description = "PostLoansResponse") public static final class PostLoansResponse { private PostLoansResponse() {} @@ -527,96 +526,96 @@ final class LoansApiResourceSwagger { private PostLoansRepaymentSchedulePeriods() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer period; - @ApiModelProperty(example = "[2011, 9, 20]") + @Schema(example = "[2011, 9, 20]") public LocalDate dueDate; - @ApiModelProperty(example = "100000") + @Schema(example = "100000") public Long principalDisbursed; - @ApiModelProperty(example = "100000") + @Schema(example = "100000") public Long principalLoanBalanceOutstanding; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesDue; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesOutstanding; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalOriginalDueForPeriod; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalDueForPeriod; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalOutstandingForPeriod; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalOverdue; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalActualCostOfLoanForPeriod; } public GetLoansLoanIdResponse.GetLoansLoanIdCurrency currency; - @ApiModelProperty(example = "366") + @Schema(example = "366") public Integer loanTermInDays; - @ApiModelProperty(example = "100000") + @Schema(example = "100000") public Long totalPrincipalDisbursed; - @ApiModelProperty(example = "100000") + @Schema(example = "100000") public Long totalPrincipalExpected; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalPrincipalPaid; - @ApiModelProperty(example = "13471.52") + @Schema(example = "13471.52") public Double totalInterestCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalFeeChargesCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalPenaltyChargesCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalWrittenOff; - @ApiModelProperty(example = "113471.52") + @Schema(example = "113471.52") public Double totalRepaymentExpected; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalRepayment; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalOutstanding; public Set periods; } - @ApiModel(value = "PutLoansLoanIdRequest") + @Schema(description = "PutLoansLoanIdRequest") public static final class PutLoansLoanIdRequest { private PutLoansLoanIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Long principal; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer loanTermFrequency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer loanTermFrequencyType; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer repaymentFrequencyType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer interestRatePerPeriod; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestCalculationPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amortizationType; - @ApiModelProperty(example = "04 March 2014") + @Schema(example = "04 March 2014") public String expectedDisbursementDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transactionProcessingStrategyId; } - @ApiModel(value = "PutLoansLoanIdResponse") + @Schema(description = "PutLoansLoanIdResponse") public static final class PutLoansLoanIdResponse { private PutLoansLoanIdResponse() {} @@ -625,67 +624,67 @@ final class LoansApiResourceSwagger { private PutLoansLoanIdChanges() {} - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Long principal; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutLoansLoanIdChanges changes; } - @ApiModel(value = "DeleteLoansLoanIdResponse") + @Schema(description = "DeleteLoansLoanIdResponse") public static final class DeleteLoansLoanIdResponse { private DeleteLoansLoanIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PostLoansLoanIdRequest") + @Schema(description = "PostLoansLoanIdRequest") public static final class PostLoansLoanIdRequest { private PostLoansLoanIdRequest() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toLoanOfficerId; - @ApiModelProperty(example = "02 September 2014") + @Schema(example = "02 September 2014") public String assignmentDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer fromLoanOfficerId; } - @ApiModel(value = "PostLoansLoanIdResponse") + @Schema(description = "PostLoansLoanIdResponse") public static final class PostLoansLoanIdResponse { private PostLoansLoanIdResponse() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer clientId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer loanId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java index a1f117cab..6187a4076 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.loanproduct.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -87,9 +87,7 @@ import org.springframework.stereotype.Component; @Path("/loanproducts") @Component @Scope("singleton") -@Api(tags = { "Loan Products" }) -@SwaggerDefinition(tags = { - @Tag(name = "Loan Products", description = "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.") }) +@Tag(name = "Loan Products", description = "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.") public class LoanProductsApiResource { private final Set LOAN_PRODUCT_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "shortName", "description", "fundId", @@ -170,7 +168,7 @@ public class LoanProductsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Loan Product", httpMethod = "POST", notes = "Depending of the Accounting Rule (accountingRule) selected, additional fields with details of the appropriate Ledger Account identifiers would need to be passed in.\n" + @Operation(summary = "Create a Loan Product", description = "Depending of the Accounting Rule (accountingRule) selected, additional fields with details of the appropriate Ledger Account identifiers would need to be passed in.\n" + "\n" + "Refer MifosX Accounting Specs Draft for more details regarding the significance of the selected accounting rule\n\n" + "Mandatory Fields: name, shortName, currencyCode, digitsAfterDecimal, inMultiplesOf, principal, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, accountingRule, isInterestRecalculationEnabled, daysInYearType, daysInMonthType\n\n" + "Optional Fields: inArrearsTolerance, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, graceOnArrearsAgeing, charges, paymentChannelToFundSourceMappings, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, includeInBorrowerCycle, useBorrowerCycle,principalVariationsForBorrowerCycle, numberOfRepaymentVariationsForBorrowerCycle, interestRateVariationsForBorrowerCycle, multiDisburseLoan,maxTrancheCount, outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, installmentAmountInMultiplesOf, allowAttributeOverrides, allowPartialPeriodInterestCalcualtion\n\n" @@ -183,10 +181,10 @@ public class LoanProductsApiResource { + "Additional Optional Fields if interest recalculation is enabled(true) and interestRecalculationCompoundingMethod is enabled and recalculationCompoundingFrequencyType is not same as repayment period: recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyDate\n\n" + "Additional Mandatory Fields if Hold Guarantee funds is enabled(true): mandatoryGuarantee\n\n" + "Additional Optional Fields if Hold Guarantee funds is enabled(true): minimumGuaranteeFromOwnFunds,minimumGuaranteeFromGuarantor") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanProductsApiResourceSwagger.PostLoanProductsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = LoanProductsApiResourceSwagger.PostLoanProductsResponse.class) }) - public String createLoanProduct(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.PostLoanProductsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.PostLoanProductsResponse.class))) }) + public String createLoanProduct(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createLoanProduct().withJson(apiRequestBodyAsJson).build(); @@ -198,10 +196,10 @@ public class LoanProductsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Loan Products", httpMethod = "GET", notes = "Lists Loan Products\n\n" + "Example Requests:\n" + "\n" - + "loanproducts\n" + "\n" + "\n" + "loanproducts?fields=name,description,interestRateFrequencyType,amortizationType") + @Operation(summary = "List Loan Products", description = "Lists Loan Products\n\n" + "Example Requests:\n" + "\n" + "loanproducts\n" + + "\n" + "\n" + "loanproducts?fields=name,description,interestRateFrequencyType,amortizationType") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = LoanProductsApiResourceSwagger.GetLoanProductsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = LoanProductsApiResourceSwagger.GetLoanProductsResponse.class)))) }) public String retrieveAllLoanProducts(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -225,12 +223,12 @@ public class LoanProductsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Loan Product Details Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "loanproducts/template") + @Operation(summary = "Retrieve Loan Product Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "loanproducts/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanProductsApiResourceSwagger.GetLoanProductsTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.GetLoanProductsTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo, - @QueryParam("isProductMixTemplate") @ApiParam(value = "isProductMixTemplate") final boolean isProductMixTemplate) { + @QueryParam("isProductMixTemplate") @Parameter(description = "isProductMixTemplate") final boolean isProductMixTemplate) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -253,12 +251,12 @@ public class LoanProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Loan Product", httpMethod = "GET", notes = "Retrieves a Loan Product\n\n" + "Example Requests:\n" - + "\n" + "loanproducts/1\n" + "\n" + "\n" + "loanproducts/1?template=true\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Loan Product", description = "Retrieves a Loan Product\n\n" + "Example Requests:\n" + "\n" + + "loanproducts/1\n" + "\n" + "\n" + "loanproducts/1?template=true\n" + "\n" + "\n" + "loanproducts/1?fields=name,description,numberOfRepayments") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanProductsApiResourceSwagger.GetLoanProductsProductIdResponse.class) }) - public String retrieveLoanProductDetails(@PathParam("productId") @ApiParam(value = "productId") final Long productId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.GetLoanProductsProductIdResponse.class))) }) + public String retrieveLoanProductDetails(@PathParam("productId") @Parameter(description = "productId") final Long productId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -294,13 +292,12 @@ public class LoanProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Loan Product", httpMethod = "PUT", notes = "Updates a Loan Product") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = LoanProductsApiResourceSwagger.PutLoanProductsProductIdRequest.class) }) + @Operation(summary = "Update a Loan Product", description = "Updates a Loan Product") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.PutLoanProductsProductIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = LoanProductsApiResourceSwagger.PutLoanProductsProductIdResponse.class) }) - public String updateLoanProduct(@PathParam("productId") @ApiParam(value = "productId") final Long productId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.PutLoanProductsProductIdResponse.class))) }) + public String updateLoanProduct(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateLoanProduct(productId).withJson(apiRequestBodyAsJson) .build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java index d5a48c4d1..0f389ef3e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.loanproduct.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.List; import java.util.Set; @@ -31,83 +30,83 @@ final class LoanProductsApiResourceSwagger { private LoanProductsApiResourceSwagger() {} - @ApiModel(value = "PostLoanProductsRequest") + @Schema(description = "PostLoanProductsRequest") public static final class PostLoanProductsRequest { private PostLoanProductsRequest() {} - @ApiModelProperty(example = "LP Accrual Accounting") + @Schema(example = "LP Accrual Accounting") public String name; - @ApiModelProperty(example = "LPAA") + @Schema(example = "LPAA") public String shortName; - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer digitsAfterDecimal; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "100,000.00") + @Schema(example = "100,000.00") public Double principal; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer repaymentFrequencyType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transactionProcessingStrategyId; - @ApiModelProperty(example = "1.75") + @Schema(example = "1.75") public Double interestRatePerPeriod; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer interestRateFrequencyType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amortizationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCalculationPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer daysInMonthType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer daysInYearType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isInterestRecalculationEnabled; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer accountingRule; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer fundSourceAccountId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer loanPortfolioAccountId; - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer receivableInterestAccountId; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer receivableFeeAccountId; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer receivablePenaltyAccountId; - @ApiModelProperty(example = "34") + @Schema(example = "34") public Integer interestOnLoanAccountId; - @ApiModelProperty(example = "37") + @Schema(example = "37") public Integer incomeFromFeeAccountId; - @ApiModelProperty(example = "35") + @Schema(example = "35") public Integer incomeFromPenaltyAccountId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer overpaymentLiabilityAccountId; - @ApiModelProperty(example = "41") + @Schema(example = "41") public Integer writeOffAccountId; } - @ApiModel(value = "PostLoanProductsResponse") + @Schema(description = "PostLoanProductsResponse") public static final class PostLoanProductsResponse { private PostLoanProductsResponse() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer resourceId; } - @ApiModel(value = "GetLoanProductsResponse") + @Schema(description = "GetLoanProductsResponse") public static final class GetLoanProductsResponse { private GetLoanProductsResponse() {} @@ -116,19 +115,19 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -136,84 +135,84 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsRepaymentFrequencyType() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "repaymentFrequency.periodFrequencyType.days") + @Schema(example = "repaymentFrequency.periodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetLoanProductsInterestRateFrequencyType { private GetLoanProductsInterestRateFrequencyType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "interestRateFrequency.periodFrequencyType.years") + @Schema(example = "interestRateFrequency.periodFrequencyType.years") public String code; - @ApiModelProperty(example = "Per year") - public String value; + @Schema(example = "Per year") + public String description; } static final class GetLoanProductsAmortizationType { private GetLoanProductsAmortizationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "amortizationType.equal.installments") + @Schema(example = "amortizationType.equal.installments") public String code; - @ApiModelProperty(example = "Equal installments") - public String value; + @Schema(example = "Equal installments") + public String description; } static final class GetLoanProductsInterestType { private GetLoanProductsInterestType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestType.flat") + @Schema(example = "interestType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetLoansProductsInterestCalculationPeriodType { private GetLoansProductsInterestCalculationPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestCalculationPeriodType.same.as.repayment.period") + @Schema(example = "interestCalculationPeriodType.same.as.repayment.period") public String code; - @ApiModelProperty(example = "Same as repayment period") - public String value; + @Schema(example = "Same as repayment period") + public String description; } static final class GetLoansProductsDaysInMonthType { private GetLoansProductsDaysInMonthType() {} - @ApiModelProperty(example = "30") + @Schema(example = "30") public Integer id; - @ApiModelProperty(example = "DaysInMonthType.days360") + @Schema(example = "DaysInMonthType.days360") public String code; - @ApiModelProperty(example = "30 Days") - public String value; + @Schema(example = "30 Days") + public String description; } static final class GetLoansProductsDaysInYearType { private GetLoansProductsDaysInYearType() {} - @ApiModelProperty(example = "360") + @Schema(example = "360") public Integer id; - @ApiModelProperty(example = "DaysInYearType.days360") + @Schema(example = "DaysInYearType.days360") public String code; - @ApiModelProperty(example = "360 Days") - public String value; + @Schema(example = "360 Days") + public String description; } static final class GetLoanProductsInterestRecalculationData { @@ -224,60 +223,60 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsInterestRecalculationCompoundingType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "interestRecalculationCompoundingMethod.fee") + @Schema(example = "interestRecalculationCompoundingMethod.fee") public String code; - @ApiModelProperty(example = "Fee") - public String value; + @Schema(example = "Fee") + public String description; } static final class GetLoanProductsInterestRecalculationCompoundingFrequencyType { private GetLoanProductsInterestRecalculationCompoundingFrequencyType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestRecalculationFrequencyType.same.as.repayment.period") + @Schema(example = "interestRecalculationFrequencyType.same.as.repayment.period") public String code; - @ApiModelProperty(example = "Same as repayment period") - public String value; + @Schema(example = "Same as repayment period") + public String description; } static final class GetLoanProductsRescheduleStrategyType { private GetLoanProductsRescheduleStrategyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "loanRescheduleStrategyMethod.reduce.number.of.installments") + @Schema(example = "loanRescheduleStrategyMethod.reduce.number.of.installments") public String code; - @ApiModelProperty(example = "Reduce number of installments") - public String value; + @Schema(example = "Reduce number of installments") + public String description; } static final class GetLoanProductsPreClosureInterestCalculationStrategy { private GetLoanProductsPreClosureInterestCalculationStrategy() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "loanPreClosureInterestCalculationStrategy.tillPreClosureDate") + @Schema(example = "loanPreClosureInterestCalculationStrategy.tillPreClosureDate") public String code; - @ApiModelProperty(example = "Till preclose Date") - public String value; + @Schema(example = "Till preclose Date") + public String description; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; public GetLoanProductsInterestRecalculationData.GetLoanProductsInterestRecalculationCompoundingType interestRecalculationCompoundingType; public GetLoanProductsInterestRecalculationCompoundingFrequencyType interestRecalculationCompoundingFrequencyType; public GetLoanProductsInterestRecalculationData.GetLoanProductsRescheduleStrategyType rescheduleStrategyType; public GetLoanProductsInterestRecalculationCompoundingFrequencyType recalculationRestFrequencyType; public GetLoanProductsPreClosureInterestCalculationStrategy preClosureInterestCalculationStrategy; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isArrearsBasedOnOriginalSchedule; } @@ -285,75 +284,75 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsAccountingRule() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountingRuleType.cash") + @Schema(example = "accountingRuleType.cash") public String code; - @ApiModelProperty(example = "CASH BASED") - public String value; + @Schema(example = "CASH BASED") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "personal loan product") + @Schema(example = "personal loan product") public String name; - @ApiModelProperty(example = "pe1") + @Schema(example = "pe1") public String shortName; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean includeInBorrowerCycle; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean useBorrowerCycle; - @ApiModelProperty(example = "[2013, 9, 2]") + @Schema(example = "[2013, 9, 2]") public LocalDate startDate; - @ApiModelProperty(example = "[2014, 2, 7]") + @Schema(example = "[2014, 2, 7]") public LocalDate endDate; - @ApiModelProperty(example = "loanProduct.active") + @Schema(example = "loanProduct.active") public String status; public GetLoanProductsCurrency currency; - @ApiModelProperty(example = "10000.000000") + @Schema(example = "10000.000000") public Float principal; - @ApiModelProperty(example = "5000.000000") + @Schema(example = "5000.000000") public Float minPrincipal; - @ApiModelProperty(example = "15000.000000") + @Schema(example = "15000.000000") public Float maxPrincipal; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer numberOfRepayments; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer minNumberOfRepayments; - @ApiModelProperty(example = "15") + @Schema(example = "15") public Integer maxNumberOfRepayments; - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer repaymentEvery; public GetLoanProductsRepaymentFrequencyType repaymentFrequencyType; - @ApiModelProperty(example = "15.000000") + @Schema(example = "15.000000") public Float interestRatePerPeriod; public GetLoanProductsResponse.GetLoanProductsInterestRateFrequencyType interestRateFrequencyType; - @ApiModelProperty(example = "15.000000") + @Schema(example = "15.000000") public Float annualInterestRate; public GetLoanProductsAmortizationType amortizationType; public GetLoanProductsInterestType interestType; public GetLoansProductsInterestCalculationPeriodType interestCalculationPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transactionProcessingStrategyId; - @ApiModelProperty(example = "Mifos style") + @Schema(example = "Mifos style") public String transactionProcessingStrategyName; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List principalVariationsForBorrowerCycle; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List interestRateVariationsForBorrowerCycle; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List numberOfRepaymentVariationsForBorrowerCycle; public GetLoansProductsDaysInMonthType daysInMonthType; public GetLoansProductsDaysInYearType daysInYearType; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isInterestRecalculationEnabled; public GetLoanProductsInterestRecalculationData interestRecalculationData; public GetLoanProductsResponse.GetLoanProductsAccountingRule accountingRule; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer principalThresholdForLastInstalment; } - @ApiModel(value = "GetLoanProductsTemplateResponse") + @Schema(description = "GetLoanProductsTemplateResponse") public static final class GetLoanProductsTemplateResponse { private GetLoanProductsTemplateResponse() {} @@ -362,19 +361,19 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsTemplateCurrency() {} - @ApiModelProperty(example = "") + @Schema(example = "") public String code; - @ApiModelProperty(example = "") + @Schema(example = "") public String name; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer decimalPlaces; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "") + @Schema(example = "") public String displaySymbol; - @ApiModelProperty(example = "") + @Schema(example = "") public String nameCode; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public String displayLabel; } @@ -382,72 +381,72 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsRepaymentTemplateFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "repaymentFrequency.periodFrequencyType.months") + @Schema(example = "repaymentFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetLoanProductsInterestRateTemplateFrequencyType { private GetLoanProductsInterestRateTemplateFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "interestRateFrequency.periodFrequencyType.months") + @Schema(example = "interestRateFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Per month") - public String value; + @Schema(example = "Per month") + public String description; } static final class GetLoanProductsInterestTemplateType { private GetLoanProductsInterestTemplateType() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestType.declining.balance") + @Schema(example = "interestType.declining.balance") public String code; - @ApiModelProperty(example = "Declining Balance") - public String value; + @Schema(example = "Declining Balance") + public String description; } static final class GetLoanProductsAccountingRule { private GetLoanProductsAccountingRule() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountingRuleType.none") + @Schema(example = "accountingRuleType.none") public String code; - @ApiModelProperty(example = "NONE") - public String value; + @Schema(example = "NONE") + public String description; } static final class GetLoansProductsDaysInMonthTemplateType { private GetLoansProductsDaysInMonthTemplateType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "DaysInMonthType.actual") + @Schema(example = "DaysInMonthType.actual") public String code; - @ApiModelProperty(example = "Actual") - public String value; + @Schema(example = "Actual") + public String description; } static final class GetLoanProductsDaysInYearTemplateType { private GetLoanProductsDaysInYearTemplateType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "DaysInYearType.actual") + @Schema(example = "DaysInYearType.actual") public String code; - @ApiModelProperty(example = "Actual") - public String value; + @Schema(example = "Actual") + public String description; } static final class GetLoanProductsInterestRecalculationTemplateData { @@ -458,24 +457,24 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsInterestRecalculationCompoundingType() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestRecalculationCompoundingMethod.none") + @Schema(example = "interestRecalculationCompoundingMethod.none") public String code; - @ApiModelProperty(example = "None") - public String value; + @Schema(example = "None") + public String description; } static final class GetLoanProductsRescheduleStrategyType { private GetLoanProductsRescheduleStrategyType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "loanRescheduleStrategyMethod.reduce.emi.amount") + @Schema(example = "loanRescheduleStrategyMethod.reduce.emi.amount") public String code; - @ApiModelProperty(example = "Reduce EMI amount") - public String value; + @Schema(example = "Reduce EMI amount") + public String description; } public GetLoanProductsInterestRecalculationTemplateData.GetLoanProductsInterestRecalculationCompoundingType interestRecalculationCompoundingType; @@ -487,11 +486,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsPaymentTypeOptions() {} - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer id; - @ApiModelProperty(example = "check") + @Schema(example = "check") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer position; } @@ -499,17 +498,17 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsCurrencyOptions() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -517,11 +516,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsTransactionProcessingStrategyOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "mifos-standard-strategy") + @Schema(example = "mifos-standard-strategy") public String code; - @ApiModelProperty(example = "Penalties, Fees, Interest, Principal order") + @Schema(example = "Penalties, Fees, Interest, Principal order") public String name; } @@ -533,60 +532,60 @@ final class LoanProductsApiResourceSwagger { private GetLoanChargeTimeType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeTimeType.disbursement") + @Schema(example = "chargeTimeType.disbursement") public String code; - @ApiModelProperty(example = "Disbursement") - public String value; + @Schema(example = "Disbursement") + public String description; } static final class GetLoanProductsChargeAppliesTo { private GetLoanProductsChargeAppliesTo() {} - @ApiModelProperty(example = "1 ") + @Schema(example = "1 ") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.loan") + @Schema(example = "chargeAppliesTo.loan") public String code; - @ApiModelProperty(example = "Loan") - public String value; + @Schema(example = "Loan") + public String description; } static final class GetLoanChargeCalculationType { private GetLoanChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetLoansChargePaymentMode { private GetLoansChargePaymentMode() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.regular") + @Schema(example = "chargepaymentmode.regular") public String code; - @ApiModelProperty(example = "Regular") - public String value; + @Schema(example = "Regular") + public String description; } - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer id; - @ApiModelProperty(example = "des charges") + @Schema(example = "des charges") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; public GetLoanProductsCurrencyOptions currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Long amount; public GetLoanChargeTimeType chargeTimeType; public GetLoanProductsChargeAppliesTo chargeAppliesTo; @@ -606,50 +605,50 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsLiabilityType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.liability") + @Schema(example = "accountType.liability") public String code; - @ApiModelProperty(example = "LIABILITY") - public String value; + @Schema(example = "LIABILITY") + public String description; } static final class GetLoanProductsLiabilityUsage { private GetLoanProductsLiabilityUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public String value; + @Schema(example = "DETAIL") + public String description; } static final class GetLoanProductsLiabilityTagId { private GetLoanProductsLiabilityTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; } - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "over payment") + @Schema(example = "over payment") public String name; - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetLoanProductsLiabilityType type; public GetLoanProductsLiabilityUsage usage; - @ApiModelProperty(example = "over payment") + @Schema(example = "over payment") public String nameDecorated; public GetLoanProductsLiabilityTagId tagId; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer organizationRunningBalance; } @@ -657,22 +656,22 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsAssetAccountOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Loan portfolio") + @Schema(example = "Loan portfolio") public String name; - @ApiModelProperty(example = "02") + @Schema(example = "02") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityType type; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityUsage usage; - @ApiModelProperty(example = "Loan portfolio") + @Schema(example = "Loan portfolio") public String nameDecorated; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityTagId tagId; - @ApiModelProperty(example = "60000") + @Schema(example = "60000") public Integer organizationRunningBalance; } @@ -684,30 +683,30 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsExpenseType() {} - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer id; - @ApiModelProperty(example = "accountType.expense") + @Schema(example = "accountType.expense") public String code; - @ApiModelProperty(example = "EXPENSE") - public String value; + @Schema(example = "EXPENSE") + public String description; } - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer id; - @ApiModelProperty(example = "loans written off 2") + @Schema(example = "loans written off 2") public String name; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetLoanProductsExpenseType type; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityUsage usage; - @ApiModelProperty(example = "loans written off 2") + @Schema(example = "loans written off 2") public String nameDecorated; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityTagId tagId; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer organizationRunningBalance; } @@ -719,30 +718,30 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsIncomeType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "accountType.income") + @Schema(example = "accountType.income") public String code; - @ApiModelProperty(example = "INCOME") - public String value; + @Schema(example = "INCOME") + public String description; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "income from interest") + @Schema(example = "income from interest") public String name; - @ApiModelProperty(example = "04") + @Schema(example = "04") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetLoanProductsIncomeType type; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityUsage usage; - @ApiModelProperty(example = "income from interest") + @Schema(example = "income from interest") public String nameDecorated; public GetLoanProductsLiabilityAccountOptions.GetLoanProductsLiabilityTagId tagId; - @ApiModelProperty(example = "19") + @Schema(example = "19") public Integer organizationRunningBalance; } @@ -756,17 +755,17 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsValueConditionTypeOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "mifos-standard-strategyLoanProductValueConditionType.equal") + @Schema(example = "mifos-standard-strategyLoanProductValueConditionType.equal") public String code; - @ApiModelProperty(example = "equals") - public String value; + @Schema(example = "equals") + public String description; } - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean includeInBorrowerCycle; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean useBorrowerCycle; public GetLoanProductsTemplateCurrency currency; public GetLoanProductsRepaymentTemplateFrequencyType repaymentFrequencyType; @@ -774,16 +773,16 @@ final class LoanProductsApiResourceSwagger { public GetLoanProductsResponse.GetLoanProductsAmortizationType amortizationType; public GetLoanProductsInterestTemplateType interestType; public GetLoanProductsResponse.GetLoansProductsInterestCalculationPeriodType interestCalculationPeriodType; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List principalVariationsForBorrowerCycle; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List interestRateVariationsForBorrowerCycle; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List numberOfRepaymentVariationsForBorrowerCycle; public GetLoanProductsTemplateResponse.GetLoanProductsAccountingRule accountingRule; public GetLoansProductsDaysInMonthTemplateType daysInMonthType; public GetLoanProductsDaysInYearTemplateType daysInYearType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isInterestRecalculationEnabled; public GetLoanProductsInterestRecalculationTemplateData interestRecalculationData; public Set paymentTypeOptions; @@ -806,7 +805,7 @@ final class LoanProductsApiResourceSwagger { public Set interestRecalculationFrequencyTypeOptions; } - @ApiModel(value = "GetLoanProductsProductIdResponse") + @Schema(description = "GetLoanProductsProductIdResponse") public static final class GetLoanProductsProductIdResponse { private GetLoanProductsProductIdResponse() {} @@ -815,12 +814,12 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsInterestRateFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "interestRateFrequency.periodFrequencyType.months") + @Schema(example = "interestRateFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Per month") - public String value; + @Schema(example = "Per month") + public String description; } static final class GetLoanProductsPrincipalVariationsForBorrowerCycle { @@ -831,37 +830,37 @@ final class LoanProductsApiResourceSwagger { private GetLoanProductsParamType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "LoanProductParamType.principal") + @Schema(example = "LoanProductParamType.principal") public String code; - @ApiModelProperty(example = "principal") - public String value; + @Schema(example = "principal") + public String description; } static final class GetLoanProductsValueConditionType { private GetLoanProductsValueConditionType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "LoanProductValueConditionType.equal") + @Schema(example = "LoanProductValueConditionType.equal") public String code; - @ApiModelProperty(example = "equals") - public String value; + @Schema(example = "equals") + public String description; } - @ApiModelProperty(example = "21") + @Schema(example = "21") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer borrowerCycleNumber; public GetLoanProductsParamType paramType; public GetLoanProductsValueConditionType valueConditionType; - @ApiModelProperty(example = "2000.000000") + @Schema(example = "2000.000000") public Float minValue; - @ApiModelProperty(example = "20000.000000") + @Schema(example = "20000.000000") public Float maxValue; - @ApiModelProperty(example = "15000.000000") + @Schema(example = "15000.000000") public Float defaultValue; } @@ -873,11 +872,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanFundSourceAccount() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "fund source") + @Schema(example = "fund source") public String name; - @ApiModelProperty(example = "01") + @Schema(example = "01") public Integer glCode; } @@ -885,11 +884,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanPortfolioAccount() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Loan portfolio") + @Schema(example = "Loan portfolio") public String name; - @ApiModelProperty(example = "02") + @Schema(example = "02") public Integer glCode; } @@ -897,11 +896,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanTransfersInSuspenseAccount() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "transfers") + @Schema(example = "transfers") public String name; - @ApiModelProperty(example = "03") + @Schema(example = "03") public Integer glCode; } @@ -909,11 +908,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanInterestOnLoanAccount() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "income from interest") + @Schema(example = "income from interest") public String name; - @ApiModelProperty(example = "04") + @Schema(example = "04") public Integer glCode; } @@ -921,11 +920,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanIncomeFromFeeAccount() {} - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer id; - @ApiModelProperty(example = "income from fees 2") + @Schema(example = "income from fees 2") public String name; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer glCode; } @@ -933,11 +932,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanIncomeFromPenaltyAccount() {} - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer id; - @ApiModelProperty(example = "income from penalities 2") + @Schema(example = "income from penalities 2") public String name; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer glCode; } @@ -945,11 +944,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanWriteOffAccount() {} - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer id; - @ApiModelProperty(example = "loans written off 2") + @Schema(example = "loans written off 2") public String name; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer glCode; } @@ -957,11 +956,11 @@ final class LoanProductsApiResourceSwagger { private GetLoanOverpaymentLiabilityAccount() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "over payment") + @Schema(example = "over payment") public String name; - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer glCode; } @@ -983,9 +982,9 @@ final class LoanProductsApiResourceSwagger { private GetLoanPaymentType() {} - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer id; - @ApiModelProperty(example = "check") + @Schema(example = "check") public String name; } @@ -1001,13 +1000,13 @@ final class LoanProductsApiResourceSwagger { private GetLoanCharge() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "flat install") + @Schema(example = "flat install") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } @@ -1015,77 +1014,77 @@ final class LoanProductsApiResourceSwagger { public GetLoanAccountingMappings.GetLoanIncomeFromFeeAccount incomeAccount; } - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "advanced accounting") + @Schema(example = "advanced accounting") public String name; - @ApiModelProperty(example = "ad11") + @Schema(example = "ad11") public String shortName; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean includeInBorrowerCycle; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean useBorrowerCycle; - @ApiModelProperty(example = "loanProduct.active") + @Schema(example = "loanProduct.active") public String status; public GetLoanProductsResponse.GetLoanProductsCurrency currency; - @ApiModelProperty(example = "10000.000000") + @Schema(example = "10000.000000") public Float principal; - @ApiModelProperty(example = "2000.000000") + @Schema(example = "2000.000000") public Float minPrincipal; - @ApiModelProperty(example = "15000.000000") + @Schema(example = "15000.000000") public Float maxPrincipal; - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer numberOfRepayments; - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer repaymentEvery; public GetLoanProductsResponse.GetLoanProductsRepaymentFrequencyType repaymentFrequencyType; - @ApiModelProperty(example = "5.000000") + @Schema(example = "5.000000") public Float interestRatePerPeriod; public GetLoanProductsProductIdResponse.GetLoanProductsInterestRateFrequencyType interestRateFrequencyType; - @ApiModelProperty(example = "60.000000") + @Schema(example = "60.000000") public Float annualInterestRate; public GetLoanProductsResponse.GetLoanProductsAmortizationType amortizationType; public GetLoanProductsTemplateResponse.GetLoanProductsInterestTemplateType interestType; public GetLoanProductsResponse.GetLoansProductsInterestCalculationPeriodType interestCalculationPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transactionProcessingStrategyId; - @ApiModelProperty(example = "Mifos style") + @Schema(example = "Mifos style") public String transactionProcessingStrategyName; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List charges; public Set productsPrincipalVariationsForBorrowerCycle; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List interestRateVariationsForBorrowerCycle; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List numberOfRepaymentVariationsForBorrowerCycle; public GetLoanProductsResponse.GetLoanProductsAccountingRule accountingRule; public GetLoanAccountingMappings accountingMappings; public Set paymentChannelToFundSourceMappings; public Set feeToIncomeAccountMappings; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean multiDisburseLoan; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer maxTrancheCount; - @ApiModelProperty(example = "36000.000000") + @Schema(example = "36000.000000") public Float outstandingLoanBalance; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer overdueDaysForNPA; - @ApiModelProperty(example = "50") + @Schema(example = "50") public Integer principalThresholdForLastInstalment; } - @ApiModel(value = "PutLoanProductsProductIdRequest") + @Schema(description = "PutLoanProductsProductIdRequest") public static final class PutLoanProductsProductIdRequest { private PutLoanProductsProductIdRequest() {} - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "70,000.00") + @Schema(example = "70,000.00") public Double principal; } - @ApiModel(value = "PutLoanProductsProductIdResponse") + @Schema(description = "PutLoanProductsProductIdResponse") public static final class PutLoanProductsProductIdResponse { private PutLoanProductsProductIdResponse() {} @@ -1094,13 +1093,13 @@ final class LoanProductsApiResourceSwagger { private PutLoanChanges() {} - @ApiModelProperty(example = "70,000.00") + @Schema(example = "70,000.00") public Double principal; - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutLoanChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java index 0ad4f01e9..c40ad3deb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.note.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -61,8 +61,8 @@ import org.springframework.stereotype.Component; @Path("/{resourceType}/{resourceId}/notes") @Component @Scope("singleton") -@Api(tags = { "Notes" }) -@SwaggerDefinition(tags = { @Tag(name = "Notes", description = "Notes API allows to enter notes for supported resources.") }) + +@Tag(name = "Notes", description = "Notes API allows to enter notes for supported resources.") public class NotesApiResource { private final Set NOTE_DATA_PARAMETERS = new HashSet<>( @@ -89,13 +89,13 @@ public class NotesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Resource's Notes", httpMethod = "GET", notes = "Retrieves a Resource's Notes\n\n" + @Operation(summary = "Retrieve a Resource's description", description = "Retrieves a Resource's Notes\n\n" + "Note: Notes are returned in descending createOn order.\n" + "\n" + "Example Requests:\n" + "\n" + "clients/2/notes\n" + "\n" + "\n" + "groups/2/notes?fields=note,createdOn,createdByUsername") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = NotesApiResourceSwagger.GetResourceTypeResourceIdNotesResponse.class) }) - public String retrieveNotesByResource(@PathParam("resourceType") @ApiParam(value = "resourceType") final String resourceType, - @PathParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = NotesApiResourceSwagger.GetResourceTypeResourceIdNotesResponse.class)))) }) + public String retrieveNotesByResource(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, + @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, @Context final UriInfo uriInfo) { final NoteType noteType = NoteType.fromApiUrl(resourceType); @@ -117,15 +117,15 @@ public class NotesApiResource { @Path("{noteId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Resource Note", httpMethod = "GET", notes = "Retrieves a Resource Note\n\n" + "Example Requests:\n" - + "\n" + "clients/1/notes/76\n" + "\n" + "\n" + "groups/1/notes/20\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Resource Note", description = "Retrieves a Resource Note\n\n" + "Example Requests:\n" + "\n" + + "clients/1/notes/76\n" + "\n" + "\n" + "groups/1/notes/20\n" + "\n" + "\n" + "clients/1/notes/76?fields=note,createdOn,createdByUsername\n" + "\n" + "\n" + "groups/1/notes/20?fields=note,createdOn,createdByUsername") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = NotesApiResourceSwagger.GetResourceTypeResourceIdNotesNoteIdResponse.class) }) - public String retrieveNote(@PathParam("resourceType") @ApiParam(value = "resourceType") final String resourceType, - @PathParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, - @PathParam("noteId") @ApiParam(value = "noteId") final Long noteId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.GetResourceTypeResourceIdNotesNoteIdResponse.class))) }) + public String retrieveNote(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, + @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, + @PathParam("noteId") @Parameter(description = "noteId") final Long noteId, @Context final UriInfo uriInfo) { final NoteType noteType = NoteType.fromApiUrl(resourceType); @@ -146,15 +146,14 @@ public class NotesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Add a Resource Note", httpMethod = "POST", notes = "Adds a new note to a supported resource.\n\n" - + "Example Requests:\n" + "\n" + "clients/1/notes\n" + "\n" + "\n" + "groups/1/notes") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = NotesApiResourceSwagger.PostResourceTypeResourceIdNotesRequest.class) }) + @Operation(summary = "Add a Resource Note", description = "Adds a new note to a supported resource.\n\n" + "Example Requests:\n" + "\n" + + "clients/1/notes\n" + "\n" + "\n" + "groups/1/notes") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.PostResourceTypeResourceIdNotesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = NotesApiResourceSwagger.PostResourceTypeResourceIdNotesResponse.class) }) - public String addNewNote(@PathParam("resourceType") @ApiParam(value = "resourceType") final String resourceType, - @PathParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.PostResourceTypeResourceIdNotesResponse.class))) }) + public String addNewNote(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, + @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final NoteType noteType = NoteType.fromApiUrl(resourceType); @@ -175,15 +174,14 @@ public class NotesApiResource { @Path("{noteId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Resource Note", httpMethod = "PUT", notes = "Updates a Resource Note") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = NotesApiResourceSwagger.PutResourceTypeResourceIdNotesNoteIdRequest.class) }) + @Operation(summary = "Update a Resource Note", description = "Updates a Resource Note") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.PutResourceTypeResourceIdNotesNoteIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = NotesApiResourceSwagger.PutResourceTypeResourceIdNotesNoteIdResponse.class) }) - public String updateNote(@PathParam("resourceType") @ApiParam(value = "resourceType") final String resourceType, - @PathParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, - @PathParam("noteId") @ApiParam(value = "noteId") final Long noteId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.PutResourceTypeResourceIdNotesNoteIdResponse.class))) }) + public String updateNote(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, + @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, + @PathParam("noteId") @Parameter(description = "noteId") final Long noteId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final NoteType noteType = NoteType.fromApiUrl(resourceType); @@ -205,12 +203,12 @@ public class NotesApiResource { @Path("{noteId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Resource Note", httpMethod = "DELETE", notes = "Deletes a Resource Note") + @Operation(summary = "Delete a Resource Note", description = "Deletes a Resource Note") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = NotesApiResourceSwagger.DeleteResourceTypeResourceIdNotesNoteIdResponse.class) }) - public String deleteNote(@PathParam("resourceType") @ApiParam(value = "resourceType") final String resourceType, - @PathParam("resourceId") @ApiParam(value = "resourceId") final Long resourceId, - @PathParam("noteId") @ApiParam(value = "noteId") final Long noteId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = NotesApiResourceSwagger.DeleteResourceTypeResourceIdNotesNoteIdResponse.class))) }) + public String deleteNote(@PathParam("resourceType") @Parameter(description = "resourceType") final String resourceType, + @PathParam("resourceId") @Parameter(description = "resourceId") final Long resourceId, + @PathParam("noteId") @Parameter(description = "noteId") final Long noteId) { final NoteType noteType = NoteType.fromApiUrl(resourceType); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResourceSwagger.java index c5f0a22bd..402a92a27 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.note.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.joda.time.DateTime; /** @@ -29,7 +28,7 @@ final class NotesApiResourceSwagger { private NotesApiResourceSwagger() {} - @ApiModel(value = "GetResourceTypeResourceIdNotesResponse") + @Schema(description = "GetResourceTypeResourceIdNotesResponse") public static final class GetResourceTypeResourceIdNotesResponse { private GetResourceTypeResourceIdNotesResponse() {} @@ -38,93 +37,93 @@ final class NotesApiResourceSwagger { private GetNotesNoteType() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "noteType.client") + @Schema(example = "noteType.client") public String code; - @ApiModelProperty(example = "Client note") - public String value; + @Schema(example = "Client note") + public String description; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; public GetNotesNoteType noteType; - @ApiModelProperty(example = "First note edited") + @Schema(example = "First note edited") public String note; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer createdById; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdByUsername; - @ApiModelProperty(example = "1342498505000") + @Schema(example = "1342498505000") public DateTime createdOn; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer updatedById; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String updatedByUsername; - @ApiModelProperty(example = "1342498517000") + @Schema(example = "1342498517000") public DateTime updatedOn; } - @ApiModel(value = "GetResourceTypeResourceIdNotesNoteIdResponse") + @Schema(description = "GetResourceTypeResourceIdNotesNoteIdResponse") public static final class GetResourceTypeResourceIdNotesNoteIdResponse { private GetResourceTypeResourceIdNotesNoteIdResponse() {} - @ApiModelProperty(example = "76") + @Schema(example = "76") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; public GetResourceTypeResourceIdNotesResponse.GetNotesNoteType noteType; - @ApiModelProperty(example = "a note about the client") + @Schema(example = "a note about the client") public String note; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer createdById; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String createdByUsername; - @ApiModelProperty(example = "1359463135000") + @Schema(example = "1359463135000") public DateTime createdOn; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer updatedById; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String updatedByUsername; - @ApiModelProperty(example = "1359463135000") + @Schema(example = "1359463135000") public DateTime updatedOn; } - @ApiModel(value = "PostResourceTypeResourceIdNotesRequest") + @Schema(description = "PostResourceTypeResourceIdNotesRequest") public static final class PostResourceTypeResourceIdNotesRequest { private PostResourceTypeResourceIdNotesRequest() {} - @ApiModelProperty(example = "a note about the client") + @Schema(example = "a note about the client") public String note; } - @ApiModel(value = "PostResourceTypeResourceIdNotesResponse") + @Schema(description = "PostResourceTypeResourceIdNotesResponse") public static final class PostResourceTypeResourceIdNotesResponse { private PostResourceTypeResourceIdNotesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "76") + @Schema(example = "76") public Integer resourceId; } - @ApiModel(value = "PutResourceTypeResourceIdNotesNoteIdRequest") + @Schema(description = "PutResourceTypeResourceIdNotesNoteIdRequest") public static final class PutResourceTypeResourceIdNotesNoteIdRequest { private PutResourceTypeResourceIdNotesNoteIdRequest() {} - @ApiModelProperty(example = "a note about the client") + @Schema(example = "a note about the client") public String note; } - @ApiModel(value = "PutResourceTypeResourceIdNotesNoteIdResponse") + @Schema(description = "PutResourceTypeResourceIdNotesNoteIdResponse") public static final class PutResourceTypeResourceIdNotesNoteIdResponse { private PutResourceTypeResourceIdNotesNoteIdResponse() {} @@ -133,25 +132,25 @@ final class NotesApiResourceSwagger { private PutNotesChanges() {} - @ApiModelProperty(example = "a note about the client") + @Schema(example = "a note about the client") public String note; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "76") + @Schema(example = "76") public Integer resourceId; public PutNotesChanges changes; } - @ApiModel(value = "DeleteResourceTypeResourceIdNotesNoteIdResponse") + @Schema(description = "DeleteResourceTypeResourceIdNotesNoteIdResponse") public static final class DeleteResourceTypeResourceIdNotesNoteIdResponse { private DeleteResourceTypeResourceIdNotesNoteIdResponse() {} - @ApiModelProperty(example = "76") + @Schema(example = "76") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java index c39f17eb6..db90ef806 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.paymenttype.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -55,8 +55,8 @@ import org.springframework.stereotype.Component; @Path("/paymenttypes") @Component -@Api(tags = { "Payment Type" }) -@SwaggerDefinition(tags = { @Tag(name = "Payment Type", description = "This defines the payment type") }) + +@Tag(name = "Payment Type", description = "This defines the payment type") public class PaymentTypeApiResource { private final PlatformSecurityContext securityContext; @@ -86,9 +86,9 @@ public class PaymentTypeApiResource { @GET @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieve all Payment Types", httpMethod = "GET", notes = "Retrieve list of payment types") + @Operation(summary = "Retrieve all Payment Types", description = "Retrieve list of payment types") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = PaymentTypeApiResourceSwagger.GetPaymentTypesResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.GetPaymentTypesResponse.class)))) }) public String getAllPaymentTypes(@Context final UriInfo uriInfo) { this.securityContext.authenticatedUser().validateHasReadPermission(PaymentTypeApiResourceConstants.resourceNameForPermissions); final Collection paymentTypes = this.readPlatformService.retrieveAllPaymentTypes(); @@ -100,10 +100,10 @@ public class PaymentTypeApiResource { @Path("{paymentTypeId}") @Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieve a Payment Type", httpMethod = "GET", notes = "Retrieves a payment type") + @Operation(summary = "Retrieve a Payment Type", description = "Retrieves a payment type") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = PaymentTypeApiResourceSwagger.GetPaymentTypesPaymentTypeIdResponse.class) }) - public String retrieveOnePaymentType(@PathParam("paymentTypeId") @ApiParam(value = "paymentTypeId") final Long paymentTypeId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.GetPaymentTypesPaymentTypeIdResponse.class))) }) + public String retrieveOnePaymentType(@PathParam("paymentTypeId") @Parameter(description = "paymentTypeId") final Long paymentTypeId, @Context final UriInfo uriInfo) { this.securityContext.authenticatedUser().validateHasReadPermission(PaymentTypeApiResourceConstants.resourceNameForPermissions); this.paymentTypeRepositoryWrapper.findOneWithNotFoundDetection(paymentTypeId); @@ -115,12 +115,12 @@ public class PaymentTypeApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Payment Type", httpMethod = "POST", notes = "Creates a new Payment type\n\n" - + "Mandatory Fields: name\n\n" + "Optional Fields: Description, isCashPayment,Position") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = PaymentTypeApiResourceSwagger.PostPaymentTypesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = PaymentTypeApiResourceSwagger.PostPaymentTypesResponse.class) }) - public String createPaymentType(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a Payment Type", description = "Creates a new Payment type\n\n" + "Mandatory Fields: name\n\n" + + "Optional Fields: Description, isCashPayment,Position") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.PostPaymentTypesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.PostPaymentTypesResponse.class))) }) + public String createPaymentType(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createPaymentType().withJson(apiRequestBodyAsJson).build(); @@ -133,13 +133,12 @@ public class PaymentTypeApiResource { @Path("{paymentTypeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Payment Type", httpMethod = "PUT", notes = "Updates a Payment Type") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = PaymentTypeApiResourceSwagger.PutPaymentTypesPaymentTypeIdRequest.class) }) + @Operation(summary = "Update a Payment Type", description = "Updates a Payment Type") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.PutPaymentTypesPaymentTypeIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = PaymentTypeApiResourceSwagger.PutPaymentTypesPaymentTypeIdResponse.class) }) - public String updatePaymentType(@PathParam("paymentTypeId") @ApiParam(value = "paymentTypeId") final Long paymentTypeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.PutPaymentTypesPaymentTypeIdResponse.class))) }) + public String updatePaymentType(@PathParam("paymentTypeId") @Parameter(description = "paymentTypeId") final Long paymentTypeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updatePaymentType(paymentTypeId).withJson(apiRequestBodyAsJson) .build(); @@ -153,10 +152,10 @@ public class PaymentTypeApiResource { @Path("{paymentTypeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Payment Type", httpMethod = "DELETE", notes = "Deletes payment type") + @Operation(summary = "Delete a Payment Type", description = "Deletes payment type") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = PaymentTypeApiResourceSwagger.DeletePaymentTypesPaymentTypeIdResponse.class) }) - public String deleteCode(@PathParam("paymentTypeId") @ApiParam(value = "paymentTypeId") final Long paymentTypeId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PaymentTypeApiResourceSwagger.DeletePaymentTypesPaymentTypeIdResponse.class))) }) + public String deleteCode(@PathParam("paymentTypeId") @Parameter(description = "paymentTypeId") final Long paymentTypeId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deletePaymentType(paymentTypeId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResourceSwagger.java index 48ee1e7a3..ead8bd51d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.paymenttype.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by Chirag Gupta on 01/01/18. @@ -28,94 +27,94 @@ final class PaymentTypeApiResourceSwagger { private PaymentTypeApiResourceSwagger() {} - @ApiModel(value = "GetPaymentTypesResponse") + @Schema(description = "GetPaymentTypesResponse") public static final class GetPaymentTypesResponse { private GetPaymentTypesResponse() {} - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer id; - @ApiModelProperty(example = "PTC") + @Schema(example = "PTC") public String name; - @ApiModelProperty(example = "Cash") + @Schema(example = "Cash") public String description; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isCashPayment; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } - @ApiModel(value = "GetPaymentTypesPaymentTypeIdResponse") + @Schema(description = "GetPaymentTypesPaymentTypeIdResponse") public static final class GetPaymentTypesPaymentTypeIdResponse { private GetPaymentTypesPaymentTypeIdResponse() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; - @ApiModelProperty(example = "cash") + @Schema(example = "cash") public String name; - @ApiModelProperty(example = "cash Payment") + @Schema(example = "cash Payment") public String description; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isCashPayment; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer position; } - @ApiModel(value = "PostPaymentTypesRequest") + @Schema(description = "PostPaymentTypesRequest") public static final class PostPaymentTypesRequest { private PostPaymentTypesRequest() {} - @ApiModelProperty(example = "cash") + @Schema(example = "cash") public String name; - @ApiModelProperty(example = "cash payment type") + @Schema(example = "cash payment type") public String description; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isCashPayment; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer position; } - @ApiModel(value = "PostPaymentTypesResponse") + @Schema(description = "PostPaymentTypesResponse") public static final class PostPaymentTypesResponse { private PostPaymentTypesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutPaymentTypesPaymentTypeIdRequest") + @Schema(description = "PutPaymentTypesPaymentTypeIdRequest") public static final class PutPaymentTypesPaymentTypeIdRequest { private PutPaymentTypesPaymentTypeIdRequest() {} - @ApiModelProperty(example = "mPay") + @Schema(example = "mPay") public String name; - @ApiModelProperty(example = "not a cash payment type") + @Schema(example = "not a cash payment type") public String description; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isCashPayment; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer position; } - @ApiModel(value = "PutPaymentTypesPaymentTypeIdResponse") + @Schema(description = "PutPaymentTypesPaymentTypeIdResponse") public static final class PutPaymentTypesPaymentTypeIdResponse { private PutPaymentTypesPaymentTypeIdResponse() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer resourceId; } - @ApiModel(value = "DeletePaymentTypesPaymentTypeIdResponse") + @Schema(description = "DeletePaymentTypesPaymentTypeIdResponse") public static final class DeletePaymentTypesPaymentTypeIdResponse { private DeletePaymentTypesPaymentTypeIdResponse() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java index 59bf373cc..64ec8fb52 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.portfolio.products.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -58,7 +58,7 @@ import org.springframework.stereotype.Component; @Path("/products/{type}") @Component @Scope("singleton") -@Api(value = "Products", description = "") + public class ProductsApiResource { private final ApplicationContext applicationContext; @@ -82,7 +82,8 @@ public class ProductsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String retrieveTemplate(@PathParam("type") @ApiParam(value = "type") final String productType, @Context final UriInfo uriInfo) { + public String retrieveTemplate(@PathParam("type") @Parameter(description = "type") final String productType, + @Context final UriInfo uriInfo) { String serviceName = productType + ProductsApiConstants.READPLATFORM_NAME; try { ProductReadPlatformService service = (ProductReadPlatformService) this.applicationContext.getBean(serviceName); @@ -98,12 +99,12 @@ public class ProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Share Product", httpMethod = "GET", notes = "Retrieves a Share Product\n\n" + "Example Requests:\n" - + "\n" + "products/share/1\n" + "\n" + "\n" + "products/share/1?template=true") + @Operation(summary = "Retrieve a Share Product", description = "Retrieves a Share Product\n\n" + "Example Requests:\n" + "\n" + + "products/share/1\n" + "\n" + "\n" + "products/share/1?template=true") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ProductsApiResourceSwagger.GetProductsTypeProductIdResponse.class) }) - public String retrieveProduct(@PathParam("productId") @ApiParam(value = "productId") final Long productId, - @PathParam("type") @ApiParam(value = "type") final String productType, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.GetProductsTypeProductIdResponse.class))) }) + public String retrieveProduct(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @PathParam("type") @Parameter(description = "type") final String productType, @Context final UriInfo uriInfo) { try { String serviceName = productType + ProductsApiConstants.READPLATFORM_NAME; ProductReadPlatformService service = (ProductReadPlatformService) this.applicationContext.getBean(serviceName); @@ -118,12 +119,13 @@ public class ProductsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Share Products", httpMethod = "GET", notes = "Lists Share Products\n\n" - + "Mandatory Fields: limit, offset\n\n" + "Example Requests:\n" + "\n" + "shareproducts") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ProductsApiResourceSwagger.GetProductsTypeResponse.class) }) - public String retrieveAllProducts(@PathParam("type") @ApiParam(value = "type") final String productType, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, @Context final UriInfo uriInfo) { + @Operation(summary = "List Share Products", description = "Lists Share Products\n\n" + "Mandatory Fields: limit, offset\n\n" + + "Example Requests:\n" + "\n" + "shareproducts") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.GetProductsTypeResponse.class))) }) + public String retrieveAllProducts(@PathParam("type") @Parameter(description = "type") final String productType, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, @Context final UriInfo uriInfo) { try { String serviceName = productType + ProductsApiConstants.READPLATFORM_NAME; ProductReadPlatformService service = (ProductReadPlatformService) this.applicationContext.getBean(serviceName); @@ -138,15 +140,15 @@ public class ProductsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Share Product", httpMethod = "POST", notes = "Creates a Share Product\n\n" + @Operation(summary = "Create a Share Product", description = "Creates a Share Product\n\n" + "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, locale, totalShares, unitPrice, nominalShares,allowDividendCalculationForInactiveClients,accountingRule\n\n" + "Mandatory Fields for Cash based accounting (accountingRule = 2): shareReferenceId, shareSuspenseId, shareEquityId, incomeFromFeeAccountId\n\n" + "Optional Fields: sharesIssued, minimumShares, maximumShares, minimumActivePeriodForDividends, minimumactiveperiodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType, marketPricePeriods, chargesSelected") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ProductsApiResourceSwagger.PostProductsTypeRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ProductsApiResourceSwagger.PostProductsTypeResponse.class) }) - public String createProduct(@PathParam("type") @ApiParam(value = "type") final String productType, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.PostProductsTypeRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.PostProductsTypeResponse.class))) }) + public String createProduct(@PathParam("type") @Parameter(description = "type") final String productType, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = null; this.platformSecurityContext.authenticatedUser(); commandWrapper = new CommandWrapperBuilder().createProduct(productType).withJson(apiRequestBodyAsJson).build(); @@ -158,10 +160,10 @@ public class ProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String handleCommands(@PathParam("type") @ApiParam(value = "type") final String productType, - @PathParam("productId") @ApiParam(value = "productId") final Long productId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @SuppressWarnings("unused") @Context final UriInfo uriInfo, @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + public String handleCommands(@PathParam("type") @Parameter(description = "type") final String productType, + @PathParam("productId") @Parameter(description = "productId") final Long productId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @SuppressWarnings("unused") @Context final UriInfo uriInfo, @Parameter(hidden = true) final String apiRequestBodyAsJson) { CommandWrapper commandWrapper = new CommandWrapperBuilder().createProductCommand(productType, commandParam, productId) .withJson(apiRequestBodyAsJson).build(); final CommandProcessingResult commandProcessingResult = this.commandsSourceWritePlatformService.logCommandSource(commandWrapper); @@ -172,14 +174,13 @@ public class ProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Share Product", httpMethod = "PUT", notes = "Updates a Share Product") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = ProductsApiResourceSwagger.PutProductsTypeProductIdRequest.class) }) + @Operation(summary = "Update a Share Product", description = "Updates a Share Product") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.PutProductsTypeProductIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ProductsApiResourceSwagger.PutProductsTypeProductIdResponse.class) }) - public String updateProduct(@PathParam("type") @ApiParam(value = "type") final String productType, - @PathParam("productId") @ApiParam(value = "productId") final Long productId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.PutProductsTypeProductIdResponse.class))) }) + public String updateProduct(@PathParam("type") @Parameter(description = "type") final String productType, + @PathParam("productId") @Parameter(description = "productId") final Long productId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { this.platformSecurityContext.authenticatedUser(); final CommandWrapper commandRequest = new CommandWrapperBuilder().updateProduct(productType, productId) .withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResourceSwagger.java index 82ed03450..22f7d490b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.products.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class ProductsApiResourceSwagger { private ProductsApiResourceSwagger() {} - @ApiModel(value = "GetProductsTypeProductIdResponse") + @Schema(description = "GetProductsTypeProductIdResponse") public static final class GetProductsTypeProductIdResponse { private GetProductsTypeProductIdResponse() {} @@ -38,19 +37,19 @@ final class ProductsApiResourceSwagger { private GetProductsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -58,11 +57,11 @@ final class ProductsApiResourceSwagger { private GetProductsMarketPrice() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "Feb 1, 2016") + @Schema(example = "Feb 1, 2016") public String fromDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer shareValue; } @@ -74,17 +73,17 @@ final class ProductsApiResourceSwagger { private GetChargesCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -92,60 +91,60 @@ final class ProductsApiResourceSwagger { private GetChargeTimeType() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; - @ApiModelProperty(example = "chargeTimeType.activation") + @Schema(example = "chargeTimeType.activation") public String code; - @ApiModelProperty(example = "Share Account Activate") - public String value; + @Schema(example = "Share Account Activate") + public String description; } static final class GetChargeAppliesTo { private GetChargeAppliesTo() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.shares") + @Schema(example = "chargeAppliesTo.shares") public String code; - @ApiModelProperty(example = "Shares") - public String value; + @Schema(example = "Shares") + public String description; } static final class GetChargeCalculationType { private GetChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetChargePaymentMode { private GetChargePaymentMode() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.regular") + @Schema(example = "chargepaymentmode.regular") public String code; - @ApiModelProperty(example = "Regular") - public String value; + @Schema(example = "Regular") + public String description; } - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer id; - @ApiModelProperty(example = "Share Account Activation Flat") + @Schema(example = "Share Account Activation Flat") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; public GetChargesCurrency currency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amount; public GetChargeTimeType chargeTimeType; public GetChargeAppliesTo chargeAppliesTo; @@ -157,22 +156,22 @@ final class ProductsApiResourceSwagger { private GetLockPeriodTypeEnum() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetProductsAccountingRule { private GetProductsAccountingRule() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountingRuleType.cash") + @Schema(example = "accountingRuleType.cash") public String code; - @ApiModelProperty(example = "CASH BASED") - public String value; + @Schema(example = "CASH BASED") + public String description; } static final class GetProductsAccountingMappings { @@ -183,11 +182,11 @@ final class ProductsApiResourceSwagger { private GetShareReferenceId() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String name; - @ApiModelProperty(example = "ASSET_ED1461237837829") + @Schema(example = "ASSET_ED1461237837829") public String glCode; } @@ -195,11 +194,11 @@ final class ProductsApiResourceSwagger { private GetIncomeFromFeeAccountId() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String name; - @ApiModelProperty(example = "INCOME_OY1461237869836") + @Schema(example = "INCOME_OY1461237869836") public String glCode; } @@ -207,11 +206,11 @@ final class ProductsApiResourceSwagger { private GetShareEquityId() {} - @ApiModelProperty(example = "66") + @Schema(example = "66") public Integer id; - @ApiModelProperty(example = "Equity Account") + @Schema(example = "Equity Account") public String name; - @ApiModelProperty(example = "EQUITY1") + @Schema(example = "EQUITY1") public String glCode; } @@ -219,11 +218,11 @@ final class ProductsApiResourceSwagger { private GetShareSuspenseId() {} - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String name; - @ApiModelProperty(example = "LIABILITY_MA1461237860198") + @Schema(example = "LIABILITY_MA1461237860198") public String glCode; } @@ -237,12 +236,12 @@ final class ProductsApiResourceSwagger { private GetProductsMinimumActivePeriodFrequencyTypeOptions() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "savings.lockin.sharePeriodFrequencyType.days") + @Schema(example = "savings.lockin.sharePeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetProductsAccountingMappingOptions { @@ -257,51 +256,51 @@ final class ProductsApiResourceSwagger { private GetProductsLiabilityType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.liability") + @Schema(example = "accountType.liability") public String code; - @ApiModelProperty(example = "LIABILITY") - public String value; + @Schema(example = "LIABILITY") + public String description; } static final class GetProductsLiabilityUsage { private GetProductsLiabilityUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public String value; + @Schema(example = "DETAIL") + public String description; } static final class GetProductsTagId { private GetProductsTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isActive; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String name; - @ApiModelProperty(example = "LIABILITY_2T1461237838897") + @Schema(example = "LIABILITY_2T1461237838897") public String glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetProductsLiabilityType type; public GetProductsLiabilityUsage usage; - @ApiModelProperty(example = "DEFAULT_DESCRIPTION") + @Schema(example = "DEFAULT_DESCRIPTION") public String description; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String nameDecorated; public GetProductsTagId tagId; } @@ -314,29 +313,29 @@ final class ProductsApiResourceSwagger { private GetAssetType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountType.asset") + @Schema(example = "accountType.asset") public String code; - @ApiModelProperty(example = "ASSET") - public String value; + @Schema(example = "ASSET") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String name; - @ApiModelProperty(example = "ASSET_ED1461237837829") + @Schema(example = "ASSET_ED1461237837829") public String glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetAssetType type; public GetProductsLiabilityAccountOptions.GetProductsLiabilityUsage usage; - @ApiModelProperty(example = "DEFAULT_DESCRIPTION") + @Schema(example = "DEFAULT_DESCRIPTION") public String description; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String nameDecorated; public GetProductsLiabilityAccountOptions.GetProductsTagId tagId; } @@ -349,29 +348,29 @@ final class ProductsApiResourceSwagger { private GetIncomeType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountType.income") + @Schema(example = "accountType.income") public String code; - @ApiModelProperty(example = "INCOME") - public String value; + @Schema(example = "INCOME") + public String description; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String name; - @ApiModelProperty(example = "INCOME_9O1461237838422") + @Schema(example = "INCOME_9O1461237838422") public String glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetIncomeType type; public GetProductsLiabilityAccountOptions.GetProductsLiabilityUsage usage; - @ApiModelProperty(example = "DEFAULT_DESCRIPTION") + @Schema(example = "DEFAULT_DESCRIPTION") public String description; - @ApiModelProperty(example = "ACCOUNT_NAME_1FJBQ") + @Schema(example = "ACCOUNT_NAME_1FJBQ") public String nameDecorated; public GetProductsLiabilityAccountOptions.GetProductsTagId tagId; } @@ -384,27 +383,27 @@ final class ProductsApiResourceSwagger { private GetEquityType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "accountType.equity") + @Schema(example = "accountType.equity") public String code; - @ApiModelProperty(example = "EQUITY") - public String value; + @Schema(example = "EQUITY") + public String description; } - @ApiModelProperty(example = "66") + @Schema(example = "66") public Integer id; - @ApiModelProperty(example = "Equity Account") + @Schema(example = "Equity Account") public String name; - @ApiModelProperty(example = "EQUITY1") + @Schema(example = "EQUITY1") public String glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetEquityType type; public GetProductsLiabilityAccountOptions.GetProductsLiabilityUsage usage; - @ApiModelProperty(example = "Equity Account") + @Schema(example = "Equity Account") public String nameDecorated; public GetProductsLiabilityAccountOptions.GetProductsTagId tagId; } @@ -415,37 +414,37 @@ final class ProductsApiResourceSwagger { public Set equityAccountOptions; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Share Product") + @Schema(example = "Share Product") public String name; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String shortName; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String description; public GetProductsCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer totalShares; - @ApiModelProperty(example = "50") + @Schema(example = "50") public Integer totalSharesIssued; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer unitPrice; - @ApiModelProperty(example = "50") + @Schema(example = "50") public Integer shareCapital; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minimumShares; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer nominalShares; - @ApiModelProperty(example = "50") + @Schema(example = "50") public Integer maximumShares; public Set marketPrice; public Set charges; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean allowDividendCalculationForInactiveClients; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer lockinPeriod; public GetLockPeriodTypeEnum lockPeriodTypeEnum; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minimumActivePeriod; public GetLockPeriodTypeEnum minimumActivePeriodForDividendsTypeEnum; public GetProductsAccountingRule accountingRule; @@ -457,7 +456,7 @@ final class ProductsApiResourceSwagger { public GetProductsAccountingMappingOptions accountingMappingOptions; } - @ApiModel(value = "GetProductsTypeResponse") + @Schema(description = "GetProductsTypeResponse") public static final class GetProductsTypeResponse { private GetProductsTypeResponse() {} @@ -466,22 +465,22 @@ final class ProductsApiResourceSwagger { private GetProductsPageItems() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Share Product") + @Schema(example = "Share Product") public String name; - @ApiModelProperty(example = "Share Product Description") + @Schema(example = "Share Product Description") public String shortName; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer totalShares; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "PostProductsTypeRequest") + @Schema(description = "PostProductsTypeRequest") public static final class PostProductsTypeRequest { private PostProductsTypeRequest() {} @@ -490,13 +489,13 @@ final class ProductsApiResourceSwagger { private PostProductsMarketPricePeriods() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "04 May 2016") + @Schema(example = "04 May 2016") public String fromDate; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer shareValue; } @@ -504,75 +503,75 @@ final class ProductsApiResourceSwagger { private PostProductsChargesSelected() {} - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer id; } - @ApiModelProperty(example = "Share Product") + @Schema(example = "Share Product") public String name; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String shortName; - @ApiModelProperty(example = "Description") + @Schema(example = "Description") public String description; - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer digitsAfterDecimal; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer inMultiplesOf; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer totalShares; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer sharesIssued; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer unitPrice; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer minimumShares; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer nominalShares; - @ApiModelProperty(example = "30") + @Schema(example = "30") public Integer maximumShares; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minimumActivePeriodForDividends; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer minimumactiveperiodFrequencyType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer lockinPeriodFrequency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer lockinPeriodFrequencyType; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean allowDividendCalculationForInactiveClients; public Set marketPricePeriods; public Set chargesSelected; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountingRule; } - @ApiModel(value = "PostProductsTypeResponse") + @Schema(description = "PostProductsTypeResponse") public static final class PostProductsTypeResponse { private PostProductsTypeResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutProductsTypeProductIdRequest") + @Schema(description = "PutProductsTypeProductIdRequest") public static final class PutProductsTypeProductIdRequest { private PutProductsTypeProductIdRequest() {} - @ApiModelProperty(example = "Share Product Description.") + @Schema(example = "Share Product Description.") public String description; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "5.0") + @Schema(example = "5.0") public Double unitPrice; } - @ApiModel(value = "PutProductsTypeProductIdResponse") + @Schema(description = "PutProductsTypeProductIdResponse") public static final class PutProductsTypeProductIdResponse { private PutProductsTypeProductIdResponse() {} @@ -581,15 +580,15 @@ final class ProductsApiResourceSwagger { private PutProductsChanges() {} - @ApiModelProperty(example = "Share Product Description.") + @Schema(example = "Share Product Description.") public String description; - @ApiModelProperty(example = "5.0") + @Schema(example = "5.0") public Double unitPrice; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutProductsChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResource.java index e5f34b25b..94df33711 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResource.java @@ -21,15 +21,15 @@ package org.apache.fineract.portfolio.savings.api; import com.google.gson.JsonElement; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.math.BigDecimal; import java.util.Arrays; @@ -88,9 +88,7 @@ import org.springframework.util.CollectionUtils; @Path("/fixeddepositaccounts") @Component @Scope("singleton") -@Api(tags = { "Fixed Deposit Account" }) -@SwaggerDefinition(tags = { - @Tag(name = "Fixed Deposit Account", description = "Fixed Deposit accounts are instances of a praticular fixed deposit product created. An application process around the creation of accounts is also supported.") }) +@Tag(name = "Fixed Deposit Account", description = "Fixed Deposit accounts are instances of a praticular fixed deposit product created. An application process around the creation of accounts is also supported.") public class FixedDepositAccountsApiResource { private final DepositAccountReadPlatformService depositAccountReadPlatformService; @@ -132,15 +130,15 @@ public class FixedDepositAccountsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Fixed Deposit Account Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for fixed deposit applications. The template data returned consists of any or all of:\n\n" + @Operation(summary = "Retrieve Fixed Deposit Account Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for fixed deposit applications. The template data returned consists of any or all of:\n\n" + "\n\n" + "Field Defaults\n\n" + "Allowed Value Lists" + "Example Requests:\n\n" + "\n\n" + "fixeddepositaccounts/template?clientId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.GetFixedDepositAccountsTemplateResponse.class) }) - public String template(@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.GetFixedDepositAccountsTemplateResponse.class))) }) + public String template(@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("groupId") @Parameter(description = "groupId") final Long groupId, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_ACCOUNT_RESOURCE_NAME); @@ -155,15 +153,15 @@ public class FixedDepositAccountsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Fixed deposit applications/accounts", httpMethod = "GET", notes = "Lists Fixed Deposit Accounts\n\n" + @Operation(summary = "List Fixed deposit applications/accounts", description = "Lists Fixed Deposit Accounts\n\n" + "Example Requests:\n\n" + "\n\n" + "fixeddepositaccounts\n\n" + "\n\n" + "fixeddepositaccounts?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.GetFixedDepositAccountsResponse.class, responseContainer = "List") }) - public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("paged") @ApiParam(value = "paged") final Boolean paged, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.GetFixedDepositAccountsResponse.class)))) }) + public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("paged") @Parameter(description = "paged") final Boolean paged, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_ACCOUNT_RESOURCE_NAME); final PaginationParameters paginationParameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder); @@ -185,14 +183,13 @@ public class FixedDepositAccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Submit new fixed deposit application", httpMethod = "POST", notes = "Submits a new fixed deposit application" + @Operation(summary = "Submit new fixed deposit application", description = "Submits a new fixed deposit application" + "Mandatory Fields: clientId or groupId, productId, submittedOnDate, depositAmount, depositPeriod, depositPeriodFrequencyId\n\n" + "Optional Fields: accountNo, externalId, fieldOfficerId,linkAccountId(if provided initial deposit amount will be collected from this account),transferInterestToSavings(By enabling this flag all interest postings will be transferred to linked saving account )") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsResponse.class) }) - public String submitApplication(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsResponse.class))) }) + public String submitApplication(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createFixedDepositAccount().withJson(apiRequestBodyAsJson) .build(); @@ -206,13 +203,13 @@ public class FixedDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a fixed deposit application/account", httpMethod = "GET", notes = "Retrieves a fixed deposit application/account\n\n" + @Operation(summary = "Retrieve a fixed deposit application/account", description = "Retrieves a fixed deposit application/account\n\n" + "Example Requests :\n\n" + "\n\n" + "fixeddepositaccounts/1" + "\n\n" + "fixeddepositaccounts/1?associations=all") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.GetFixedDepositAccountsAccountIdResponse.class) }) - public String retrieveOne(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, - @DefaultValue("all") @QueryParam("chargeStatus") @ApiParam(value = "chargeStatus") final String chargeStatus, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.GetFixedDepositAccountsAccountIdResponse.class))) }) + public String retrieveOne(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @DefaultValue("all") @QueryParam("chargeStatus") @Parameter(description = "chargeStatus") final String chargeStatus, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_ACCOUNT_RESOURCE_NAME); @@ -309,13 +306,12 @@ public class FixedDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Modify a fixed deposit application", httpMethod = "PUT", notes = "Fixed deposit application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FixedDepositAccountsApiResourceSwagger.PutFixedDepositAccountsAccountIdRequest.class) }) + @Operation(summary = "Modify a fixed deposit application", description = "Fixed deposit application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PutFixedDepositAccountsAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.PutFixedDepositAccountsAccountIdResponse.class) }) - public String update(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PutFixedDepositAccountsAccountIdResponse.class))) }) + public String update(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateFixedDepositAccount(accountId) .withJson(apiRequestBodyAsJson).build(); @@ -329,7 +325,7 @@ public class FixedDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve fixed deposit application | Undo approval fixed deposit application | Reject fixed deposit application | Withdraw fixed deposit application | Activate a fixed deposit account | Close a fixed deposit account | Premature Close a fixed deposit account | Calculate Premature amount on Fixed deposit account | Calculate Interest on Fixed Deposit Account | Post Interest on Fixed Deposit Account", httpMethod = "POST", notes = "Approve fixed deposit application:\n\n" + @Operation(summary = "Approve fixed deposit application | Undo approval fixed deposit application | Reject fixed deposit application | Withdraw fixed deposit application | Activate a fixed deposit account | Close a fixed deposit account | Premature Close a fixed deposit account | Calculate Premature amount on Fixed deposit account | Calculate Interest on Fixed Deposit Account | Post Interest on Fixed Deposit Account", description = "Approve fixed deposit application:\n\n" + "Approves fixed deposit application so long as its in 'Submitted and pending approval' state.\n\n" + "Undo approval fixed deposit application:\n\n" + "Will move 'approved' fixed deposit application back to 'Submitted and pending approval' state.\n\n" @@ -348,13 +344,12 @@ public class FixedDepositAccountsApiResource { + "Post Interest on Fixed Deposit Account:\n\n" + "Calculates and Posts interest earned on a fixed deposit account based on today's date and whether an interest posting or crediting event is due.\n\n" + "Showing request/response for Calculate Interest on Fixed Deposit Account") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsAccountIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsAccountIdResponse.class) }) - public String handleCommands(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsAccountIdResponse.class))) }) + public String handleCommands(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String jsonApiRequest = apiRequestBodyAsJson; if (StringUtils.isBlank(jsonApiRequest)) { @@ -418,10 +413,10 @@ public class FixedDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a fixed deposit application", httpMethod = "DELETE", notes = "At present we support hard delete of fixed deposit application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the fixed deposit account.") + @Operation(summary = "Delete a fixed deposit application", description = "At present we support hard delete of fixed deposit application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the fixed deposit account.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositAccountsApiResourceSwagger.DeleteFixedDepositAccountsAccountIdResponse.class) }) - public String delete(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.DeleteFixedDepositAccountsAccountIdResponse.class))) }) + public String delete(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteFixedDepositAccount(accountId).build(); @@ -434,8 +429,8 @@ public class FixedDepositAccountsApiResource { @Path("{accountId}/template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String accountClosureTemplate(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo) { + public String accountClosureTemplate(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_ACCOUNT_RESOURCE_NAME); DepositAccountData account = null; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResourceSwagger.java index 7dcd311d5..cd3547582 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class FixedDepositAccountsApiResourceSwagger { private FixedDepositAccountsApiResourceSwagger() {} - @ApiModel(value = "GetFixedDepositAccountsTemplateResponse") + @Schema(description = "GetFixedDepositAccountsTemplateResponse") public static final class GetFixedDepositAccountsTemplateResponse { private GetFixedDepositAccountsTemplateResponse() {} @@ -39,20 +38,20 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsProductOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "small business") + @Schema(example = "small business") public String clientName; public Set productOptions; } - @ApiModel(value = "GetFixedDepositAccountsResponse") + @Schema(description = "GetFixedDepositAccountsResponse") public static final class GetFixedDepositAccountsResponse { private GetFixedDepositAccountsResponse() {} @@ -61,29 +60,29 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean prematureClosed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean transferInProgress; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean transferOnHold; } @@ -91,13 +90,13 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsTimeline() {} - @ApiModelProperty(example = "[2014, 3, 1]") + @Schema(example = "[2014, 3, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; } @@ -105,19 +104,19 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -125,48 +124,48 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetFixedDepositAccountsInterestPostingPeriodType { private GetFixedDepositAccountsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetFixedDepositAccountsInterestCalculationType { private GetFixedDepositAccountsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetFixedDepositAccountsInterestCalculationDaysInYearType { private GetFixedDepositAccountsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetFixedDepositAccountsSummary { @@ -174,7 +173,7 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsSummary() {} public GetFixedDepositAccountsCurrency currency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float accountBalance; } @@ -182,51 +181,51 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsMinDepositTermType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.months") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetFixedDepositAccountsMaxDepositTermType { private GetFixedDepositAccountsMaxDepositTermType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.years") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.years") public String code; - @ApiModelProperty(example = "Years") - public String value; + @Schema(example = "Years") + public String description; } static final class GetFixedDepositAccountsDepositPeriodFrequency { private GetFixedDepositAccountsDepositPeriodFrequency() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "deposit.period.savingsPeriodFrequencyType.months") + @Schema(example = "deposit.period.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Sangamesh N") + @Schema(example = "Sangamesh N") public String clientName; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer savingsProductId; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetFixedDepositAccountsStatus status; public GetFixedDepositAccountsTimeline timeline; @@ -236,66 +235,66 @@ final class FixedDepositAccountsApiResourceSwagger { public GetFixedDepositAccountsInterestCalculationType interestCalculationType; public GetFixedDepositAccountsInterestCalculationDaysInYearType interestCalculationDaysInYearType; public GetFixedDepositAccountsSummary summary; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean interestFreePeriodApplicable; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer minDepositTerm; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer maxDepositTerm; public GetFixedDepositAccountsMinDepositTermType minDepositTermType; public GetFixedDepositAccountsMaxDepositTermType maxDepositTermType; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Float depositAmount; - @ApiModelProperty(example = "5140.25") + @Schema(example = "5140.25") public Float maturityAmount; - @ApiModelProperty(example = "[2014, 9, 1]") + @Schema(example = "[2014, 9, 1]") public LocalDate maturityDate; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer depositPeriod; public GetFixedDepositAccountsDepositPeriodFrequency depositPeriodFrequency; } - @ApiModel(value = "PostFixedDepositAccountsRequest") + @Schema(description = "PostFixedDepositAccountsRequest") public static final class PostFixedDepositAccountsRequest { private PostFixedDepositAccountsRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 March 2014") + @Schema(example = "01 March 2014") public String submittedOnDate; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Float depositAmount; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer depositPeriod; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer depositPeriodFrequencyId; } - @ApiModel(value = "PostFixedDepositAccountsResponse") + @Schema(description = "PostFixedDepositAccountsResponse") public static final class PostFixedDepositAccountsResponse { private PostFixedDepositAccountsResponse() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetFixedDepositAccountsAccountIdResponse") + @Schema(description = "GetFixedDepositAccountsAccountIdResponse") public static final class GetFixedDepositAccountsAccountIdResponse { private GetFixedDepositAccountsAccountIdResponse() {} @@ -312,40 +311,40 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsPeriodType() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.days") + @Schema(example = "interestChartPeriodType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetFixedDepositAccountsAccountChartCurrency { private GetFixedDepositAccountsAccountChartCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; public GetFixedDepositAccountsPeriodType periodType; - @ApiModelProperty(example = "181") + @Schema(example = "181") public Integer fromPeriod; - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer toPeriod; - @ApiModelProperty(example = "5.5") + @Schema(example = "5.5") public Double annualInterestRate; public GetFixedDepositAccountsAccountChartCurrency currency; } @@ -354,21 +353,21 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsPeriodTypes() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.days") + @Schema(example = "interestChartPeriodType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "[2013, 10, 2]") + @Schema(example = "[2013, 10, 2]") public LocalDate fromDate; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer accountId; - @ApiModelProperty(example = "FD000023") + @Schema(example = "FD000023") public Long accountNumber; public Set chartSlabs; public Set periodTypes; @@ -378,19 +377,19 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsAccountIdCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -399,25 +398,25 @@ final class FixedDepositAccountsApiResourceSwagger { private GetFixedDepositAccountsAccountIdSummary() {} public GetFixedDepositAccountsAccountIdCurrency currency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float accountBalance; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "FD000023") + @Schema(example = "FD000023") public Long accountNo; - @ApiModelProperty(example = "FD-23") + @Schema(example = "FD-23") public String externalId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Sangamesh N") + @Schema(example = "Sangamesh N") public String clientName; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer savingsProductId; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsStatus status; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsTimeline timeline; @@ -426,41 +425,41 @@ final class FixedDepositAccountsApiResourceSwagger { public GetFixedDepositAccountsResponse.GetFixedDepositAccountsInterestPostingPeriodType interestPostingPeriodType; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsInterestCalculationType interestCalculationType; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsInterestCalculationDaysInYearType interestCalculationDaysInYearType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean interestFreePeriodApplicable; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer minDepositTerm; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer maxDepositTerm; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsMinDepositTermType minDepositTermType; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsMaxDepositTermType maxDepositTermType; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Float depositAmount; - @ApiModelProperty(example = "5140.25") + @Schema(example = "5140.25") public Float maturityAmount; - @ApiModelProperty(example = "[2014, 9, 1]") + @Schema(example = "[2014, 9, 1]") public LocalDate maturityDate; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer depositPeriod; public GetFixedDepositAccountsResponse.GetFixedDepositAccountsDepositPeriodFrequency depositPeriodFrequency; public GetFixedDepositAccountsAccountIdSummary summary; public GetFixedDepositAccountsAccountChart accountChart; } - @ApiModel(value = "PutFixedDepositAccountsAccountIdRequest") + @Schema(description = "PutFixedDepositAccountsAccountIdRequest") public static final class PutFixedDepositAccountsAccountIdRequest { private PutFixedDepositAccountsAccountIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "6000") + @Schema(example = "6000") public Float depositAmount; } - @ApiModel(value = "PutFixedDepositAccountsAccountIdResponse") + @Schema(description = "PutFixedDepositAccountsAccountIdResponse") public static final class PutFixedDepositAccountsAccountIdResponse { private PutFixedDepositAccountsAccountIdResponse() {} @@ -469,54 +468,54 @@ final class FixedDepositAccountsApiResourceSwagger { private PutFixedDepositAccountsChanges() {} - @ApiModelProperty(example = "6000") + @Schema(example = "6000") public Float depositAmount; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutFixedDepositAccountsChanges changes; } - @ApiModel(value = "PostFixedDepositAccountsAccountIdRequest") + @Schema(description = "PostFixedDepositAccountsAccountIdRequest") public static final class PostFixedDepositAccountsAccountIdRequest { private PostFixedDepositAccountsAccountIdRequest() {} } - @ApiModel(value = "PostFixedDepositAccountsAccountIdResponse") + @Schema(description = "PostFixedDepositAccountsAccountIdResponse") public static final class PostFixedDepositAccountsAccountIdResponse { private PostFixedDepositAccountsAccountIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "DeleteFixedDepositAccountsAccountIdResponse") + @Schema(description = "DeleteFixedDepositAccountsAccountIdResponse") public static final class DeleteFixedDepositAccountsAccountIdResponse { private DeleteFixedDepositAccountsAccountIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResource.java index 03c7d656b..8d1900205 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -88,11 +88,9 @@ import org.springframework.util.CollectionUtils; @Path("/fixeddepositproducts") @Component @Scope("singleton") -@Api(tags = { "Fixed Deposit Product" }) -@SwaggerDefinition(tags = { - @Tag(name = "Fixed Deposit Product", description = "This is one of the advanced term deposit product offered by MFI's. The Fixed Deposit Products (aka FD) product offerings are modeled using this API.\n" - + "\n" + "The FD products are deposit accounts which are held for a fixed term – like 1 year, 2 years etc.\n" + "\n" - + "When creating fixed deposit accounts, the details from the fixed deposit product are used to auto fill details of the fixed deposit account application process.") }) +@Tag(name = "Fixed Deposit Product", description = "This is one of the advanced term deposit product offered by MFI's. The Fixed Deposit Products (aka FD) product offerings are modeled using this API.\n" + + "\n" + "The FD products are deposit accounts which are held for a fixed term – like 1 year, 2 years etc.\n" + "\n" + + "When creating fixed deposit accounts, the details from the fixed deposit product are used to auto fill details of the fixed deposit account application process.") public class FixedDepositProductsApiResource { private final DepositProductReadPlatformService depositProductReadPlatformService; @@ -147,16 +145,15 @@ public class FixedDepositProductsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Fixed Deposit Product", httpMethod = "POST", notes = "Creates a Fixed Deposit Product\n\n" + @Operation(summary = "Create a Fixed Deposit Product", description = "Creates a Fixed Deposit Product\n\n" + "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, accountingRule\n\n" + "Optional Fields: lockinPeriodFrequency, lockinPeriodFrequencyType, maxDepositTerm, maxDepositTermTypeId, inMultiplesOfDepositTerm, inMultiplesOfDepositTermTypeId, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, charts, , withHoldTax, taxGroupId\n\n" + "\n" + "Mandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FixedDepositProductsApiResourceSwagger.PostFixedDepositProductsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PostFixedDepositProductsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositProductsApiResourceSwagger.PostFixedDepositProductsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PostFixedDepositProductsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createFixedDepositProduct().withJson(apiRequestBodyAsJson) .build(); @@ -170,13 +167,12 @@ public class FixedDepositProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Fixed Deposit Product", httpMethod = "PUT", notes = "Updates a Fixed Deposit Product") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = FixedDepositProductsApiResourceSwagger.PutFixedDepositProductsProductIdRequest.class) }) + @Operation(summary = "Update a Fixed Deposit Product", description = "Updates a Fixed Deposit Product") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PutFixedDepositProductsProductIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositProductsApiResourceSwagger.PutFixedDepositProductsProductIdResponse.class) }) - public String update(@PathParam("productId") @ApiParam(value = "productId") final Long productId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PutFixedDepositProductsProductIdResponse.class))) }) + public String update(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateFixedDepositProduct(productId) .withJson(apiRequestBodyAsJson).build(); @@ -190,10 +186,10 @@ public class FixedDepositProductsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Fixed Deposit Products", httpMethod = "GET", notes = "Lists Fixed Deposit Products\n\n" - + "Example Requests:\n" + "\n" + "fixeddepositproducts\n" + "\n" + "\n" + "fixeddepositproducts?fields=name") + @Operation(summary = "List Fixed Deposit Products", description = "Lists Fixed Deposit Products\n\n" + "Example Requests:\n" + "\n" + + "fixeddepositproducts\n" + "\n" + "\n" + "fixeddepositproducts?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositProductsApiResourceSwagger.GetFixedDepositProductsResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.GetFixedDepositProductsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_PRODUCT_RESOURCE_NAME); @@ -210,12 +206,13 @@ public class FixedDepositProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Fixed Deposit Product", httpMethod = "GET", notes = "Retrieves a Fixed Deposit Product\n\n" - + "Example Requests:\n" + "\n" + "fixeddepositproducts/1\n" + "\n" + "\n" + "fixeddepositproducts/1?template=true\n" + "\n" - + "\n" + "fixeddepositproducts/1?fields=name,description") + @Operation(summary = "Retrieve a Fixed Deposit Product", description = "Retrieves a Fixed Deposit Product\n\n" + "Example Requests:\n" + + "\n" + "fixeddepositproducts/1\n" + "\n" + "\n" + "fixeddepositproducts/1?template=true\n" + "\n" + "\n" + + "fixeddepositproducts/1?fields=name,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositProductsApiResourceSwagger.GetFixedDepositProductsProductIdResponse.class) }) - public String retrieveOne(@PathParam("productId") @ApiParam(value = "productId") final Long productId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.GetFixedDepositProductsProductIdResponse.class))) }) + public String retrieveOne(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_PRODUCT_RESOURCE_NAME); @@ -355,10 +352,10 @@ public class FixedDepositProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Fixed Deposit Product", httpMethod = "DELETE", notes = "Deletes a Fixed Deposit Product") + @Operation(summary = "Delete a Fixed Deposit Product", description = "Deletes a Fixed Deposit Product") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = FixedDepositProductsApiResourceSwagger.DeleteFixedDepositProductsProductIdResponse.class) }) - public String delete(@PathParam("productId") @ApiParam(value = "productId") final Long productId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.DeleteFixedDepositProductsProductIdResponse.class))) }) + public String delete(@PathParam("productId") @Parameter(description = "productId") final Long productId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteFixedDepositProduct(productId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResourceSwagger.java index ce1daa7b8..9fe796d21 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositProductsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class FixedDepositProductsApiResourceSwagger { private FixedDepositProductsApiResourceSwagger() {} - @ApiModel(value = "PostFixedDepositProductsRequest") + @Schema(description = "PostFixedDepositProductsRequest") public static final class PostFixedDepositProductsRequest { private PostFixedDepositProductsRequest() {} @@ -43,93 +42,93 @@ final class FixedDepositProductsApiResourceSwagger { private PostFixedDepositProductsChartSlabs() {} - @ApiModelProperty(example = "from 0 to 90 days") + @Schema(example = "from 0 to 90 days") public String description; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer periodType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fromPeriod; - @ApiModelProperty(example = "90") + @Schema(example = "90") public Integer toPeriod; - @ApiModelProperty(example = "4.5") + @Schema(example = "4.5") public Double annualInterestRate; } - @ApiModelProperty(example = "01 Jan 2014") + @Schema(example = "01 Jan 2014") public String fromDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; public Set chartSlabs; } - @ApiModelProperty(example = "Fixed deposit product") + @Schema(example = "Fixed deposit product") public String name; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String shortName; - @ApiModelProperty(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") + @Schema(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") public String description; - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer digitsAfterDecimal; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCompoundingPeriodType; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer interestPostingPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCalculationType; - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer interestCalculationDaysInYearType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountingRule; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "1.75") + @Schema(example = "1.75") public Double preClosurePenalInterest; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer preClosurePenalInterestOnTypeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTerm; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTermTypeId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer maxDepositTerm; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer maxDepositTermTypeId; public Set charts; } - @ApiModel(value = "PostFixedDepositProductsResponse") + @Schema(description = "PostFixedDepositProductsResponse") public static final class PostFixedDepositProductsResponse { private PostFixedDepositProductsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutFixedDepositProductsProductIdRequest") + @Schema(description = "PutFixedDepositProductsProductIdRequest") public static final class PutFixedDepositProductsProductIdRequest { private PutFixedDepositProductsProductIdRequest() {} - @ApiModelProperty(example = "Fixed deposit product new offerings") + @Schema(example = "Fixed deposit product new offerings") public String description; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer minDepositTerm; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTermTypeId; } - @ApiModel(value = "PutFixedDepositProductsProductIdResponse") + @Schema(description = "PutFixedDepositProductsProductIdResponse") public static final class PutFixedDepositProductsProductIdResponse { private PutFixedDepositProductsProductIdResponse() {} @@ -138,18 +137,18 @@ final class FixedDepositProductsApiResourceSwagger { private PutFixedDepositProductsChanges() {} - @ApiModelProperty(example = "Fixed deposit product new offerings") + @Schema(example = "Fixed deposit product new offerings") public String description; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer minDepositTerm; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutFixedDepositProductsChanges changes; } - @ApiModel(value = "GetFixedDepositProductsResponse") + @Schema(description = "GetFixedDepositProductsResponse") public static final class GetFixedDepositProductsResponse { private GetFixedDepositProductsResponse() {} @@ -158,19 +157,19 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -178,104 +177,104 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsMinDepositTermType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.months") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetFixedDepositProductsMaxDepositTermType { private GetFixedDepositProductsMaxDepositTermType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.years") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.years") public String code; - @ApiModelProperty(example = "Years") - public String value; + @Schema(example = "Years") + public String description; } static final class GetFixedDepositProductsInterestCompoundingPeriodType { private GetFixedDepositProductsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetFixedDepositProductsInterestPostingPeriodType { private GetFixedDepositProductsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetFixedDepositProductsInterestCalculationType { private GetFixedDepositProductsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetFixedDepositProductsInterestCalculationDaysInYearType { private GetFixedDepositProductsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetFixedDepositProductsAccountingRule { private GetFixedDepositProductsAccountingRule() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountingRuleType.none") + @Schema(example = "accountingRuleType.none") public String code; - @ApiModelProperty(example = "NONE") - public String value; + @Schema(example = "NONE") + public String description; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String name; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String shortName; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String description; public GetFixedDepositProductsCurrency currency; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer minDepositTerm; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer maxDepositTerm; public GetFixedDepositProductsMinDepositTermType minDepositTermType; public GetFixedDepositProductsMaxDepositTermType maxDepositTermType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double nominalAnnualInterestRate; public GetFixedDepositProductsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetFixedDepositProductsInterestPostingPeriodType interestPostingPeriodType; @@ -284,7 +283,7 @@ final class FixedDepositProductsApiResourceSwagger { public GetFixedDepositProductsAccountingRule accountingRule; } - @ApiModel(value = "GetFixedDepositProductsProductIdResponse") + @Schema(description = "GetFixedDepositProductsProductIdResponse") public static final class GetFixedDepositProductsProductIdResponse { private GetFixedDepositProductsProductIdResponse() {} @@ -293,17 +292,17 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -311,12 +310,12 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") public String code; - @ApiModelProperty(example = "Daily") - public String value; + @Schema(example = "Daily") + public String description; } static final class GetFixedDepositProductsProductIdAccountingMappings { @@ -327,11 +326,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdSavingsReferenceAccount() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "savings ref") + @Schema(example = "savings ref") public String name; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer glCode; } @@ -339,11 +338,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdIncomeFromFeeAccount() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "income from savings fee") + @Schema(example = "income from savings fee") public String name; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer glCode; } @@ -351,11 +350,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdIncomeFromPenaltyAccount() {} - @ApiModelProperty(example = "17") + @Schema(example = "17") public Integer id; - @ApiModelProperty(example = "income from sav penalties") + @Schema(example = "income from sav penalties") public String name; - @ApiModelProperty(example = "25") + @Schema(example = "25") public Integer glCode; } @@ -363,11 +362,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdInterestOnSavingsAccount() {} - @ApiModelProperty(example = "15") + @Schema(example = "15") public Integer id; - @ApiModelProperty(example = "interest on savings") + @Schema(example = "interest on savings") public String name; - @ApiModelProperty(example = "23") + @Schema(example = "23") public Integer glCode; } @@ -375,11 +374,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdSavingsControlAccount() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; - @ApiModelProperty(example = "savings ref tool kit") + @Schema(example = "savings ref tool kit") public String name; - @ApiModelProperty(example = "21") + @Schema(example = "21") public Integer glCode; } @@ -387,11 +386,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdTransfersInSuspenseAccount() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer id; - @ApiModelProperty(example = "saving transfers") + @Schema(example = "saving transfers") public String name; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Integer glCode; } @@ -411,13 +410,13 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdFeeToIncomeAccountMappingsCharge() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "sav charge") + @Schema(example = "sav charge") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } @@ -425,11 +424,11 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdFeeToIncomeAccountMappingsIncomeAccount() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "income from savings fee") + @Schema(example = "income from savings fee") public String name; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer glCode; } @@ -445,13 +444,13 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdPenaltyToIncomeAccountMappingsCharge() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "sav 2") + @Schema(example = "sav 2") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; } @@ -463,36 +462,36 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdPreClosurePenalInterestOnType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "preClosurePenalInterestOnType.wholeTerm") + @Schema(example = "preClosurePenalInterestOnType.wholeTerm") public String code; - @ApiModelProperty(example = "Whole term") - public String value; + @Schema(example = "Whole term") + public String description; } static final class GetFixedDepositProductsProductIdMinDepositTermType { private GetFixedDepositProductsProductIdMinDepositTermType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.weeks") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.weeks") public String code; - @ApiModelProperty(example = "Weeks") - public String value; + @Schema(example = "Weeks") + public String description; } static final class GetFixedDepositProductsProductIdMaxDepositTermType { private GetFixedDepositProductsProductIdMaxDepositTermType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.years") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.years") public String code; - @ApiModelProperty(example = "Years") - public String value; + @Schema(example = "Years") + public String description; } static final class GetFixedDepositProductsProductIdActiveChart { @@ -507,47 +506,47 @@ final class FixedDepositProductsApiResourceSwagger { private GetFixedDepositProductsProductIdPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.weeks") + @Schema(example = "interestChartPeriodType.weeks") public String code; - @ApiModelProperty(example = "Weeks") - public String value; + @Schema(example = "Weeks") + public String description; } - @ApiModelProperty(example = "18") + @Schema(example = "18") public Integer id; - @ApiModelProperty(example = "from 0 to 90 days") + @Schema(example = "from 0 to 90 days") public String description; public GetFixedDepositProductsProductIdPeriodType periodType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fromPeriod; - @ApiModelProperty(example = "90") + @Schema(example = "90") public Integer toPeriod; - @ApiModelProperty(example = "4.5") + @Schema(example = "4.5") public Double annualInterestRate; public GetFixedDepositProductsProductIdCurrency currency; } - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer id; - @ApiModelProperty(example = "[2014, 1, 1]") + @Schema(example = "[2014, 1, 1]") public LocalDate fromDate; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer savingsProductId; - @ApiModelProperty(example = "Fixed deposit product") + @Schema(example = "Fixed deposit product") public String savingsProductName; public Set chartSlabs; public Set periodTypes; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Fixed deposit product") + @Schema(example = "Fixed deposit product") public String name; - @ApiModelProperty(example = "FD01") + @Schema(example = "FD01") public String shortName; - @ApiModelProperty(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") + @Schema(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") public String description; public GetFixedDepositProductsProductIdCurrency currency; public GetFixedDepositProductsProductIdInterestCompoundingPeriodType interestCompoundingPeriodType; @@ -557,26 +556,26 @@ final class FixedDepositProductsApiResourceSwagger { public GetFixedDepositProductsProductIdAccountingMappings accountingMappings; public Set feeToIncomeAccountMappings; public Set penaltyToIncomeAccountMappings; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "1.75") + @Schema(example = "1.75") public Double preClosurePenalInterest; public GetFixedDepositProductsProductIdPreClosurePenalInterestOnType preClosurePenalInterestOnType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTerm; public GetFixedDepositProductsProductIdMinDepositTermType minDepositTermType; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer maxDepositTerm; public GetFixedDepositProductsProductIdMaxDepositTermType maxDepositTermType; public GetFixedDepositProductsProductIdActiveChart activeChart; } - @ApiModel(value = "DeleteFixedDepositProductsProductIdResponse") + @Schema(description = "DeleteFixedDepositProductsProductIdResponse") public static final class DeleteFixedDepositProductsProductIdResponse { private DeleteFixedDepositProductsProductIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java index 0c1cb2def..6d36fc509 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -65,9 +64,7 @@ import org.springframework.stereotype.Component; @Path("/recurringdepositaccounts/{recurringDepositAccountId}/transactions") @Component @Scope("singleton") -@Api(tags = { "Recurring Deposit Account Transactions" }) -@SwaggerDefinition(tags = { - @Tag(name = "Recurring Deposit Account Transactions", description = "Transactions possible on a recurring deposit account.") }) +@Tag(name = "Recurring Deposit Account Transactions", description = "Transactions possible on a recurring deposit account.") public class RecurringDepositAccountTransactionsApiResource { private final PlatformSecurityContext context; @@ -108,20 +105,20 @@ public class RecurringDepositAccountTransactionsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Recurring Deposit Account Transaction Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Recurring Deposit Account Transaction Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Requests:\n" + "\n" + "recurringdepositaccounts/1/transactions/template?command=deposit\n" + "\n" + "recurringdepositaccounts/1/transactions/template?command=withdrawal") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountTransactionsApiResourceSwagger.GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse.class))) }) public String retrieveTemplate( - @PathParam("recurringDepositAccountId") @ApiParam(value = "recurringDepositAccountId") final Long recurringDepositAccountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo) { + @PathParam("recurringDepositAccountId") @Parameter(description = "recurringDepositAccountId") final Long recurringDepositAccountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_ACCOUNT_RESOURCE_NAME); /*** - * Check @Param commandParam value for deposit or withdrawal + * Check @Param commandParam description for deposit or withdrawal */ if (!(is(commandParam, "deposit") || is(commandParam, "withdrawal"))) { throw new UnrecognizedQueryParamException("command", commandParam, new Object[] { "deposit", "withdrawal" }); @@ -152,13 +149,14 @@ public class RecurringDepositAccountTransactionsApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Recurring Deposit Account Transaction", httpMethod = "GET", notes = "Retrieves Recurring Deposit Account Transaction\n\n" + @Operation(summary = "Retrieve Recurring Deposit Account Transaction", description = "Retrieves Recurring Deposit Account Transaction\n\n" + "Example Requests:\n" + "\n" + "recurringdepositaccounts/1/transactions/1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountTransactionsApiResourceSwagger.GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse.class))) }) public String retrieveOne( - @PathParam("recurringDepositAccountId") @ApiParam(value = "recurringDepositAccountId") final Long recurringDepositAccountId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, @Context final UriInfo uriInfo) { + @PathParam("recurringDepositAccountId") @Parameter(description = "recurringDepositAccountId") final Long recurringDepositAccountId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_ACCOUNT_RESOURCE_NAME); SavingsAccountTransactionData transactionData = this.savingsAccountReadPlatformService @@ -175,17 +173,16 @@ public class RecurringDepositAccountTransactionsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Deposit Transaction | Withdrawal Transaction", httpMethod = "POST", notes = "Deposit Transaction:\n\n" + @Operation(summary = "Deposit Transaction | Withdrawal Transaction", description = "Deposit Transaction:\n\n" + "Used for a deposit transaction\n\n" + "Withdrawal Transaction:\n\n" + "Used for a Withdrawal Transaction\n\n" + "Showing request/response for Deposit Transaction") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse.class))) }) public String transaction( - @PathParam("recurringDepositAccountId") @ApiParam(value = "recurringDepositAccountId") final Long recurringDepositAccountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @PathParam("recurringDepositAccountId") @Parameter(description = "recurringDepositAccountId") final Long recurringDepositAccountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -211,18 +208,17 @@ public class RecurringDepositAccountTransactionsApiResource { @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Adjust Transaction | Undo transaction", httpMethod = "POST", notes = "Adjust Transaction:\n\n" + @Operation(summary = "Adjust Transaction | Undo transaction", description = "Adjust Transaction:\n\n" + "This command modifies the given transaction.\n\n" + "Undo transaction:\n\n" + "This command reverses the given transaction.\n\n" + "Showing request/response for 'Adjust Transaction'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse.class))) }) public String handleTransactionCommands( - @PathParam("recurringDepositAccountId") @ApiParam(value = "recurringDepositAccountId") final Long recurringDepositAccountId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @PathParam("recurringDepositAccountId") @Parameter(description = "recurringDepositAccountId") final Long recurringDepositAccountId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String jsonApiRequest = apiRequestBodyAsJson; if (StringUtils.isBlank(jsonApiRequest)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResourceSwagger.java index f3ce1ee04..918986970 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.time.LocalDate; import java.util.List; @@ -31,7 +30,7 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private RecurringDepositAccountTransactionsApiResourceSwagger() {} - @ApiModel(value = "GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse") + @Schema(description = "GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse") public static final class GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse { private GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse() {} @@ -40,33 +39,33 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private GetRecurringTransactionType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsAccountTransactionType.deposit") + @Schema(example = "savingsAccountTransactionType.deposit") public String code; - @ApiModelProperty(example = "Deposit") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Deposit") + public String description; + @Schema(example = "true") public Boolean deposit; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawal; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean interestPosting; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean feeDeduction; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean initiateTransfer; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approveTransfer; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawTransfer; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejectTransfer; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overdraftInterest; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean writtenoff; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean overdraftFee; } @@ -74,41 +73,41 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private GetRecurringCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer decimalPlaces; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; public GetRecurringTransactionType transactionType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountId; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public String accountNo; - @ApiModelProperty(example = "[2014, 6, 25]") + @Schema(example = "[2014, 6, 25]") public LocalDate date; public GetRecurringCurrency currency; - @ApiModelProperty(example = "100000.000000") + @Schema(example = "100000.000000") public BigDecimal amount; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean reversed; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List paymentTypeOptions; } - @ApiModel(value = "GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse") + @Schema(description = "GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse") public static final class GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse { private GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse() {} @@ -117,19 +116,19 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private GetRecurringTransactionsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -137,19 +136,19 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private GetRecurringTransactionsTransactionType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "savingsAccountTransactionType.withdrawal") + @Schema(example = "savingsAccountTransactionType.withdrawal") public String code; - @ApiModelProperty(example = "Withdrawal") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Withdrawal") + public String description; + @Schema(example = "false") public Boolean deposit; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean withdrawal; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean interestPosting; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean feeDeduction; } @@ -161,74 +160,74 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private GetRecurringPaymentType() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "cash") + @Schema(example = "cash") public String name; } - @ApiModelProperty(example = "62") + @Schema(example = "62") public Integer id; public GetRecurringPaymentType paymentType; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer accountNumber; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer checkNumber; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer routingCode; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer receiptNumber; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer bankNumber; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; public GetRecurringTransactionsTransactionType transactionType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountId; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public String accountNo; - @ApiModelProperty(example = "[2013, 8, 7]") + @Schema(example = "[2013, 8, 7]") public LocalDate date; public GetRecurringTransactionsCurrency currency; public GetRecurringPaymentDetailData paymentDetailData; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer runningBalance; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean reversed; } - @ApiModel(value = "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest") + @Schema(description = "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest") public static final class PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest { private PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "27 May 2013") + @Schema(example = "27 May 2013") public String transactionDate; - @ApiModelProperty(example = "500") + @Schema(example = "500") public Double transactionAmount; - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer paymentTypeId; - @ApiModelProperty(example = "acc123") + @Schema(example = "acc123") public String accountNumber; - @ApiModelProperty(example = "che123") + @Schema(example = "che123") public String checkNumber; - @ApiModelProperty(example = "rou123") + @Schema(example = "rou123") public String routingCode; - @ApiModelProperty(example = "rec123") + @Schema(example = "rec123") public String receiptNumber; - @ApiModelProperty(example = "ban123") + @Schema(example = "ban123") public String bankNumber; } - @ApiModel(value = "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse") + @Schema(description = "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse") public static final class PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse { private PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse() {} @@ -237,41 +236,41 @@ final class RecurringDepositAccountTransactionsApiResourceSwagger { private PostRecurringChanges() {} - @ApiModelProperty(example = "acc123") + @Schema(example = "acc123") public String accountNumber; - @ApiModelProperty(example = "che123") + @Schema(example = "che123") public String checkNumber; - @ApiModelProperty(example = "rou123") + @Schema(example = "rou123") public String routingCode; - @ApiModelProperty(example = "rec123") + @Schema(example = "rec123") public String receiptNumber; - @ApiModelProperty(example = "ban123") + @Schema(example = "ban123") public String bankNumber; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "47") + @Schema(example = "47") public Integer resourceId; public PostRecurringChanges changes; } - @ApiModel(value = "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse") + @Schema(description = "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse") public static final class PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse { private PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "48") + @Schema(example = "48") public Integer resourceId; public PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse.PostRecurringChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResource.java index 6d0f06c06..6323c2404 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResource.java @@ -21,15 +21,15 @@ package org.apache.fineract.portfolio.savings.api; import com.google.gson.JsonElement; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -85,9 +85,7 @@ import org.springframework.util.CollectionUtils; @Path("/recurringdepositaccounts") @Component @Scope("singleton") -@Api(tags = { "Recurring Deposit Account" }) -@SwaggerDefinition(tags = { - @Tag(name = "Recurring Deposit Account", description = "Recurring Deposit accounts are instances of a praticular recurring deposit product created. An application process around the creation of accounts is also supported.") }) +@Tag(name = "Recurring Deposit Account", description = "Recurring Deposit accounts are instances of a praticular recurring deposit product created. An application process around the creation of accounts is also supported.") public class RecurringDepositAccountsApiResource { private final DepositAccountReadPlatformService depositAccountReadPlatformService; @@ -126,15 +124,15 @@ public class RecurringDepositAccountsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve recurring Deposit Account Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for recurring deposit applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve recurring Deposit Account Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for recurring deposit applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Requests:\n" + "\n" + "recurringdepositaccounts/template?clientId=1\n" + "\n" + "\n" + "recurringdepositaccounts/template?clientId=1&productId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsTemplateResponse.class) }) - public String template(@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsTemplateResponse.class))) }) + public String template(@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("groupId") @Parameter(description = "groupId") final Long groupId, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_ACCOUNT_RESOURCE_NAME); @@ -150,15 +148,15 @@ public class RecurringDepositAccountsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Recurring deposit applications/accounts", httpMethod = "GET", notes = "Lists Recurring deposit applications/accounts\n\n" + @Operation(summary = "List Recurring deposit applications/accounts", description = "Lists Recurring deposit applications/accounts\n\n" + "Example Requests:\n" + "\n" + "recurringdepositaccounts\n" + "\n" + "\n" + "recurringdepositaccounts?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsResponse.class, responseContainer = "List") }) - public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("paged") @ApiParam(value = "paged") final Boolean paged, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsResponse.class)))) }) + public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("paged") @Parameter(description = "paged") final Boolean paged, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_ACCOUNT_RESOURCE_NAME); final PaginationParameters paginationParameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder); @@ -181,15 +179,14 @@ public class RecurringDepositAccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Submit new recurring deposit application", httpMethod = "POST", notes = "Submits new recurring deposit application\n\n" + @Operation(summary = "Submit new recurring deposit application", description = "Submits new recurring deposit application\n\n" + "Mandatory Fields: clientId or groupId, productId, submittedOnDate, depositAmount, depositPeriod, depositPeriodFrequencyId\n\n" + "Optional Fields: accountNo, externalId, fieldOfficerId,linkAccountId(if provided initial deposit amount will be collected from this account),transferInterestToSavings(By enabling this flag all interest postings will be transferred to linked saving account )\n\n" + "Inherited from Product (if not provided): interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, lockinPeriodFrequency, lockinPeriodFrequencyType, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, charts, withHoldTax") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsResponse.class) }) - public String submitApplication(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsResponse.class))) }) + public String submitApplication(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createRecurringDepositAccount().withJson(apiRequestBodyAsJson) .build(); @@ -203,13 +200,13 @@ public class RecurringDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a recurring deposit application/account", httpMethod = "GET", notes = "Retrieves a recurring deposit application/account\n\n" + @Operation(summary = "Retrieve a recurring deposit application/account", description = "Retrieves a recurring deposit application/account\n\n" + "Example Requests :\n" + "\n" + "recurringdepositaccounts/1\n" + "\n" + "\n" + "recurringdepositaccounts/1?associations=all") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsAccountIdResponse.class) }) - public String retrieveOne(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, - @DefaultValue("all") @QueryParam("chargeStatus") @ApiParam(value = "chargeStatus") final String chargeStatus, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsAccountIdResponse.class))) }) + public String retrieveOne(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @DefaultValue("all") @QueryParam("chargeStatus") @Parameter(description = "chargeStatus") final String chargeStatus, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_ACCOUNT_RESOURCE_NAME); @@ -280,13 +277,12 @@ public class RecurringDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Modify a recurring deposit application", httpMethod = "PUT", notes = "Recurring deposit application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositAccountsApiResourceSwagger.PutRecurringDepositAccountsAccountIdRequest.class) }) + @Operation(summary = "Modify a recurring deposit application", description = "Recurring deposit application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PutRecurringDepositAccountsAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.PutRecurringDepositAccountsAccountIdResponse.class) }) - public String update(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PutRecurringDepositAccountsAccountIdResponse.class))) }) + public String update(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateRecurringDepositAccount(accountId) .withJson(apiRequestBodyAsJson).build(); @@ -300,7 +296,7 @@ public class RecurringDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve recurring deposit application | Undo approval recurring deposit application | Reject recurring deposit application | Withdraw recurring deposit application | Activate a recurring deposit account | Update the recommended deposit amount for a recurring deposit account | Close a recurring deposit account | Premature Close a recurring deposit account | Calculate Premature amount on Recurring deposit account | Calculate Interest on recurring Deposit Account | Post Interest on recurring Deposit Account", httpMethod = "POST", notes = "Approve recurring deposit application:\n\n" + @Operation(summary = "Approve recurring deposit application | Undo approval recurring deposit application | Reject recurring deposit application | Withdraw recurring deposit application | Activate a recurring deposit account | Update the recommended deposit amount for a recurring deposit account | Close a recurring deposit account | Premature Close a recurring deposit account | Calculate Premature amount on Recurring deposit account | Calculate Interest on recurring Deposit Account | Post Interest on recurring Deposit Account", description = "Approve recurring deposit application:\n\n" + "Approves recurring deposit application so long as its in 'Submitted and pending approval' state.\n\n" + "Undo approval recurring deposit application:\n\n" + "Will move 'approved' recurring deposit application back to 'Submitted and pending approval' state.\n\n" @@ -324,13 +320,12 @@ public class RecurringDepositAccountsApiResource { + "Post Interest on recurring Deposit Account:\n\n" + "Calculates and Posts interest earned on a recurring deposit account based on todays date and whether an interest posting or crediting event is due.\n\n" + "Showing request/response for 'Post Interest on recurring Deposit Account'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsAccountIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsAccountIdResponse.class) }) - public String handleCommands(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsAccountIdResponse.class))) }) + public String handleCommands(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String jsonApiRequest = apiRequestBodyAsJson; if (StringUtils.isBlank(jsonApiRequest)) { @@ -398,10 +393,10 @@ public class RecurringDepositAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a recurring deposit application", httpMethod = "DELETE", notes = "At present we support hard delete of recurring deposit application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the recurring deposit account.") + @Operation(summary = "Delete a recurring deposit application", description = "At present we support hard delete of recurring deposit application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the recurring deposit account.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositAccountsApiResourceSwagger.DeleteRecurringDepositAccountsResponse.class) }) - public String delete(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.DeleteRecurringDepositAccountsResponse.class))) }) + public String delete(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteRecurringDepositAccount(accountId).build(); @@ -414,8 +409,8 @@ public class RecurringDepositAccountsApiResource { @Path("{accountId}/template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String accountClosureTemplate(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo) { + public String accountClosureTemplate(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_ACCOUNT_RESOURCE_NAME); DepositAccountData account = null; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResourceSwagger.java index eff026f4f..35e9e85db 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class RecurringDepositAccountsApiResourceSwagger { private RecurringDepositAccountsApiResourceSwagger() {} - @ApiModel(value = "GetRecurringDepositAccountsTemplateResponse") + @Schema(description = "GetRecurringDepositAccountsTemplateResponse") public static final class GetRecurringDepositAccountsTemplateResponse { private GetRecurringDepositAccountsTemplateResponse() {} @@ -39,20 +38,20 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringProductOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "small business") + @Schema(example = "small business") public String clientName; public Set productOptions; } - @ApiModel(value = "GetRecurringDepositAccountsResponse") + @Schema(description = "GetRecurringDepositAccountsResponse") public static final class GetRecurringDepositAccountsResponse { private GetRecurringDepositAccountsResponse() {} @@ -61,29 +60,29 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean prematureClosed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean transferInProgress; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean transferOnHold; } @@ -91,13 +90,13 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsTimeline() {} - @ApiModelProperty(example = "[2014, 3, 1]") + @Schema(example = "[2014, 3, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; } @@ -105,19 +104,19 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -125,48 +124,48 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetRecurringDepositAccountsInterestPostingPeriodType { private GetRecurringDepositAccountsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetRecurringDepositAccountsInterestCalculationType { private GetRecurringDepositAccountsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetRecurringDepositAccountsInterestCalculationDaysInYearType { private GetRecurringDepositAccountsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetRecurringDepositAccountsSummary { @@ -174,7 +173,7 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsSummary() {} public GetRecurringDepositAccountsCurrency currency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float accountBalance; } @@ -182,63 +181,63 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsMinDepositTermType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.months") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetRecurringDepositAccountsMaxDepositTermType { private GetRecurringDepositAccountsMaxDepositTermType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.years") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.years") public String code; - @ApiModelProperty(example = "Years") - public String value; + @Schema(example = "Years") + public String description; } static final class GetRecurringDepositAccountsDepositPeriodFrequency { private GetRecurringDepositAccountsDepositPeriodFrequency() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "deposit.period.savingsPeriodFrequencyType.months") + @Schema(example = "deposit.period.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetRecurringDepositAccountsRecurringDepositFrequencyType { private GetRecurringDepositAccountsRecurringDepositFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "recurring.deposit.savingsPeriodFrequencyType.months") + @Schema(example = "recurring.deposit.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Sangamesh N") + @Schema(example = "Sangamesh N") public String clientName; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer savingsProductId; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetRecurringDepositAccountsStatus status; public GetRecurringDepositAccountsTimeline timeline; @@ -248,77 +247,77 @@ final class RecurringDepositAccountsApiResourceSwagger { public GetRecurringDepositAccountsInterestCalculationType interestCalculationType; public GetRecurringDepositAccountsInterestCalculationDaysInYearType interestCalculationDaysInYearType; public GetRecurringDepositAccountsSummary summary; - @ApiModelProperty(example = "1150") + @Schema(example = "1150") public Float depositAmount; - @ApiModelProperty(example = "252.59") + @Schema(example = "252.59") public Float maturityAmount; - @ApiModelProperty(example = "[2014, 4, 3]") + @Schema(example = "[2014, 4, 3]") public LocalDate maturityDate; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer recurringDepositAmount; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurringDepositFrequency; public GetRecurringDepositAccountsRecurringDepositFrequencyType recurringDepositFrequencyType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer minDepositTerm; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer maxDepositTerm; public GetRecurringDepositAccountsMinDepositTermType minDepositTermType; public GetRecurringDepositAccountsMaxDepositTermType maxDepositTermType; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer depositPeriod; public GetRecurringDepositAccountsDepositPeriodFrequency depositPeriodFrequency; } - @ApiModel(value = "PostRecurringDepositAccountsRequest") + @Schema(description = "PostRecurringDepositAccountsRequest") public static final class PostRecurringDepositAccountsRequest { private PostRecurringDepositAccountsRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "02 June 2014") + @Schema(example = "02 June 2014") public String submittedOnDate; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer depositPeriod; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer depositPeriodFrequencyId; - @ApiModelProperty(example = "10000") + @Schema(example = "10000") public Float depositAmount; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isCalendarInherited; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer recurringFrequency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurringFrequencyType; - @ApiModelProperty(example = "2000") + @Schema(example = "2000") public Long mandatoryRecommendedDepositAmount; } - @ApiModel(value = "PostRecurringDepositAccountsResponse") + @Schema(description = "PostRecurringDepositAccountsResponse") public static final class PostRecurringDepositAccountsResponse { private PostRecurringDepositAccountsResponse() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetRecurringDepositAccountsAccountIdResponse") + @Schema(description = "GetRecurringDepositAccountsAccountIdResponse") public static final class GetRecurringDepositAccountsAccountIdResponse { private GetRecurringDepositAccountsAccountIdResponse() {} @@ -335,40 +334,40 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsPeriodType() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.days") + @Schema(example = "interestChartPeriodType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetRecurringDepositAccountsAccountChartCurrency { private GetRecurringDepositAccountsAccountChartCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; public GetRecurringDepositAccountsPeriodType periodType; - @ApiModelProperty(example = "181") + @Schema(example = "181") public Integer fromPeriod; - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer toPeriod; - @ApiModelProperty(example = "5.5") + @Schema(example = "5.5") public Double annualInterestRate; public GetRecurringDepositAccountsAccountChartCurrency currency; } @@ -377,41 +376,41 @@ final class RecurringDepositAccountsApiResourceSwagger { private GetRecurringDepositAccountsPeriodTypes() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.days") + @Schema(example = "interestChartPeriodType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "[2013, 10, 2]") + @Schema(example = "[2013, 10, 2]") public LocalDate fromDate; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer accountId; - @ApiModelProperty(example = "RD000023") + @Schema(example = "RD000023") public Long accountNumber; public Set chartSlabs; public Set periodTypes; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "RD000023") + @Schema(example = "RD000023") public Long accountNo; - @ApiModelProperty(example = "RD-23") + @Schema(example = "RD-23") public String externalId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Sangamesh N") + @Schema(example = "Sangamesh N") public String clientName; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer savingsProductId; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsStatus status; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsTimeline timeline; @@ -420,40 +419,40 @@ final class RecurringDepositAccountsApiResourceSwagger { public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsInterestPostingPeriodType interestPostingPeriodType; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsInterestCalculationType interestCalculationType; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsInterestCalculationDaysInYearType interestCalculationDaysInYearType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer minDepositTerm; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer maxDepositTerm; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsMinDepositTermType minDepositTermType; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsMaxDepositTermType maxDepositTermType; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer recurringDepositAmount; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurringDepositFrequency; - @ApiModelProperty(example = "[2014, 4, 2]") + @Schema(example = "[2014, 4, 2]") public LocalDate expectedFirstDepositOnDate; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsRecurringDepositFrequencyType recurringDepositFrequencyType; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer depositPeriod; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsDepositPeriodFrequency depositPeriodFrequency; public GetRecurringDepositAccountsResponse.GetRecurringDepositAccountsSummary summary; public GetRecurringDepositAccountsAccountChart accountChart; } - @ApiModel(value = "PutRecurringDepositAccountsAccountIdRequest") + @Schema(description = "PutRecurringDepositAccountsAccountIdRequest") public static final class PutRecurringDepositAccountsAccountIdRequest { private PutRecurringDepositAccountsAccountIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "6000") + @Schema(example = "6000") public Integer depositAmount; } - @ApiModel(value = "PutRecurringDepositAccountsAccountIdResponse") + @Schema(description = "PutRecurringDepositAccountsAccountIdResponse") public static final class PutRecurringDepositAccountsAccountIdResponse { private PutRecurringDepositAccountsAccountIdResponse() {} @@ -462,54 +461,54 @@ final class RecurringDepositAccountsApiResourceSwagger { private PutRecurringDepositAccountsChanges() {} - @ApiModelProperty(example = "6000") + @Schema(example = "6000") public Integer depositAmount; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutRecurringDepositAccountsChanges changes; } - @ApiModel(value = "PostRecurringDepositAccountsAccountIdRequest") + @Schema(description = "PostRecurringDepositAccountsAccountIdRequest") public static final class PostRecurringDepositAccountsAccountIdRequest { private PostRecurringDepositAccountsAccountIdRequest() {} } - @ApiModel(value = "PostRecurringDepositAccountsAccountIdResponse") + @Schema(description = "PostRecurringDepositAccountsAccountIdResponse") public static final class PostRecurringDepositAccountsAccountIdResponse { private PostRecurringDepositAccountsAccountIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "DeleteRecurringDepositAccountsResponse") + @Schema(description = "DeleteRecurringDepositAccountsResponse") public static final class DeleteRecurringDepositAccountsResponse { private DeleteRecurringDepositAccountsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java index 2c14c877a..6bbadf767 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -88,13 +88,11 @@ import org.springframework.util.CollectionUtils; @Path("/recurringdepositproducts") @Component @Scope("singleton") -@Api(tags = { "Recurring Deposit Product" }) -@SwaggerDefinition(tags = { - @Tag(name = "Recurring Deposit Product", description = "Recurring Deposits are a special kind of Term Deposits offered by MFI's. The Recurring Deposit Products (aka RD) product offerings are modeled using this API.\n" - + "\n" - + "Recurring Deposits help people with regular incomes to deposit a fixed amount every month (specified recurring frequency) into their Recurring Deposit account.\n" - + "\n" - + "When creating recurring deposit accounts, the details from the recurring deposit product are used to auto fill details of the recurring deposit account application process.") }) +@Tag(name = "Recurring Deposit Product", description = "Recurring Deposits are a special kind of Term Deposits offered by MFI's. The Recurring Deposit Products (aka RD) product offerings are modeled using this API.\n" + + "\n" + + "Recurring Deposits help people with regular incomes to deposit a fixed amount every month (specified recurring frequency) into their Recurring Deposit account.\n" + + "\n" + + "When creating recurring deposit accounts, the details from the recurring deposit product are used to auto fill details of the recurring deposit account application process.") public class RecurringDepositProductsApiResource { private final DepositProductReadPlatformService depositProductReadPlatformService; @@ -149,15 +147,14 @@ public class RecurringDepositProductsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Recurring Deposit Product", httpMethod = "POST", notes = "Creates a Recurring Deposit Product\n\n" + @Operation(summary = "Create a Recurring Deposit Product", description = "Creates a Recurring Deposit Product\n\n" + "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, recurringDepositFrequency, recurringDepositFrequencyTypeId, accountingRule, depositAmount\n\n" + "Mandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId\n\n" + "Optional Fields: lockinPeriodFrequency, lockinPeriodFrequencyType, maxDepositTerm, maxDepositTermTypeId, inMultiplesOfDepositTerm, inMultiplesOfDepositTermTypeId, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, charts, minDepositAmount, maxDepositAmount, withHoldTax, taxGroupId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createRecurringDepositProduct().withJson(apiRequestBodyAsJson) .build(); @@ -171,13 +168,12 @@ public class RecurringDepositProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Recurring Deposit Product", httpMethod = "PUT", notes = "Updates a Recurring Deposit Product") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RecurringDepositProductsApiResourceSwagger.PutRecurringDepositProductsRequest.class) }) + @Operation(summary = "Update a Recurring Deposit Product", description = "Updates a Recurring Deposit Product") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PutRecurringDepositProductsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositProductsApiResourceSwagger.PutRecurringDepositProductsResponse.class) }) - public String update(@PathParam("productId") @ApiParam(value = "productId") final Long productId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PutRecurringDepositProductsResponse.class))) }) + public String update(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateRecurringDepositProduct(productId) .withJson(apiRequestBodyAsJson).build(); @@ -191,10 +187,10 @@ public class RecurringDepositProductsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Recuring Deposit Products", httpMethod = "GET", notes = "Lists Recuring Deposit Products\n\n" - + "Example Requests:\n" + "\n" + "recurringdepositproducts\n" + "\n" + "\n" + "recurringdepositproducts?fields=name") + @Operation(summary = "List Recuring Deposit Products", description = "Lists Recuring Deposit Products\n\n" + "Example Requests:\n" + + "\n" + "recurringdepositproducts\n" + "\n" + "\n" + "recurringdepositproducts?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = RecurringDepositProductsApiResourceSwagger.GetRecurringDepositProductsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.GetRecurringDepositProductsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_PRODUCT_RESOURCE_NAME); @@ -212,12 +208,13 @@ public class RecurringDepositProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Recurring Deposit Product", httpMethod = "GET", notes = "Retrieves a Recurring Deposit Product\n\n" + @Operation(summary = "Retrieve a Recurring Deposit Product", description = "Retrieves a Recurring Deposit Product\n\n" + "Example Requests:\n" + "\n" + "recurringdepositproducts/1\n" + "\n" + "\n" + "recurringdepositproducts/1?template=true\n" + "\n" + "\n" + "recurringdepositproducts/1?fields=name,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositProductsApiResourceSwagger.GetRecurringDepositProductsProductIdResponse.class) }) - public String retrieveOne(@PathParam("productId") @ApiParam(value = "productId") final Long productId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.GetRecurringDepositProductsProductIdResponse.class))) }) + public String retrieveOne(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_PRODUCT_RESOURCE_NAME); @@ -353,10 +350,10 @@ public class RecurringDepositProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Recurring Deposit Product", httpMethod = "DELETE", notes = "Deletes a Recurring Deposit Product") + @Operation(summary = "Delete a Recurring Deposit Product", description = "Deletes a Recurring Deposit Product") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = RecurringDepositProductsApiResourceSwagger.DeleteRecurringDepositProductsProductIdResponse.class) }) - public String delete(@PathParam("productId") @ApiParam(value = "productId") final Long productId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.DeleteRecurringDepositProductsProductIdResponse.class))) }) + public String delete(@PathParam("productId") @Parameter(description = "productId") final Long productId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteRecurringDepositProduct(productId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java index 4b9bcbe6c..8a1a59326 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class RecurringDepositProductsApiResourceSwagger { private RecurringDepositProductsApiResourceSwagger() {} - @ApiModel(value = "PostRecurringDepositProductsRequest") + @Schema(description = "PostRecurringDepositProductsRequest") public static final class PostRecurringDepositProductsRequest { private PostRecurringDepositProductsRequest() {} @@ -43,103 +42,103 @@ final class RecurringDepositProductsApiResourceSwagger { private PostRecurringDepositProductsChartSlabs() {} - @ApiModelProperty(example = "from 0 to 90 days") + @Schema(example = "from 0 to 90 days") public String description; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer periodType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fromPeriod; - @ApiModelProperty(example = "90") + @Schema(example = "90") public Integer toPeriod; - @ApiModelProperty(example = "4.5") + @Schema(example = "4.5") public Double annualInterestRate; } - @ApiModelProperty(example = "01 Jan 2014") + @Schema(example = "01 Jan 2014") public String fromDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; public Set chartSlabs; } - @ApiModelProperty(example = "Recurring deposit product") + @Schema(example = "Recurring deposit product") public String name; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String shortName; - @ApiModelProperty(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") + @Schema(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") public String description; - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer digitsAfterDecimal; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCompoundingPeriodType; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer interestPostingPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCalculationType; - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer interestCalculationDaysInYearType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountingRule; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurringDepositFrequency; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer recurringDepositFrequencyTypeId; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "1.75") + @Schema(example = "1.75") public Double preClosurePenalInterest; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer preClosurePenalInterestOnTypeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTerm; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTermTypeId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer maxDepositTerm; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer maxDepositTermTypeId; - @ApiModelProperty(example = "10000") + @Schema(example = "10000") public Long depositAmount; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Long minDepositAmount; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long maxDepositAmount; public Set charts; } - @ApiModel(value = "PostRecurringDepositProductsResponse") + @Schema(description = "PostRecurringDepositProductsResponse") public static final class PostRecurringDepositProductsResponse { private PostRecurringDepositProductsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutRecurringDepositProductsRequest") + @Schema(description = "PutRecurringDepositProductsRequest") public static final class PutRecurringDepositProductsRequest { private PutRecurringDepositProductsRequest() {} - @ApiModelProperty(example = "Recurring deposit product new offerings") + @Schema(example = "Recurring deposit product new offerings") public String description; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer minDepositTerm; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTermTypeId; } - @ApiModel(value = "PutRecurringDepositProductsResponse") + @Schema(description = "PutRecurringDepositProductsResponse") public static final class PutRecurringDepositProductsResponse { private PutRecurringDepositProductsResponse() {} @@ -148,18 +147,18 @@ final class RecurringDepositProductsApiResourceSwagger { private PutRecurringDepositProductsChanges() {} - @ApiModelProperty(example = "Recurring deposit product new offerings") + @Schema(example = "Recurring deposit product new offerings") public String description; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer minDepositTerm; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutRecurringDepositProductsChanges changes; } - @ApiModel(value = "GetRecurringDepositProductsResponse") + @Schema(description = "GetRecurringDepositProductsResponse") public static final class GetRecurringDepositProductsResponse { private GetRecurringDepositProductsResponse() {} @@ -168,19 +167,19 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -188,119 +187,119 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsMinDepositTermType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.months") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetRecurringDepositProductsMaxDepositTermType { private GetRecurringDepositProductsMaxDepositTermType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.years") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.years") public String code; - @ApiModelProperty(example = "Years") - public String value; + @Schema(example = "Years") + public String description; } static final class GetRecurringDepositProductsInterestCompoundingPeriodType { private GetRecurringDepositProductsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetRecurringDepositProductsInterestPostingPeriodType { private GetRecurringDepositProductsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetRecurringDepositProductsInterestCalculationType { private GetRecurringDepositProductsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetRecurringDepositProductsInterestCalculationDaysInYearType { private GetRecurringDepositProductsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetRecurringDepositProductsAccountingRule { private GetRecurringDepositProductsAccountingRule() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountingRuleType.none") + @Schema(example = "accountingRuleType.none") public String code; - @ApiModelProperty(example = "NONE") - public String value; + @Schema(example = "NONE") + public String description; } static final class GetRecurringDepositProductsRecurringDepositFrequencyType { private GetRecurringDepositProductsRecurringDepositFrequencyType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "recurring.deposit.savingsPeriodFrequencyType.months") + @Schema(example = "recurring.deposit.savingsPeriodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String name; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String shortName; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String description; public GetRecurringDepositProductsCurrency currency; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurringDepositFrequency; public GetRecurringDepositProductsRecurringDepositFrequencyType recurringDepositFrequencyType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer minDepositTerm; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer maxDepositTerm; public GetRecurringDepositProductsMinDepositTermType minDepositTermType; public GetRecurringDepositProductsMaxDepositTermType maxDepositTermType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double nominalAnnualInterestRate; public GetRecurringDepositProductsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetRecurringDepositProductsInterestPostingPeriodType interestPostingPeriodType; @@ -309,7 +308,7 @@ final class RecurringDepositProductsApiResourceSwagger { public GetRecurringDepositProductsAccountingRule accountingRule; } - @ApiModel(value = "GetRecurringDepositProductsProductIdResponse") + @Schema(description = "GetRecurringDepositProductsProductIdResponse") public static final class GetRecurringDepositProductsProductIdResponse { private GetRecurringDepositProductsProductIdResponse() {} @@ -318,17 +317,17 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -336,12 +335,12 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") public String code; - @ApiModelProperty(example = "Daily") - public String value; + @Schema(example = "Daily") + public String description; } static final class GetRecurringDepositProductsProductIdAccountingMappings { @@ -352,11 +351,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdSavingsReferenceAccount() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "savings ref") + @Schema(example = "savings ref") public String name; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer glCode; } @@ -364,11 +363,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdIncomeFromFeeAccount() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "income from savings fee") + @Schema(example = "income from savings fee") public String name; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer glCode; } @@ -376,11 +375,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdIncomeFromPenaltyAccount() {} - @ApiModelProperty(example = "17") + @Schema(example = "17") public Integer id; - @ApiModelProperty(example = "income from sav penalties") + @Schema(example = "income from sav penalties") public String name; - @ApiModelProperty(example = "25") + @Schema(example = "25") public Integer glCode; } @@ -388,11 +387,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdInterestOnSavingsAccount() {} - @ApiModelProperty(example = "15") + @Schema(example = "15") public Integer id; - @ApiModelProperty(example = "interest on savings") + @Schema(example = "interest on savings") public String name; - @ApiModelProperty(example = "23") + @Schema(example = "23") public Integer glCode; } @@ -400,11 +399,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdSavingsControlAccount() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; - @ApiModelProperty(example = "savings ref tool kit") + @Schema(example = "savings ref tool kit") public String name; - @ApiModelProperty(example = "21") + @Schema(example = "21") public Integer glCode; } @@ -412,11 +411,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdTransfersInSuspenseAccount() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer id; - @ApiModelProperty(example = "saving transfers") + @Schema(example = "saving transfers") public String name; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Integer glCode; } @@ -436,13 +435,13 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdFeeToIncomeAccountMappingsCharge() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "sav charge") + @Schema(example = "sav charge") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } @@ -450,11 +449,11 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdFeeToIncomeAccountMappingsIncomeAccount() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "income from savings fee") + @Schema(example = "income from savings fee") public String name; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer glCode; } @@ -470,13 +469,13 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdPenaltyToIncomeAccountMappingsCharge() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "sav 2") + @Schema(example = "sav 2") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; } @@ -488,36 +487,36 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdPreClosurePenalInterestOnType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "preClosurePenalInterestOnType.wholeTerm") + @Schema(example = "preClosurePenalInterestOnType.wholeTerm") public String code; - @ApiModelProperty(example = "Whole term") - public String value; + @Schema(example = "Whole term") + public String description; } static final class GetRecurringDepositProductsProductIdMinDepositTermType { private GetRecurringDepositProductsProductIdMinDepositTermType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.weeks") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.weeks") public String code; - @ApiModelProperty(example = "Weeks") - public String value; + @Schema(example = "Weeks") + public String description; } static final class GetRecurringDepositProductsProductIdMaxDepositTermType { private GetRecurringDepositProductsProductIdMaxDepositTermType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "deposit.term.savingsPeriodFrequencyType.years") + @Schema(example = "deposit.term.savingsPeriodFrequencyType.years") public String code; - @ApiModelProperty(example = "Years") - public String value; + @Schema(example = "Years") + public String description; } static final class GetRecurringDepositProductsProductIdActiveChart { @@ -532,47 +531,47 @@ final class RecurringDepositProductsApiResourceSwagger { private GetRecurringDepositProductsProductIdPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestChartPeriodType.weeks") + @Schema(example = "interestChartPeriodType.weeks") public String code; - @ApiModelProperty(example = "Weeks") - public String value; + @Schema(example = "Weeks") + public String description; } - @ApiModelProperty(example = "18") + @Schema(example = "18") public Integer id; - @ApiModelProperty(example = "from 0 to 90 days") + @Schema(example = "from 0 to 90 days") public String description; public GetRecurringDepositProductsProductIdPeriodType periodType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fromPeriod; - @ApiModelProperty(example = "90") + @Schema(example = "90") public Integer toPeriod; - @ApiModelProperty(example = "4.5") + @Schema(example = "4.5") public Double annualInterestRate; public GetRecurringDepositProductsProductIdCurrency currency; } - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer id; - @ApiModelProperty(example = "[2014, 1, 1]") + @Schema(example = "[2014, 1, 1]") public LocalDate fromDate; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer savingsProductId; - @ApiModelProperty(example = "Recurring deposit product") + @Schema(example = "Recurring deposit product") public String savingsProductName; public Set chartSlabs; public Set periodTypes; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Recurring deposit product") + @Schema(example = "Recurring deposit product") public String name; - @ApiModelProperty(example = "RD01") + @Schema(example = "RD01") public String shortName; - @ApiModelProperty(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") + @Schema(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") public String description; public GetRecurringDepositProductsProductIdCurrency currency; public GetRecurringDepositProductsProductIdInterestCompoundingPeriodType interestCompoundingPeriodType; @@ -582,29 +581,29 @@ final class RecurringDepositProductsApiResourceSwagger { public GetRecurringDepositProductsProductIdAccountingMappings accountingMappings; public Set feeToIncomeAccountMappings; public Set penaltyToIncomeAccountMappings; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer recurringDepositFrequency; public GetRecurringDepositProductsResponse.GetRecurringDepositProductsRecurringDepositFrequencyType recurringDepositFrequencyType; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean preClosurePenalApplicable; - @ApiModelProperty(example = "1.75") + @Schema(example = "1.75") public Double preClosurePenalInterest; public GetRecurringDepositProductsProductIdPreClosurePenalInterestOnType preClosurePenalInterestOnType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer minDepositTerm; public GetRecurringDepositProductsProductIdMinDepositTermType minDepositTermType; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer maxDepositTerm; public GetRecurringDepositProductsProductIdMaxDepositTermType maxDepositTermType; public GetRecurringDepositProductsProductIdActiveChart activeChart; } - @ApiModel(value = "DeleteRecurringDepositProductsProductIdResponse") + @Schema(description = "DeleteRecurringDepositProductsProductIdResponse") public static final class DeleteRecurringDepositProductsProductIdResponse { private DeleteRecurringDepositProductsProductIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResource.java index 77bb155a2..500dbe74c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResource.java @@ -23,15 +23,15 @@ import static org.apache.fineract.portfolio.savings.SavingsApiConstants.COMMAND_ import static org.apache.fineract.portfolio.savings.SavingsApiConstants.COMMAND_WAIVE_CHARGE; import static org.apache.fineract.portfolio.savings.SavingsApiConstants.SAVINGS_ACCOUNT_CHARGE_RESOURCE_NAME; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -67,11 +67,9 @@ import org.springframework.stereotype.Component; @Path("/savingsaccounts/{savingsAccountId}/charges") @Component @Scope("singleton") -@Api(tags = { "Savings Charges" }) -@SwaggerDefinition(tags = { - @Tag(name = "Savings Charges", description = "Its typical for MFIs to add maintenance and operating charges. They can be either Fees or Penalties.\n" - + "\n" - + "Savings Charges are instances of Charges and represent either fees and penalties for savings products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Savings account) are described here") }) +@Tag(name = "Savings Charges", description = "Its typical for MFIs to add maintenance and operating charges. They can be either Fees or Penalties.\n" + + "\n" + + "Savings Charges are instances of Charges and represent either fees and penalties for savings products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Savings account) are described here") public class SavingsAccountChargesApiResource { private final PlatformSecurityContext context; @@ -103,15 +101,15 @@ public class SavingsAccountChargesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Savings Charges", httpMethod = "GET", notes = "Lists Savings Charges\n\n" + "Example Requests:\n" + "\n" + @Operation(summary = "List Savings Charges", description = "Lists Savings Charges\n\n" + "Example Requests:\n" + "\n" + "savingsaccounts/1/charges\n" + "\n" + "savingsaccounts/1/charges?chargeStatus=all\n" + "\n" + "savingsaccounts/1/charges?chargeStatus=inactive\n" + "\n" + "savingsaccounts/1/charges?chargeStatus=active\n" + "\n" + "savingsaccounts/1/charges?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesResponse.class)))) }) public String retrieveAllSavingsAccountCharges( - @PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, - @DefaultValue("all") @QueryParam("chargeStatus") @ApiParam(value = "chargeStatus") final String chargeStatus, + @PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, + @DefaultValue("all") @QueryParam("chargeStatus") @Parameter(description = "chargeStatus") final String chargeStatus, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SAVINGS_ACCOUNT_CHARGE_RESOURCE_NAME); @@ -132,11 +130,12 @@ public class SavingsAccountChargesApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Savings Charges Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "savingsaccounts/1/charges/template") + @Operation(summary = "Retrieve Savings Charges Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + + "savingsaccounts/1/charges/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesTemplateResponse.class) }) - public String retrieveTemplate(@PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesTemplateResponse.class))) }) + public String retrieveTemplate(@PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SAVINGS_ACCOUNT_CHARGE_RESOURCE_NAME); @@ -154,14 +153,13 @@ public class SavingsAccountChargesApiResource { @Path("{savingsAccountChargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Savings account Charge", httpMethod = "GET", notes = "Retrieves a Savings account Charge\n\n" - + "Example Requests:\n" + "\n" + "/savingsaccounts/1/charges/5\n" + "\n" + "\n" - + "/savingsaccounts/1/charges/5?fields=name,amountOrPercentage") + @Operation(summary = "Retrieve a Savings account Charge", description = "Retrieves a Savings account Charge\n\n" + "Example Requests:\n" + + "\n" + "/savingsaccounts/1/charges/5\n" + "\n" + "\n" + "/savingsaccounts/1/charges/5?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) public String retrieveSavingsAccountCharge( - @PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, - @PathParam("savingsAccountChargeId") @ApiParam(value = "savingsAccountChargeId") final Long savingsAccountChargeId, + @PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, + @PathParam("savingsAccountChargeId") @Parameter(description = "savingsAccountChargeId") final Long savingsAccountChargeId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SAVINGS_ACCOUNT_CHARGE_RESOURCE_NAME); @@ -177,15 +175,15 @@ public class SavingsAccountChargesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Savings account Charge", httpMethod = "POST", notes = "Creates a Savings account Charge\n\n" + @Operation(summary = "Create a Savings account Charge", description = "Creates a Savings account Charge\n\n" + "Mandatory Fields for Savings account Charges: chargeId, amount\n\n" + "chargeId, amount, dueDate, dateFormat, locale\n\n" + "chargeId, amount, feeOnMonthDay, monthDayFormat, locale") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesResponse.class) }) - public String addSavingsAccountCharge(@PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesResponse.class))) }) + public String addSavingsAccountCharge( + @PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createSavingsAccountCharge(savingsAccountId) .withJson(apiRequestBodyAsJson).build(); @@ -199,15 +197,14 @@ public class SavingsAccountChargesApiResource { @Path("{savingsAccountChargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Savings account Charge", httpMethod = "PUT", notes = "Currently Savings account Charges may be updated only if the Savings account is not yet approved.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsAccountChargesApiResourceSwagger.PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest.class) }) + @Operation(summary = "Update a Savings account Charge", description = "Currently Savings account Charges may be updated only if the Savings account is not yet approved.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountChargesApiResourceSwagger.PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) public String updateSavingsAccountCharge( - @PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, - @PathParam("savingsAccountChargeId") @ApiParam(value = "savingsAccountChargeId") final Long savingsAccountChargeId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, + @PathParam("savingsAccountChargeId") @Parameter(description = "savingsAccountChargeId") final Long savingsAccountChargeId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() .updateSavingsAccountCharge(savingsAccountId, savingsAccountChargeId).withJson(apiRequestBodyAsJson).build(); @@ -221,21 +218,20 @@ public class SavingsAccountChargesApiResource { @Path("{savingsAccountChargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Pay a Savings account Charge | Waive off a Savings account Charge | Inactivate a Savings account Charge", httpMethod = "POST", notes = "Pay a Savings account Charge:\n\n" + @Operation(summary = "Pay a Savings account Charge | Waive off a Savings account Charge | Inactivate a Savings account Charge", description = "Pay a Savings account Charge:\n\n" + "An active charge will be paid when savings account is active and having sufficient balance.\n\n" + "Waive off a Savings account Charge:\n\n" + "Outstanding charge amount will be waived off.\n\n" + "Inactivate a Savings account Charge:\n\n" + "A charge will be allowed to inactivate when savings account is active and not having any dues as of today. If charge is overpaid, corresponding charge payment transactions will be reversed.\n\n" + "Showing request/response for 'Pay a Savings account Charge'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) public String payOrWaiveSavingsAccountCharge( - @PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, - @PathParam("savingsAccountChargeId") @ApiParam(value = "savingsAccountChargeId") final Long savingsAccountChargeId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, + @PathParam("savingsAccountChargeId") @Parameter(description = "savingsAccountChargeId") final Long savingsAccountChargeId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String json = ""; if (is(commandParam, COMMAND_WAIVE_CHARGE)) { @@ -271,12 +267,12 @@ public class SavingsAccountChargesApiResource { @Path("{savingsAccountChargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Savings account Charge", httpMethod = "DELETE", notes = "Note: Currently, A Savings account Charge may only be removed from Savings that are not yet approved.") + @Operation(summary = "Delete a Savings account Charge", description = "Note: Currently, A Savings account Charge may only be removed from Savings that are not yet approved.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountChargesApiResourceSwagger.DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) public String deleteSavingsAccountCharge( - @PathParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Long savingsAccountId, - @PathParam("savingsAccountChargeId") @ApiParam(value = "savingsAccountChargeId") final Long savingsAccountChargeId) { + @PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, + @PathParam("savingsAccountChargeId") @Parameter(description = "savingsAccountChargeId") final Long savingsAccountChargeId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() .deleteSavingsAccountCharge(savingsAccountId, savingsAccountChargeId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResourceSwagger.java index 5f3cc657b..f8f817c2c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountChargesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,24 +28,24 @@ final class SavingsAccountChargesApiResourceSwagger { private SavingsAccountChargesApiResourceSwagger() {} - @ApiModel(value = "GetSavingsAccountsSavingsAccountIdChargesResponse") + @Schema(description = "GetSavingsAccountsSavingsAccountIdChargesResponse") public static final class GetSavingsAccountsSavingsAccountIdChargesResponse { private GetSavingsAccountsSavingsAccountIdChargesResponse() {} static final class GetChargesCurrencyResponse { - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -54,58 +53,58 @@ final class SavingsAccountChargesApiResourceSwagger { private GetChargesChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetChargesChargeTimeType { private GetChargesChargeTimeType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer chargeId; - @ApiModelProperty(example = "57") + @Schema(example = "57") public Integer accountId; - @ApiModelProperty(example = "Savings account maintenance fee") + @Schema(example = "Savings account maintenance fee") public String name; public GetChargesChargeTimeType chargeTimeType; public GetChargesChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetChargesCurrencyResponse currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOutstanding; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOrPercentage; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = "GetSavingsAccountsSavingsAccountIdChargesTemplateResponse") + @Schema(description = "GetSavingsAccountsSavingsAccountIdChargesTemplateResponse") public static final class GetSavingsAccountsSavingsAccountIdChargesTemplateResponse { private GetSavingsAccountsSavingsAccountIdChargesTemplateResponse() {} @@ -118,135 +117,135 @@ final class SavingsAccountChargesApiResourceSwagger { private GetSavingsChargesChargeTimeType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetChargesAppliesTo { private GetChargesAppliesTo() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.savings") + @Schema(example = "chargeAppliesTo.savings") public String code; - @ApiModelProperty(example = "Savings") - public String value; + @Schema(example = "Savings") + public String description; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Passbook Fee") + @Schema(example = "Passbook Fee") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; public GetSavingsAccountsSavingsAccountIdChargesResponse.GetChargesCurrencyResponse currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; public GetSavingsChargesChargeTimeType chargeTimeType; public GetChargesAppliesTo chargesAppliesTo; public GetSavingsAccountsSavingsAccountIdChargesResponse.GetChargesChargeCalculationType chargeCalculationType; } - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; public Set chargeOptions; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = "GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") + @Schema(description = "GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") public static final class GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse { private GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeId; - @ApiModelProperty(example = "Passbook fee") + @Schema(example = "Passbook fee") public String name; public GetSavingsAccountsSavingsAccountIdChargesResponse.GetChargesChargeTimeType chargeTimeType; public GetSavingsAccountsSavingsAccountIdChargesResponse.GetChargesChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetSavingsAccountsSavingsAccountIdChargesResponse.GetChargesCurrencyResponse currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOutstanding; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOrPercentage; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = "PostSavingsAccountsSavingsAccountIdChargesRequest") + @Schema(description = "PostSavingsAccountsSavingsAccountIdChargesRequest") public static final class PostSavingsAccountsSavingsAccountIdChargesRequest { private PostSavingsAccountsSavingsAccountIdChargesRequest() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer chargeId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "29 April 2013") + @Schema(example = "29 April 2013") public String dueDate; } - @ApiModel(value = "PostSavingsAccountsSavingsAccountIdChargesResponse") + @Schema(description = "PostSavingsAccountsSavingsAccountIdChargesResponse") public static final class PostSavingsAccountsSavingsAccountIdChargesResponse { private PostSavingsAccountsSavingsAccountIdChargesResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer resourceId; } - @ApiModel(value = "PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest") + @Schema(description = "PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest") public static final class PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest { private PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "60") + @Schema(example = "60") public Float amount; - @ApiModelProperty(example = "27 March 2013") + @Schema(example = "27 March 2013") public String dueDate; } - @ApiModel(value = "PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") + @Schema(description = "PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") public static final class PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse { private PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse() {} @@ -255,69 +254,69 @@ final class SavingsAccountChargesApiResourceSwagger { private PutSavingsChanges() {} - @ApiModelProperty(example = "27 March 2013") + @Schema(example = "27 March 2013") public String dueDate; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "60.0") + @Schema(example = "60.0") public Float amount; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer resourceId; public PutSavingsChanges changes; } - @ApiModel(value = "PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest") + @Schema(description = "PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest") public static final class PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest { private PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "60") + @Schema(example = "60") public Float amount; - @ApiModelProperty(example = "12 September 2013") + @Schema(example = "12 September 2013") public String dueDate; } - @ApiModel(value = "PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") + @Schema(description = "PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") public static final class PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse { private PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } - @ApiModel(value = "DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") + @Schema(description = "DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse") public static final class DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse { private DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java index 2753833c0..739001c09 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResource.java @@ -20,15 +20,14 @@ package org.apache.fineract.portfolio.savings.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -79,9 +78,7 @@ import org.springframework.util.CollectionUtils; @Path("/savingsaccounts") @Component @Scope("singleton") -@Api(tags = { "Savings Account" }) -@SwaggerDefinition(tags = { - @Tag(name = "Savings Account", description = "Savings accounts are instances of a particular savings product created for an individual or group. An application process around the creation of accounts is also supported.") }) +@Tag(name = "Savings Account", description = "Savings accounts are instances of a particular savings product created for an individual or group. An application process around the creation of accounts is also supported.") public class SavingsAccountsApiResource { private final SavingsAccountReadPlatformService savingsAccountReadPlatformService; @@ -115,15 +112,15 @@ public class SavingsAccountsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Savings Account Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Savings Account Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Requests:\n" + "\n" + "savingsaccounts/template?clientId=1\n" + "\n" + "\n" + "savingsaccounts/template?clientId=1&productId=1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.GetSavingsAccountsTemplateResponse.class) }) - public String template(@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("groupId") @ApiParam(value = "groupId") final Long groupId, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.GetSavingsAccountsTemplateResponse.class))) }) + public String template(@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("groupId") @Parameter(description = "groupId") final Long groupId, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME); @@ -139,18 +136,18 @@ public class SavingsAccountsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List savings applications/accounts", httpMethod = "GET", notes = "Lists savings applications/accounts\n\n" + @Operation(summary = "List savings applications/accounts", description = "Lists savings applications/accounts\n\n" + "Example Requests:\n" + "\n" + "savingsaccounts\n" + "\n" + "\n" + "savingsaccounts?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.GetSavingsAccountsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.GetSavingsAccountsResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("sqlSearch") @ApiParam(value = "sqlSearch") final String sqlSearch, - @QueryParam("externalId") @ApiParam(value = "externalId") final String externalId, + @QueryParam("sqlSearch") @Parameter(description = "sqlSearch") final String sqlSearch, + @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, // @QueryParam("underHierarchy") final String hierarchy, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME); @@ -165,16 +162,15 @@ public class SavingsAccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Submit new savings application", httpMethod = "POST", notes = "Submits new savings application\n\n" + @Operation(summary = "Submit new savings application", description = "Submits new savings application\n\n" + "Mandatory Fields: clientId or groupId, productId, submittedOnDate\n\n" + "Optional Fields: accountNo, externalId, fieldOfficerId\n\n" + "Inherited from Product (if not provided): nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, withdrawalFeeForTransfers, allowOverdraft, overdraftLimit, withHoldTax\n\n" + "Additional Mandatory Field if Entity-Datatable Check is enabled for the entity of type Savings: datatables") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsAccountsApiResourceSwagger.PostSavingsAccountsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.PostSavingsAccountsResponse.class) }) - public String submitApplication(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsResponse.class))) }) + public String submitApplication(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createSavingsAccount().withJson(apiRequestBodyAsJson).build(); @@ -200,13 +196,13 @@ public class SavingsAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a savings application/account", httpMethod = "GET", notes = "Retrieves a savings application/account\n\n" + @Operation(summary = "Retrieve a savings application/account", description = "Retrieves a savings application/account\n\n" + "Example Requests :\n" + "\n" + "savingsaccounts/1\n" + "\n" + "\n" + "savingsaccounts/1?associations=all") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.GetSavingsAccountsAccountIdResponse.class) }) - public String retrieveOne(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @ApiParam(value = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, - @DefaultValue("all") @QueryParam("chargeStatus") @ApiParam(value = "chargeStatus") final String chargeStatus, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.GetSavingsAccountsAccountIdResponse.class))) }) + public String retrieveOne(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") @Parameter(description = "staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, + @DefaultValue("all") @QueryParam("chargeStatus") @Parameter(description = "chargeStatus") final String chargeStatus, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME); @@ -274,18 +270,17 @@ public class SavingsAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Modify a savings application | Modify savings account withhold tax applicability", httpMethod = "PUT", notes = "Modify a savings application:\n\n" + @Operation(summary = "Modify a savings application | Modify savings account withhold tax applicability", description = "Modify a savings application:\n\n" + "Savings application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc\n\n" + "Modify savings account withhold tax applicability:\n\n" + "Savings application's withhold tax can be modified when in 'Active' state. Once the application is activated, can modify the account withhold tax to post tax or vice-versa" + "Showing request/response for 'Modify a savings application'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdResponse.class) }) - public String update(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson, - @QueryParam("command") @ApiParam(value = "command") final String commandParam) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdResponse.class))) }) + public String update(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @Parameter(hidden = true) final String apiRequestBodyAsJson, + @QueryParam("command") @Parameter(description = "command") final String commandParam) { if (is(commandParam, "updateWithHoldTax")) { final CommandWrapper commandRequest = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson).updateWithHoldTax(accountId) @@ -388,7 +383,7 @@ public class SavingsAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Approve savings application | Undo approval savings application | Assign Savings Officer | Unassign Savings Officer | Reject savings application | Withdraw savings application | Activate a savings account | Close a savings account | Calculate Interest on Savings Account | Post Interest on Savings Account | Block Savings Account | Unblock Savings Account | Block Savings Account Credit transactions | Unblock Savings Account Credit transactions | Block Savings Account Debit transactions | Unblock Savings Account debit transactions", httpMethod = "POST", notes = "Approve savings application:\n\n" + @Operation(summary = "Approve savings application | Undo approval savings application | Assign Savings Officer | Unassign Savings Officer | Reject savings application | Withdraw savings application | Activate a savings account | Close a savings account | Calculate Interest on Savings Account | Post Interest on Savings Account | Block Savings Account | Unblock Savings Account | Block Savings Account Credit transactions | Unblock Savings Account Credit transactions | Block Savings Account Debit transactions | Unblock Savings Account debit transactions", description = "Approve savings application:\n\n" + "Approves savings application so long as its in 'Submitted and pending approval' state.\n\n" + "Undo approval savings application:\n\n" + "Will move 'approved' savings application back to 'Submitted and pending approval' state.\n\n" + "Assign Savings Officer:\n\n" @@ -402,7 +397,7 @@ public class SavingsAccountsApiResource { + "Close a savings account:\n\n" + "Results in an Activated savings application being converted into an 'closed' savings account.\n" + "\n" + "closedOnDate is closure date of savings account\n" + "\n" - + "withdrawBalance is a boolean value, true value of this field performs a withdrawal transaction with account's running balance.\n\n" + + "withdrawBalance is a boolean description, true value of this field performs a withdrawal transaction with account's running balance.\n\n" + "Mandatory Fields: dateFormat,locale,closedOnDate\n\n" + "Optional Fields: note, withdrawBalance, paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber\n\n" + "Calculate Interest on Savings Account:\n\n" @@ -420,13 +415,12 @@ public class SavingsAccountsApiResource { + "Unblock Savings Account debit transactions:\n\n" + "It unblocks the Saving account's debit operations. Now all types of debits can be transacted from Savings account\n\n" + "Showing request/response for 'Unassign Savings Officer'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdResponse.class) }) - public String handleCommands(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdResponse.class))) }) + public String handleCommands(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { String jsonApiRequest = apiRequestBodyAsJson; if (StringUtils.isBlank(jsonApiRequest)) { @@ -512,10 +506,10 @@ public class SavingsAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a savings application", httpMethod = "DELETE", notes = "At present we support hard delete of savings application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the savings account.") + @Operation(summary = "Delete a savings application", description = "At present we support hard delete of savings application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the savings account.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsAccountsApiResourceSwagger.DeleteSavingsAccountsAccountIdResponse.class) }) - public String delete(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.DeleteSavingsAccountsAccountIdResponse.class))) }) + public String delete(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSavingsAccount(accountId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResourceSwagger.java index 420c792a7..8b3a6bebf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class SavingsAccountsApiResourceSwagger { private SavingsAccountsApiResourceSwagger() {} - @ApiModel(value = "GetSavingsAccountsTemplateResponse") + @Schema(description = "GetSavingsAccountsTemplateResponse") public static final class GetSavingsAccountsTemplateResponse { private GetSavingsAccountsTemplateResponse() {} @@ -39,20 +38,20 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsProductOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "small business") + @Schema(example = "small business") public String clientName; public Set productOptions; } - @ApiModel(value = "GetSavingsAccountsResponse") + @Schema(description = "GetSavingsAccountsResponse") public static final class GetSavingsAccountsResponse { private GetSavingsAccountsResponse() {} @@ -65,23 +64,23 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } @@ -90,7 +89,7 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsTimeline() {} - @ApiModelProperty(example = "[2013, 3, 1]") + @Schema(example = "[2013, 3, 1]") public LocalDate submittedOnDate; } @@ -98,17 +97,17 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -116,48 +115,48 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") public String code; - @ApiModelProperty(example = "Daily") - public String value; + @Schema(example = "Daily") + public String description; } static final class GetSavingsInterestPostingPeriodType { private GetSavingsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetSavingsInterestCalculationType { private GetSavingsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetSavingsInterestCalculationDaysInYearType { private GetSavingsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetSavingsSummary { @@ -165,28 +164,28 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsSummary() {} public GetSavingsCurrency currency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer accountBalance; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public String accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "small business") + @Schema(example = "small business") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsProductId; - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetSavingsStatus status; public GetSavingsTimeline timeline; public GetSavingsCurrency currency; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Double nominalAnnualInterestRate; public GetSavingsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetSavingsInterestPostingPeriodType interestPostingPeriodType; @@ -195,44 +194,44 @@ final class SavingsAccountsApiResourceSwagger { public GetSavingsSummary summary; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "PostSavingsAccountsRequest") + @Schema(description = "PostSavingsAccountsRequest") public static final class PostSavingsAccountsRequest { private PostSavingsAccountsRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "01 March 2011") + @Schema(example = "01 March 2011") public String submittedOnDate; } - @ApiModel(value = "PostSavingsAccountsResponse") + @Schema(description = "PostSavingsAccountsResponse") public static final class PostSavingsAccountsResponse { private PostSavingsAccountsResponse() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "GetSavingsAccountsAccountIdResponse") + @Schema(description = "GetSavingsAccountsAccountIdResponse") public static final class GetSavingsAccountsAccountIdResponse { private GetSavingsAccountsAccountIdResponse() {} @@ -242,30 +241,30 @@ final class SavingsAccountsApiResourceSwagger { private GetSavingsAccountsSummary() {} public GetSavingsAccountsResponse.GetSavingsPageItems.GetSavingsCurrency currency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer accountBalance; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer availableBalance; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public String accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "small business") + @Schema(example = "small business") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsProductId; - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetSavingsAccountsResponse.GetSavingsPageItems.GetSavingsStatus status; public GetSavingsAccountsResponse.GetSavingsPageItems.GetSavingsTimeline timeline; public GetSavingsAccountsResponse.GetSavingsPageItems.GetSavingsCurrency currency; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Double nominalAnnualInterestRate; public GetSavingsAccountsResponse.GetSavingsPageItems.GetSavingsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetSavingsAccountsResponse.GetSavingsPageItems.GetSavingsInterestPostingPeriodType interestPostingPeriodType; @@ -274,18 +273,18 @@ final class SavingsAccountsApiResourceSwagger { public GetSavingsAccountsSummary summary; } - @ApiModel(value = "PutSavingsAccountsAccountIdRequest") + @Schema(description = "PutSavingsAccountsAccountIdRequest") public static final class PutSavingsAccountsAccountIdRequest { private PutSavingsAccountsAccountIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "5.9999999999") + @Schema(example = "5.9999999999") public Double nominalAnnualInterestRate; } - @ApiModel(value = "PutSavingsAccountsAccountIdResponse") + @Schema(description = "PutSavingsAccountsAccountIdResponse") public static final class PutSavingsAccountsAccountIdResponse { private PutSavingsAccountsAccountIdResponse() {} @@ -294,37 +293,37 @@ final class SavingsAccountsApiResourceSwagger { private PutSavingsAccountsChanges() {} - @ApiModelProperty(example = "5.9999999999") + @Schema(example = "5.9999999999") public Double nominalAnnualInterestRate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutSavingsAccountsChanges changes; } - @ApiModel(value = "PostSavingsAccountsAccountIdRequest") + @Schema(description = "PostSavingsAccountsAccountIdRequest") public static final class PostSavingsAccountsAccountIdRequest { private PostSavingsAccountsAccountIdRequest() {} - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "05 September 2014") + @Schema(example = "05 September 2014") public String unassignedDate; } - @ApiModel(value = "PostSavingsAccountsAccountIdResponse") + @Schema(description = "PostSavingsAccountsAccountIdResponse") public static final class PostSavingsAccountsAccountIdResponse { private PostSavingsAccountsAccountIdResponse() {} @@ -334,25 +333,25 @@ final class SavingsAccountsApiResourceSwagger { private PostSavingsAccountsAccountIdChanges() {} } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer clientId; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer resourceId; public PostSavingsAccountsAccountIdChanges changes; } - @ApiModel(value = "DeleteSavingsAccountsAccountIdResponse") + @Schema(description = "DeleteSavingsAccountsAccountIdResponse") public static final class DeleteSavingsAccountsAccountIdResponse { private DeleteSavingsAccountsAccountIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResource.java index d9dbc389f..ab8d4c25c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -83,10 +83,9 @@ import org.springframework.util.CollectionUtils; @Path("/savingsproducts") @Component @Scope("singleton") -@Api(tags = { "Savings Product" }) -@SwaggerDefinition(tags = { @Tag(name = "Savings Product", description = "An MFIs savings product offerings are modeled using this API." - + "\n" - + "When creating savings accounts, the details from the savings product are used to auto fill details of the savings account application process.") }) + +@Tag(name = "Savings Product", description = "An MFIs savings product offerings are modeled using this API." + "\n" + + "When creating savings accounts, the details from the savings product are used to auto fill details of the savings account application process.") public class SavingsProductsApiResource { private final SavingsProductReadPlatformService savingProductReadPlatformService; @@ -130,15 +129,14 @@ public class SavingsProductsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a Savings Product", httpMethod = "POST", notes = "Creates a Savings Product\n\n" + @Operation(summary = "Create a Savings Product", description = "Creates a Savings Product\n\n" + "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType,accountingRule\n\n" + "Mandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId\n\n" + "Optional Fields: minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, withdrawalFeeForTransfers, paymentChannelToFundSourceMappings, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, allowOverdraft, overdraftLimit, minBalanceForInterestCalculation,withHoldTax,taxGroupId") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsProductsApiResourceSwagger.PostSavingsProductsRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PostSavingsProductsRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsProductsApiResourceSwagger.PostSavingsProductsResponse.class) }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PostSavingsProductsResponse.class))) }) + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createSavingProduct().withJson(apiRequestBodyAsJson).build(); @@ -151,13 +149,12 @@ public class SavingsProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Savings Product", httpMethod = "PUT", notes = "Updates a Savings Product") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SavingsProductsApiResourceSwagger.PutSavingsProductsProductIdRequest.class) }) + @Operation(summary = "Update a Savings Product", description = "Updates a Savings Product") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PutSavingsProductsProductIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsProductsApiResourceSwagger.PutSavingsProductsProductIdResponse.class) }) - public String update(@PathParam("productId") @ApiParam(value = "productId") final Long productId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PutSavingsProductsProductIdResponse.class))) }) + public String update(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateSavingProduct(productId).withJson(apiRequestBodyAsJson) .build(); @@ -171,10 +168,10 @@ public class SavingsProductsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Savings Products", httpMethod = "GET", notes = "Lists Savings Products\n\n" + "Example Requests:\n" + "\n" + @Operation(summary = "List Savings Products", description = "Lists Savings Products\n\n" + "Example Requests:\n" + "\n" + "savingsproducts\n" + "\n" + "savingsproducts?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = SavingsProductsApiResourceSwagger.GetSavingsProductsResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.GetSavingsProductsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_PRODUCT_RESOURCE_NAME); @@ -189,12 +186,12 @@ public class SavingsProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Savings Product", httpMethod = "GET", notes = "Retrieves a Savings Product\n\n" - + "Example Requests:\n" + "\n" + "savingsproducts/1\n" + "\n" + "savingsproducts/1?template=true\n" + "\n" - + "savingsproducts/1?fields=name,description") + @Operation(summary = "Retrieve a Savings Product", description = "Retrieves a Savings Product\n\n" + "Example Requests:\n" + "\n" + + "savingsproducts/1\n" + "\n" + "savingsproducts/1?template=true\n" + "\n" + "savingsproducts/1?fields=name,description") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsProductsApiResourceSwagger.GetSavingsProductsProductIdResponse.class) }) - public String retrieveOne(@PathParam("productId") @ApiParam(value = "productId") final Long productId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.GetSavingsProductsProductIdResponse.class))) }) + public String retrieveOne(@PathParam("productId") @Parameter(description = "productId") final Long productId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_PRODUCT_RESOURCE_NAME); @@ -231,10 +228,10 @@ public class SavingsProductsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Savings Product Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "savingsproducts/template") + @Operation(summary = "Retrieve Savings Product Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "savingsproducts/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsProductsApiResourceSwagger.GetSavingsProductsTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.GetSavingsProductsTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_PRODUCT_RESOURCE_NAME); @@ -320,10 +317,10 @@ public class SavingsProductsApiResource { @Path("{productId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Savings Product", httpMethod = "DELETE", notes = "Deletes a Savings Product") + @Operation(summary = "Delete a Savings Product", description = "Deletes a Savings Product") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SavingsProductsApiResourceSwagger.DeleteSavingsProductsProductIdResponse.class) }) - public String delete(@PathParam("productId") @ApiParam(value = "productId") final Long productId) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.DeleteSavingsProductsProductIdResponse.class))) }) + public String delete(@PathParam("productId") @Parameter(description = "productId") final Long productId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSavingProduct(productId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResourceSwagger.java index e64fd2907..5f8a7ff7f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsProductsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.util.List; import java.util.Set; @@ -31,7 +30,7 @@ final class SavingsProductsApiResourceSwagger { private SavingsProductsApiResourceSwagger() {} - @ApiModel(value = "PostSavingsProductsRequest") + @Schema(description = "PostSavingsProductsRequest") public static final class PostSavingsProductsRequest { private PostSavingsProductsRequest() {} @@ -40,62 +39,62 @@ final class SavingsProductsApiResourceSwagger { private PostSavingsCharges() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; } - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String name; - @ApiModelProperty(example = "PBSV") + @Schema(example = "PBSV") public String shortName; - @ApiModelProperty(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") + @Schema(example = "Daily compounding using Daily Balance, 5% per year, 365 days in year") public String description; - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String currencyCode; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer digitsAfterDecimal; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "5.0") + @Schema(example = "5.0") public Double nominalAnnualInterestRate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCompoundingPeriodType; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer interestPostingPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCalculationType; - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer interestCalculationDaysInYearType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountingRule; public Set charges; } - @ApiModel(value = "PostSavingsProductsResponse") + @Schema(description = "PostSavingsProductsResponse") public static final class PostSavingsProductsResponse { private PostSavingsProductsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutSavingsProductsProductIdRequest") + @Schema(description = "PutSavingsProductsProductIdRequest") public static final class PutSavingsProductsProductIdRequest { private PutSavingsProductsProductIdRequest() {} - @ApiModelProperty(example = "Passbook Savings Lite.") + @Schema(example = "Passbook Savings Lite.") public String description; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "5.73") + @Schema(example = "5.73") public Double interestRate; } - @ApiModel(value = "PutSavingsProductsProductIdResponse") + @Schema(description = "PutSavingsProductsProductIdResponse") public static final class PutSavingsProductsProductIdResponse { private PutSavingsProductsProductIdResponse() {} @@ -104,20 +103,20 @@ final class SavingsProductsApiResourceSwagger { private PutSavingsChanges() {} - @ApiModelProperty(example = "Passbook Savings Lite.") + @Schema(example = "Passbook Savings Lite.") public String description; - @ApiModelProperty(example = "5.73") + @Schema(example = "5.73") public Double interestRate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutSavingsChanges changes; } - @ApiModel(value = "GetSavingsProductsResponse") + @Schema(description = "GetSavingsProductsResponse") public static final class GetSavingsProductsResponse { private GetSavingsProductsResponse() {} @@ -126,17 +125,17 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -144,83 +143,83 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") public String code; - @ApiModelProperty(example = "Daily") - public String value; + @Schema(example = "Daily") + public String description; } static final class GetSavingsProductsInterestPostingPeriodType { private GetSavingsProductsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetSavingsProductsInterestCalculationType { private GetSavingsProductsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetSavingsProductsInterestCalculationDaysInYearType { private GetSavingsProductsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetSavingsProductsAccountingRule { private GetSavingsProductsAccountingRule() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountingRuleType.cash") + @Schema(example = "accountingRuleType.cash") public String code; - @ApiModelProperty(example = "CASH BASED") - public String value; + @Schema(example = "CASH BASED") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Savings product") + @Schema(example = "Savings product") public String name; - @ApiModelProperty(example = "sa1") + @Schema(example = "sa1") public String shortName; - @ApiModelProperty(example = "gtasga") + @Schema(example = "gtasga") public String description; public GetSavingsCurrency currency; - @ApiModelProperty(example = "5.000000") + @Schema(example = "5.000000") public BigDecimal nominalAnnualInterestRate; public GetSavingsProductsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetSavingsProductsInterestPostingPeriodType interestPostingPeriodType; public GetSavingsProductsInterestCalculationType interestCalculationType; public GetSavingsProductsInterestCalculationDaysInYearType interestCalculationDaysInYearType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawalFeeForTransfers; public GetSavingsProductsAccountingRule accountingRule; } - @ApiModel(value = "GetSavingsProductsProductIdResponse") + @Schema(description = "GetSavingsProductsProductIdResponse") public static final class GetSavingsProductsProductIdResponse { private GetSavingsProductsProductIdResponse() {} @@ -233,11 +232,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsSavingsReferenceAccount() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "savings ref") + @Schema(example = "savings ref") public String name; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer glCode; } @@ -245,11 +244,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsIncomeFromFeeAccount() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "income from savings fee") + @Schema(example = "income from savings fee") public String name; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer glCode; } @@ -257,11 +256,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsIncomeFromPenaltyAccount() {} - @ApiModelProperty(example = "17") + @Schema(example = "17") public Integer id; - @ApiModelProperty(example = "income from sav penalties") + @Schema(example = "income from sav penalties") public String name; - @ApiModelProperty(example = "25") + @Schema(example = "25") public Integer glCode; } @@ -269,11 +268,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsInterestOnSavingsAccount() {} - @ApiModelProperty(example = "15") + @Schema(example = "15") public Integer id; - @ApiModelProperty(example = "interest on savings") + @Schema(example = "interest on savings") public String name; - @ApiModelProperty(example = "23") + @Schema(example = "23") public Integer glCode; } @@ -281,11 +280,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsSavingsControlAccount() {} - @ApiModelProperty(example = "13") + @Schema(example = "13") public Integer id; - @ApiModelProperty(example = "savings ref tool kit") + @Schema(example = "savings ref tool kit") public String name; - @ApiModelProperty(example = "21") + @Schema(example = "21") public Integer glCode; } @@ -293,11 +292,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsTransfersInSuspenseAccount() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer id; - @ApiModelProperty(example = "saving transfers") + @Schema(example = "saving transfers") public String name; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Integer glCode; } @@ -317,9 +316,9 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsPaymentType() {} - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer id; - @ApiModelProperty(example = "check") + @Schema(example = "check") public String name; } @@ -327,11 +326,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsFundSourceAccount() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "savings ref") + @Schema(example = "savings ref") public String name; - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer glCode; } @@ -347,13 +346,13 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsFeeToIncomeAccountMappingsCharge() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "sav charge") + @Schema(example = "sav charge") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } @@ -361,11 +360,11 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsFeeToIncomeAccountMappingsIncomeAccount() {} - @ApiModelProperty(example = "16") + @Schema(example = "16") public Integer id; - @ApiModelProperty(example = "income from savings fee") + @Schema(example = "income from savings fee") public String name; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer glCode; } @@ -381,13 +380,13 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsPenaltyToIncomeAccountMappingsCharge() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer id; - @ApiModelProperty(example = "sav 2") + @Schema(example = "sav 2") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; } @@ -395,33 +394,33 @@ final class SavingsProductsApiResourceSwagger { public GetSavingsProductsAccountingMappings.GetSavingsProductsIncomeFromPenaltyAccount incomeAccount; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savings product") + @Schema(example = "savings product") public String name; - @ApiModelProperty(example = "sa1") + @Schema(example = "sa1") public String shortName; - @ApiModelProperty(example = "gtasga") + @Schema(example = "gtasga") public String description; public GetSavingsProductsResponse.GetSavingsCurrency currency; - @ApiModelProperty(example = "5") + @Schema(example = "5") public BigDecimal nominalAnnualInterestRate; public GetSavingsProductsResponse.GetSavingsProductsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetSavingsProductsResponse.GetSavingsProductsInterestPostingPeriodType interestPostingPeriodType; public GetSavingsProductsResponse.GetSavingsProductsInterestCalculationType interestCalculationType; public GetSavingsProductsResponse.GetSavingsProductsInterestCalculationDaysInYearType interestCalculationDaysInYearType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawalFeeForTransfers; public GetSavingsProductsResponse.GetSavingsProductsAccountingRule accountingRule; public GetSavingsProductsAccountingMappings accountingMappings; public Set paymentChannelToFundSourceMappings; public Set feeToIncomeAccountMappings; public Set penaltyToIncomeAccountMappings; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public List charges; } - @ApiModel(value = "GetSavingsProductsTemplateResponse") + @Schema(description = "GetSavingsProductsTemplateResponse") public static final class GetSavingsProductsTemplateResponse { private GetSavingsProductsTemplateResponse() {} @@ -430,47 +429,47 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsTemplateAccountingRule() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountingRuleType.none") + @Schema(example = "accountingRuleType.none") public String code; - @ApiModelProperty(example = "NONE") - public String value; + @Schema(example = "NONE") + public String description; } static final class GetSavingsProductsLockinPeriodFrequencyTypeOptions { private GetSavingsProductsLockinPeriodFrequencyTypeOptions() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "savings.lockin.savingsPeriodFrequencyType.days") + @Schema(example = "savings.lockin.savingsPeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public String value; + @Schema(example = "Days") + public String description; } static final class GetSavingsProductsWithdrawalFeeTypeOptions { private GetSavingsProductsWithdrawalFeeTypeOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsWithdrawalFeesType.flat") + @Schema(example = "savingsWithdrawalFeesType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetSavingsProductsPaymentTypeOptions { private GetSavingsProductsPaymentTypeOptions() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer id; - @ApiModelProperty(example = "Wire Transfer") + @Schema(example = "Wire Transfer") public String name; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer position; } @@ -486,47 +485,47 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsLiabilityType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.liability") + @Schema(example = "accountType.liability") public String code; - @ApiModelProperty(example = "LIABILITY") - public String value; + @Schema(example = "LIABILITY") + public String description; } static final class GetSavingsProductsLiabilityUsage { private GetSavingsProductsLiabilityUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public String value; + @Schema(example = "DETAIL") + public String description; } static final class GetSavingsProductsLiabilityTagId { private GetSavingsProductsLiabilityTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; } - @ApiModelProperty(example = "15") + @Schema(example = "15") public Integer id; - @ApiModelProperty(example = "Savings Control") + @Schema(example = "Savings Control") public String name; - @ApiModelProperty(example = "50001") + @Schema(example = "50001") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetSavingsProductsLiabilityType type; public GetSavingsProductsLiabilityUsage usage; - @ApiModelProperty(example = "Savings Control") + @Schema(example = "Savings Control") public String nameDecorated; public GetSavingsProductsLiabilityTagId tagId; } @@ -539,12 +538,12 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsAssetLiabilityType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountType.asset") + @Schema(example = "accountType.asset") public String code; - @ApiModelProperty(example = "ASSET") - public String value; + @Schema(example = "ASSET") + public String description; } static final class GetSavingsAssetTagId { @@ -552,15 +551,15 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsAssetTagId() {} } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Cash") + @Schema(example = "Cash") public String name; - @ApiModelProperty(example = "100001") + @Schema(example = "100001") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetSavingsAssetLiabilityType type; public GetSavingsProductsLiabilityAccountOptions.GetSavingsProductsLiabilityUsage usage; @@ -575,23 +574,23 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsExpenseType() {} - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer id; - @ApiModelProperty(example = "accountType.expense") + @Schema(example = "accountType.expense") public String code; - @ApiModelProperty(example = "EXPENSE") - public String value; + @Schema(example = "EXPENSE") + public String description; } - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer id; - @ApiModelProperty(example = "Write Off Expenses") + @Schema(example = "Write Off Expenses") public String name; - @ApiModelProperty(example = "60001") + @Schema(example = "60001") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetSavingsProductsExpenseType type; public GetSavingsProductsLiabilityAccountOptions.GetSavingsProductsLiabilityUsage usage; @@ -606,23 +605,23 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsProductsIncomeType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "accountType.income") + @Schema(example = "accountType.income") public String code; - @ApiModelProperty(example = "INCOME") - public String value; + @Schema(example = "INCOME") + public String description; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "income from interest") + @Schema(example = "income from interest") public String name; - @ApiModelProperty(example = "40001") + @Schema(example = "40001") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetSavingsProductsIncomeType type; public GetSavingsProductsLiabilityAccountOptions.GetSavingsProductsLiabilityUsage usage; @@ -644,64 +643,64 @@ final class SavingsProductsApiResourceSwagger { private GetSavingsChargeTimeType() {} - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetSavingsProductsChargeAppliesTo { private GetSavingsProductsChargeAppliesTo() {} - @ApiModelProperty(example = "chargeAppliesTo.savings") + @Schema(example = "chargeAppliesTo.savings") public String code; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Savings") - public String value; + @Schema(example = "Savings") + public String description; } static final class GetSavingsChargeCalculationType { private GetSavingsChargeCalculationType() {} - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetSavingsChargePaymentMode { private GetSavingsChargePaymentMode() {} - @ApiModelProperty(example = "chargepaymentmode.regular") + @Schema(example = "chargepaymentmode.regular") public String code; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.regular") - public String value; + @Schema(example = "chargepaymentmode.regular") + public String description; } - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "200") + @Schema(example = "200") public Long amount; public GetSavingsProductsChargeAppliesTo chargeAppliesTo; public GetSavingsChargeCalculationType chargeCalculationType; public GetSavingsChargePaymentMode chargePaymentMode; public GetSavingsChargeTimeType chargeTimeType; public GetSavingsProductsResponse.GetSavingsCurrency currency; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "Savings charge 1") + @Schema(example = "Savings charge 1") public String name; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } @@ -724,12 +723,12 @@ final class SavingsProductsApiResourceSwagger { public Set chargeOptions; } - @ApiModel(value = "DeleteSavingsProductsProductIdResponse") + @Schema(description = "DeleteSavingsProductsProductIdResponse") public static final class DeleteSavingsProductsProductIdResponse { private DeleteSavingsProductsProductIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResource.java index 8ce2ab11b..c401ad5ee 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.portfolio.search.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import java.util.Set; import javax.ws.rs.Consumes; @@ -56,9 +55,7 @@ import org.springframework.stereotype.Component; @Path("/search") @Component @Scope("singleton") -@Api(tags = { "Search API" }) -@SwaggerDefinition(tags = { - @Tag(name = "Search API", description = "Search API allows to search scoped resources clients, loans and groups on specified fields.") }) +@Tag(name = "Search API", description = "Search API allows to search scoped resources clients, loans and groups on specified fields.") public class SearchApiResource { private final Set searchResponseParameters = SearchResponseParameters.getAllValues(); @@ -84,9 +81,9 @@ public class SearchApiResource { @Path("/template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrive Adhoc Search query template", httpMethod = "GET", notes = "Mandatory Fields\n" + "\n" - + "search?query=000000001\n") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SearchApiResourceSwagger.GetSearchResponse.class) }) + @Operation(summary = "Retrive Adhoc Search query template", description = "Mandatory Fields\n" + "\n" + "search?query=000000001\n") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SearchApiResourceSwagger.GetSearchResponse.class))) }) public String retrieveAdHocSearchQueryTemplate(@Context final UriInfo uriInfo) { final AdHocSearchQueryData templateData = this.searchReadPlatformService.retrieveAdHocQueryTemplate(); @@ -98,12 +95,13 @@ public class SearchApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Search Resources", notes = "Example Requests:\n" + "\n" + "search?query=000000001\n" + "\n" + "\n" + @Operation(summary = "Search Resources", description = "Example Requests:\n" + "\n" + "search?query=000000001\n" + "\n" + "\n" + "search?query=Petra&resource=clients,groups\n" + "\n" + "\n" + "search?query=Petra&resource=clients,groups&exactMatch=true") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SearchApiResourceSwagger.GetSearchResponse.class) }) - public String searchData(@Context final UriInfo uriInfo, @QueryParam("query") @ApiParam(value = "query") final String query, - @QueryParam("resource") @ApiParam(value = "resource") final String resource, - @DefaultValue("false") @QueryParam("exactMatch") @ApiParam(value = "exactMatch") Boolean exactMatch) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SearchApiResourceSwagger.GetSearchResponse.class))) }) + public String searchData(@Context final UriInfo uriInfo, @QueryParam("query") @Parameter(description = "query") final String query, + @QueryParam("resource") @Parameter(description = "resource") final String resource, + @DefaultValue("false") @QueryParam("exactMatch") @Parameter(description = "exactMatch") Boolean exactMatch) { final SearchConditions searchConditions = new SearchConditions(query, resource, exactMatch); @@ -117,16 +115,16 @@ public class SearchApiResource { @Path("/advance") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Adhoc query search", notes = "AdHocQuery search has more search options, it is a POST request, it uses request body to send search parameters\n" + @Operation(summary = "Adhoc query search", description = "AdHocQuery search has more search options, it is a POST request, it uses request body to send search parameters\n" + "\n" + "\n" + "Mandatory fields:" + "entities" + "\n" + "\n" + "Optional fields:" + "loanStatus, loanProducts, offices, loanDateOption, loanFromDate, loanToDate, \n" + "includeOutStandingAmountPercentage, outStandingAmountPercentageCondition, \n" + "minOutStandingAmountPercentage and maxOutStandingAmountPercentage OR outStandingAmountPercentage, \n" + "includeOutstandingAmount, outstandingAmountCondition, \n" + "minOutstandingAmount and maxOutstandingAmount OR outstandingAmount") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SearchApiResourceSwagger.PostAdhocQuerySearchRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SearchApiResourceSwagger.PostAdhocQuerySearchResponse.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SearchApiResourceSwagger.PostAdhocQuerySearchRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SearchApiResourceSwagger.PostAdhocQuerySearchResponse.class))) }) public String advancedSearch(@Context final UriInfo uriInfo, final String json) { final AdHocQuerySearchConditions searchConditions = this.fromApiJsonDeserializer.retrieveSearchConditions(json); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResourceSwagger.java index c0bd4b674..c16978e2e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/api/SearchApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.search.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.joda.time.LocalDate; @@ -32,77 +31,77 @@ final class SearchApiResourceSwagger { } - @ApiModel(value = "GetSearchResponse") + @Schema(description = "GetSearchResponse") public static final class GetSearchResponse { private GetSearchResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long entityId; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long entityAccountNo; - @ApiModelProperty(example = "ID_JKZGEXF") + @Schema(example = "ID_JKZGEXF") public String entityExternalId; - @ApiModelProperty(example = "Group_Name_HVCU5") + @Schema(example = "Group_Name_HVCU5") public String entityName; - @ApiModelProperty(example = "GROUP") + @Schema(example = "GROUP") public String entityType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long parentId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String parentName; public EnumOptionData entityStatus; } - @ApiModel(value = "PostAdhocQuerySearchRequest") + @Schema(description = "PostAdhocQuerySearchRequest") public static final class PostAdhocQuerySearchRequest { private PostAdhocQuerySearchRequest() { } - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "approvalDate") + @Schema(example = "approvalDate") public String loanDateOption; - @ApiModelProperty(example = "2013-01-01") + @Schema(example = "2013-01-01") public LocalDate loanFromDate; - @ApiModelProperty(example = "2014-01-27") + @Schema(example = "2014-01-27") public LocalDate loanToDate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean includeOutStandingAmountPercentage; - @ApiModelProperty(example = "<=") + @Schema(example = "<=") public String outStandingAmountPercentageCondition; - @ApiModelProperty(example = "80") + @Schema(example = "80") public Long outStandingAmountPercentage; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean includeOutstandingAmount; - @ApiModelProperty(example = "between") + @Schema(example = "between") public String outstandingAmountCondition; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Long minOutstandingAmount; - @ApiModelProperty(example = "10000") + @Schema(example = "10000") public Long maxOutstandingAmount; } - @ApiModel(value = "PostAdhocQuerySearchResponse") + @Schema(description = "PostAdhocQuerySearchResponse") public static final class PostAdhocQuerySearchResponse { private PostAdhocQuerySearchResponse() { } - @ApiModelProperty(example = "HFC") + @Schema(example = "HFC") public String officeName; - @ApiModelProperty(example = "01 BC3M") + @Schema(example = "01 BC3M") public String loanProductName; - @ApiModelProperty(example = " 5692.41") + @Schema(example = " 5692.41") public Long loanOutStanding; - @ApiModelProperty(example = "76.4") + @Schema(example = "76.4") public Long percentage; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResource.java index 068a3aacd..b3d4e4993 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.portfolio.self.account.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.math.BigDecimal; import java.util.Collection; import java.util.Map; @@ -61,8 +62,8 @@ import org.springframework.stereotype.Component; @Path("/self/accounttransfers") @Component @Scope("singleton") -@Api(tags = { "Self Account Transfer" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Account transfer", description = "") }) + +@Tag(name = "Self Account transfer", description = "") public class SelfAccountTransferApiResource { private final PlatformSecurityContext context; @@ -99,11 +100,12 @@ public class SelfAccountTransferApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Account Transfer Template", httpMethod = "GET", notes = "Returns list of loan/savings accounts that can be used for account transfer\n" + @Operation(summary = "Retrieve Account Transfer Template", description = "Returns list of loan/savings accounts that can be used for account transfer\n" + "\n" + "\n" + "Example Requests:\n" + "\n" + "self/accounttransfers/template\n") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = SelfAccountTransferApiResourceSwagger.GetAccountTransferTemplateResponse.class) }) - public String template(@DefaultValue("") @QueryParam("type") @ApiParam("type") final String type, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfAccountTransferApiResourceSwagger.GetAccountTransferTemplateResponse.class)))) }) + public String template(@DefaultValue("") @QueryParam("type") @Parameter(name = "type") final String type, + @Context final UriInfo uriInfo) { AppUser user = this.context.authenticatedUser(); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -121,11 +123,12 @@ public class SelfAccountTransferApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create new Transfer", httpMethod = "POST", notes = "Ability to create new transfer of monetary funds from one account to another.\n" + @Operation(summary = "Create new Transfer", description = "Ability to create new transfer of monetary funds from one account to another.\n" + "\n" + "\n" + "Example Requests:\n" + "\n" + " self/accounttransfers/\n") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = SelfAccountTransferApiResourceSwagger.PostNewTransferResponse.class) }) - public String create(@DefaultValue("") @QueryParam("type") @ApiParam("type") final String type, final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfAccountTransferApiResourceSwagger.PostNewTransferResponse.class)))) }) + public String create(@DefaultValue("") @QueryParam("type") @Parameter(name = "type") final String type, + final String apiRequestBodyAsJson) { Map params = this.dataValidator.validateCreate(type, apiRequestBodyAsJson); if (type.equals("tpt")) { checkForLimits(params); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResourceSwagger.java index f723c4041..cdda461cf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfAccountTransferApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.account.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -30,7 +29,7 @@ final class SelfAccountTransferApiResourceSwagger { private SelfAccountTransferApiResourceSwagger() {} - @ApiModel(value = "GetAccountTransferTemplateResponse") + @Schema(description = "GetAccountTransferTemplateResponse") public static final class GetAccountTransferTemplateResponse { private GetAccountTransferTemplateResponse() {} @@ -39,12 +38,12 @@ final class SelfAccountTransferApiResourceSwagger { private GetAccountOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } public Set accountTypeOptions; @@ -53,18 +52,18 @@ final class SelfAccountTransferApiResourceSwagger { private GetFromAccountOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer accountId; - @ApiModelProperty(example = "00000001") + @Schema(example = "00000001") public Integer accountNo; public GetAccountTransferTemplateResponse.GetAccountOptions accountType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "ABC") + @Schema(example = "ABC") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "HEAD OFFICE") + @Schema(example = "HEAD OFFICE") public String officeName; } @@ -75,18 +74,18 @@ final class SelfAccountTransferApiResourceSwagger { private GetToAccountOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer accountId; - @ApiModelProperty(example = "00000001") + @Schema(example = "00000001") public Integer accountNo; public GetAccountTransferTemplateResponse.GetAccountOptions accountType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "ABC") + @Schema(example = "ABC") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "HEAD OFFICE") + @Schema(example = "HEAD OFFICE") public String officeName; } @@ -94,48 +93,48 @@ final class SelfAccountTransferApiResourceSwagger { public Set toAccountTypeOptions; } - @ApiModel(value = "PostNewTransferRequest") + @Schema(description = "PostNewTransferRequest") public static final class PostNewTransferRequest { private PostNewTransferRequest() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer fromAccountType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer fromAccountId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer toClientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toAccountType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer toAccountId; - @ApiModelProperty(example = "dd MMMM YYYY") + @Schema(example = "dd MMMM YYYY") public String dateFormat; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "01 August 2011") + @Schema(example = "01 August 2011") public String transferDate; - @ApiModelProperty(example = "112.45") + @Schema(example = "112.45") public Float transferAmount; - @ApiModelProperty(example = "A description of the transfer") + @Schema(example = "A description of the transfer") public String transferDescription; } - @ApiModel(value = "PostNewTransferResponse") + @Schema(description = "PostNewTransferResponse") public static final class PostNewTransferResponse { private PostNewTransferResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResource.java index c45e8078a..bea11e1ea 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.self.account.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -62,8 +62,8 @@ import org.springframework.stereotype.Component; @Path("/self/beneficiaries/tpt") @Component @Scope("singleton") -@Api(tags = { "Self Third Party Transfer" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Third Party Transfer", description = "") }) + +@Tag(name = "Self Third Party Transfer", description = "") public class SelfBeneficiariesTPTApiResource { private final PlatformSecurityContext context; @@ -93,10 +93,10 @@ public class SelfBeneficiariesTPTApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Beneficiary Third Party Transfer Template", httpMethod = "GET", notes = "Returns Account Type enumerations. Self User is expected to know office name and account number to be able to add beneficiary.\n" + @Operation(summary = "Beneficiary Third Party Transfer Template", description = "Returns Account Type enumerations. Self User is expected to know office name and account number to be able to add beneficiary.\n" + "\n" + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt/template") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfBeneficiariesTPTApiResourceSwagger.GetSelfBeneficiariesTPTTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.GetSelfBeneficiariesTPTTemplateResponse.class))) }) public String template(@Context final UriInfo uriInfo) { final EnumOptionData loanAccountType = AccountTransferEnumerations.accountType(PortfolioAccountType.LOAN); @@ -113,17 +113,16 @@ public class SelfBeneficiariesTPTApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Add TPT Beneficiary", httpMethod = "POST", notes = "Api to add third party beneficiary linked to current user.\n" - + "\n" + "Parameter Definitions\n" + "\n" + "name : Nick name for beneficiary, should be unique for an self service user\n" - + "\n" + "officeName : Office Name of beneficiary(not id)\n" + "\n" + "accountNumber : Account Number of beneficiary(not id)\n" - + "\n" + "transferLimit : Each transfer initiated to this account will not exceed this amount\n" + "\n" + "Example Requests:\n" - + "\n" + "/self/beneficiaries/tpt\n\n" + "Mandatory Fields: name, officeName, accountNumber, accountType\n\n" + @Operation(summary = "Add TPT Beneficiary", description = "Api to add third party beneficiary linked to current user.\n" + "\n" + + "Parameter Definitions\n" + "\n" + "name : Nick name for beneficiary, should be unique for an self service user\n" + "\n" + + "officeName : Office Name of beneficiary(not id)\n" + "\n" + "accountNumber : Account Number of beneficiary(not id)\n" + "\n" + + "transferLimit : Each transfer initiated to this account will not exceed this amount\n" + "\n" + "Example Requests:\n" + "\n" + + "/self/beneficiaries/tpt\n\n" + "Mandatory Fields: name, officeName, accountNumber, accountType\n\n" + "Optional Fields: transferLimit") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SelfBeneficiariesTPTApiResourceSwagger.PostSelfBeneficiariesTPTRequest.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.PostSelfBeneficiariesTPTRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfBeneficiariesTPTApiResourceSwagger.PostSelfBeneficiariesTPTResponse.class) }) - public String add(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.PostSelfBeneficiariesTPTResponse.class))) }) + public String add(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().addSelfServiceBeneficiaryTPT().withJson(apiRequestBodyAsJson) .build(); @@ -135,14 +134,13 @@ public class SelfBeneficiariesTPTApiResource { @Path("{beneficiaryId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update TPT Beneficiary", httpMethod = "PUT", notes = "Api to update third party beneficiary linked to current user.\n" - + "\n" + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt/{beneficiaryId}\n\n" + "Optional Fields: name, transferLimit") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SelfBeneficiariesTPTApiResourceSwagger.PutSelfBeneficiariesTPTBeneficiaryIdRequest.class) }) + @Operation(summary = "Update TPT Beneficiary", description = "Api to update third party beneficiary linked to current user.\n" + "\n" + + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt/{beneficiaryId}\n\n" + "Optional Fields: name, transferLimit") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.PutSelfBeneficiariesTPTBeneficiaryIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfBeneficiariesTPTApiResourceSwagger.PutSelfBeneficiariesTPTBeneficiaryIdResponse.class) }) - public String update(@PathParam("beneficiaryId") @ApiParam(value = "beneficiaryId") final Long beneficiaryId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.PutSelfBeneficiariesTPTBeneficiaryIdResponse.class))) }) + public String update(@PathParam("beneficiaryId") @Parameter(description = "beneficiaryId") final Long beneficiaryId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateSelfServiceBeneficiaryTPT(beneficiaryId) .withJson(apiRequestBodyAsJson).build(); @@ -154,11 +152,12 @@ public class SelfBeneficiariesTPTApiResource { @Path("{beneficiaryId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete TPT Beneficiary", httpMethod = "DELETE", notes = "Api to delete third party beneficiary linked to current user.\n" - + "\n" + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt/{beneficiaryId}") + @Operation(summary = "Delete TPT Beneficiary", description = "Api to delete third party beneficiary linked to current user.\n" + "\n" + + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt/{beneficiaryId}") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfBeneficiariesTPTApiResourceSwagger.DeleteSelfBeneficiariesTPTBeneficiaryIdResponse.class) }) - public String delete(@PathParam("beneficiaryId") final Long beneficiaryId, @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.DeleteSelfBeneficiariesTPTBeneficiaryIdResponse.class))) }) + public String delete(@PathParam("beneficiaryId") final Long beneficiaryId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSelfServiceBeneficiaryTPT(beneficiaryId) .withJson(apiRequestBodyAsJson).build(); @@ -169,10 +168,10 @@ public class SelfBeneficiariesTPTApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Get All TPT Beneficiary", httpMethod = "GET", notes = "Api to get all third party beneficiary linked to current user.\n" - + "\n" + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt") + @Operation(summary = "Get All TPT Beneficiary", description = "Api to get all third party beneficiary linked to current user.\n" + "\n" + + "Example Requests:\n" + "\n" + "/self/beneficiaries/tpt") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfBeneficiariesTPTApiResourceSwagger.GetSelfBeneficiariesTPTResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfBeneficiariesTPTApiResourceSwagger.GetSelfBeneficiariesTPTResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SelfBeneficiariesTPTApiConstants.BENEFICIARY_ENTITY_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResourceSwagger.java index 7ed1ab0e9..279b65f54 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/api/SelfBeneficiariesTPTApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.account.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -29,7 +28,7 @@ final class SelfBeneficiariesTPTApiResourceSwagger { private SelfBeneficiariesTPTApiResourceSwagger() {} - @ApiModel(value = "GetSelfBeneficiariesTPTTemplateResponse") + @Schema(description = "GetSelfBeneficiariesTPTTemplateResponse") public static final class GetSelfBeneficiariesTPTTemplateResponse { private GetSelfBeneficiariesTPTTemplateResponse() {} @@ -38,57 +37,57 @@ final class SelfBeneficiariesTPTApiResourceSwagger { private GetSelfBeneficiariesAccountOptions() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.savings") + @Schema(example = "accountType.savings") public String code; - @ApiModelProperty(example = "Savings Account") - public String value; + @Schema(example = "Savings Account") + public String description; } public Set accountTypeOptions; } - @ApiModel(value = "PostSelfBeneficiariesTPTRequest") + @Schema(description = "PostSelfBeneficiariesTPTRequest") public static final class PostSelfBeneficiariesTPTRequest { private PostSelfBeneficiariesTPTRequest() {} - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "beneficiary nick name") + @Schema(example = "beneficiary nick name") public String name; - @ApiModelProperty(example = "HEAD OFFICE") + @Schema(example = "HEAD OFFICE") public String officeName; - @ApiModelProperty(example = "0000001") + @Schema(example = "0000001") public Long accountNumber; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountType; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer transferLimit; } - @ApiModel(value = "PostSelfBeneficiariesTPTResponse") + @Schema(description = "PostSelfBeneficiariesTPTResponse") public static final class PostSelfBeneficiariesTPTResponse { private PostSelfBeneficiariesTPTResponse() {} - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer resourceId; } - @ApiModel(value = "PutSelfBeneficiariesTPTBeneficiaryIdRequest") + @Schema(description = "PutSelfBeneficiariesTPTBeneficiaryIdRequest") public static final class PutSelfBeneficiariesTPTBeneficiaryIdRequest { private PutSelfBeneficiariesTPTBeneficiaryIdRequest() {} - @ApiModelProperty(example = "beneficiary nick name") + @Schema(example = "beneficiary nick name") public String name; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer transferLimit; } - @ApiModel(value = "PutSelfBeneficiariesTPTBeneficiaryIdResponse") + @Schema(description = "PutSelfBeneficiariesTPTBeneficiaryIdResponse") public static final class PutSelfBeneficiariesTPTBeneficiaryIdResponse { private PutSelfBeneficiariesTPTBeneficiaryIdResponse() {} @@ -97,43 +96,43 @@ final class SelfBeneficiariesTPTApiResourceSwagger { private PutSelfBeneficiariesChanges() {} - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer transferLimit; - @ApiModelProperty(example = "Client22") + @Schema(example = "Client22") public String name; } - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer resourceId; public PutSelfBeneficiariesChanges changes; } - @ApiModel(value = "DeleteSelfBeneficiariesTPTBeneficiaryIdResponse") + @Schema(description = "DeleteSelfBeneficiariesTPTBeneficiaryIdResponse") public static final class DeleteSelfBeneficiariesTPTBeneficiaryIdResponse { private DeleteSelfBeneficiariesTPTBeneficiaryIdResponse() {} - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer resourceId; } - @ApiModel(value = "GetSelfBeneficiariesTPTResponse") + @Schema(description = "GetSelfBeneficiariesTPTResponse") public static final class GetSelfBeneficiariesTPTResponse { private GetSelfBeneficiariesTPTResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Client2Savings") + @Schema(example = "Client2Savings") public String name; - @ApiModelProperty(example = "Test Office") + @Schema(example = "Test Office") public String officeName; - @ApiModelProperty(example = "FN2 LN2") + @Schema(example = "FN2 LN2") public String clientName; public GetSelfBeneficiariesTPTTemplateResponse.GetSelfBeneficiariesAccountOptions accountType; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Long accountNumber; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer transferLimit; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResource.java index 49744f916..a7efcbdbd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResource.java @@ -21,13 +21,13 @@ package org.apache.fineract.portfolio.self.client.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataBodyPart; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -60,8 +60,8 @@ import org.springframework.stereotype.Component; @Path("/self/clients") @Component @Scope("singleton") -@Api(tags = { "Self Client" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Client", description = "") }) + +@Tag(name = "Self Client", description = "") public class SelfClientsApiResource { private final PlatformSecurityContext context; @@ -89,18 +89,19 @@ public class SelfClientsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Clients associated to the user", httpMethod = "GET", notes = "The list capability of clients can support pagination and sorting.\n\n" + @Operation(summary = "List Clients associated to the user", description = "The list capability of clients can support pagination and sorting.\n\n" + "Example Requests:\n" + "\n" + "self/clients\n" + "\n" + "self/clients?fields=displayName,officeName\n" + "\n" + "self/clients?offset=10&limit=50\n" + "\n" + "self/clients?orderBy=displayName&sortOrder=DESC") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, - @QueryParam("displayName") @ApiParam(value = "displayName") final String displayName, - @QueryParam("firstName") @ApiParam(value = "firstName") final String firstname, - @QueryParam("lastName") @ApiParam(value = "lastName") final String lastname, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("orderBy") @ApiParam(value = "orderBy") final String orderBy, - @QueryParam("sortOrder") @ApiParam(value = "sortOrder") final String sortOrder) { + @QueryParam("displayName") @Parameter(description = "displayName") final String displayName, + @QueryParam("firstName") @Parameter(description = "firstName") final String firstname, + @QueryParam("lastName") @Parameter(description = "lastName") final String lastname, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("orderBy") @Parameter(description = "orderBy") final String orderBy, + @QueryParam("sortOrder") @Parameter(description = "sortOrder") final String sortOrder) { final String sqlSearch = null; final Long officeId = null; @@ -115,11 +116,12 @@ public class SelfClientsApiResource { @Path("{clientId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client", httpMethod = "GET", notes = "Retrieves a Client\n\n" + "Example Requests:\n" + "\n" - + "self/clients/1\n" + "\n" + "self/clients/1?fields=id,displayName,officeName") + @Operation(summary = "Retrieve a Client", description = "Retrieves a Client\n\n" + "Example Requests:\n" + "\n" + "self/clients/1\n" + + "\n" + "self/clients/1?fields=id,displayName,officeName") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsClientIdResponse.class) }) - public String retrieveOne(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsClientIdResponse.class))) }) + public String retrieveOne(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @Context final UriInfo uriInfo) { this.dataValidator.validateRetrieveOne(uriInfo); @@ -133,12 +135,12 @@ public class SelfClientsApiResource { @Path("{clientId}/accounts") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve client accounts overview", httpMethod = "GET", notes = "An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application.\n" + @Operation(summary = "Retrieve client accounts overview", description = "An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application.\n" + "It is quite reasonable to add resources like this to simplify User Interface development.\n" + "\n" + "Example Requests:\n" + "\n" + "self/clients/1/accounts\n" + "\n" + "\n" + "self/clients/1/accounts?fields=loanAccounts,savingsAccounts") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsClientIdAccountsResponse.class) }) - public String retrieveAssociatedAccounts(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsClientIdAccountsResponse.class))) }) + public String retrieveAssociatedAccounts(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @Context final UriInfo uriInfo) { validateAppuserClientsMapping(clientId); @@ -150,13 +152,13 @@ public class SelfClientsApiResource { @Path("{clientId}/images") @Consumes({ MediaType.TEXT_PLAIN, MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.TEXT_PLAIN }) - @ApiOperation(value = "Retrieve Client Image", httpMethod = "GET", notes = "Optional arguments are identical to those of Get Image associated with an Entity (Binary file)\n" + @Operation(summary = "Retrieve Client Image", description = "Optional arguments are identical to those of Get Image associated with an Entity (Binary file)\n" + "\n" + "Example Requests:\n" + "\n" + "self/clients/1/images") - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) - public Response retrieveImage(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("maxWidth") @ApiParam(example = "maxWidth") final Integer maxWidth, - @QueryParam("maxHeight") @ApiParam(example = "maxHeight") final Integer maxHeight, - @QueryParam("output") @ApiParam(example = "output") final String output) { + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + public Response retrieveImage(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("maxWidth") @Parameter(example = "maxWidth") final Integer maxWidth, + @QueryParam("maxHeight") @Parameter(example = "maxHeight") final Integer maxHeight, + @QueryParam("output") @Parameter(example = "output") final String output) { validateAppuserClientsMapping(clientId); @@ -167,15 +169,15 @@ public class SelfClientsApiResource { @Path("{clientId}/charges") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Client Charges", httpMethod = "GET", notes = "The list capability of client charges supports pagination.\n\n" + @Operation(summary = "List Client Charges", description = "The list capability of client charges supports pagination.\n\n" + "Example Requests:\n" + "\n" + "self/clients/1/charges\n\n" + "self/clients/1/charges?offset=0&limit=5") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsClientIdChargesResponse.class) }) - public String retrieveAllClientCharges(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @DefaultValue(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS_VALUE_ALL) @QueryParam(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS) @ApiParam(value = "chargeStatus") final String chargeStatus, - @QueryParam("pendingPayment") @ApiParam(value = "pendingPayment") final Boolean pendingPayment, @Context final UriInfo uriInfo, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit, - @QueryParam("offset") @ApiParam(value = "offset") final Integer offset) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsClientIdChargesResponse.class))) }) + public String retrieveAllClientCharges(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @DefaultValue(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS_VALUE_ALL) @QueryParam(ClientApiConstants.CLIENT_CHARGE_QUERY_PARAM_STATUS) @Parameter(description = "chargeStatus") final String chargeStatus, + @QueryParam("pendingPayment") @Parameter(description = "pendingPayment") final Boolean pendingPayment, + @Context final UriInfo uriInfo, @QueryParam("limit") @Parameter(description = "limit") final Integer limit, + @QueryParam("offset") @Parameter(description = "offset") final Integer offset) { validateAppuserClientsMapping(clientId); @@ -186,12 +188,12 @@ public class SelfClientsApiResource { @Path("{clientId}/charges/{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client Charge", httpMethod = "GET", notes = "Retrieves a Client Charge\n\n" + "Example Requests:\n" - + "\n" + "self/clients/1/charges/1\n" + "\n" + "\n" + "self/clients/1/charges/1?fields=name,id") + @Operation(summary = "Retrieve a Client Charge", description = "Retrieves a Client Charge\n\n" + "Example Requests:\n" + "\n" + + "self/clients/1/charges/1\n" + "\n" + "\n" + "self/clients/1/charges/1?fields=name,id") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsClientIdChargesChargeIdResponse.class) }) - public String retrieveClientCharge(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long chargeId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsClientIdChargesChargeIdResponse.class))) }) + public String retrieveClientCharge(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId, @Context final UriInfo uriInfo) { this.dataValidator.validateClientCharges(uriInfo); @@ -204,13 +206,13 @@ public class SelfClientsApiResource { @Path("{clientId}/transactions") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Client Transactions", httpMethod = "GET", notes = "The list capability of client transaction can support pagination.\n\n" + @Operation(summary = "List Client Transactions", description = "The list capability of client transaction can support pagination.\n\n" + "Example Requests:\n" + "\n" + "self/clients/189/transactions\n\n" + "self/clients/189/transactions?offset=10&limit=50") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsClientIdTransactionsResponse.class) }) - public String retrieveAllClientTransactions(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @Context final UriInfo uriInfo, @QueryParam("offset") @ApiParam(value = "offset") final Integer offset, - @QueryParam("limit") @ApiParam(value = "limit") final Integer limit) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsClientIdTransactionsResponse.class))) }) + public String retrieveAllClientTransactions(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @Context final UriInfo uriInfo, @QueryParam("offset") @Parameter(description = "offset") final Integer offset, + @QueryParam("limit") @Parameter(description = "limit") final Integer limit) { validateAppuserClientsMapping(clientId); @@ -221,13 +223,13 @@ public class SelfClientsApiResource { @Path("{clientId}/transactions/{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Client Transaction", httpMethod = "GET", notes = "Retrieves a Client Transaction" - + "Example Requests:\n" + "\n" + "self/clients/1/transactions/1\n" + "\n" + "\n" - + "self/clients/1/transactions/1?fields=id,officeName") + @Operation(summary = "Retrieve a Client Transaction", description = "Retrieves a Client Transaction" + "Example Requests:\n" + "\n" + + "self/clients/1/transactions/1\n" + "\n" + "\n" + "self/clients/1/transactions/1?fields=id,officeName") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfClientsApiResourceSwagger.GetSelfClientsClientIdTransactionsTransactionIdResponse.class) }) - public String retrieveClientTransaction(@PathParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfClientsApiResourceSwagger.GetSelfClientsClientIdTransactionsTransactionIdResponse.class))) }) + public String retrieveClientTransaction(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Context final UriInfo uriInfo) { validateAppuserClientsMapping(clientId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResourceSwagger.java index ff207cf6c..948b00222 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/client/api/SelfClientsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.client.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.List; import java.util.Set; @@ -32,7 +31,7 @@ final class SelfClientsApiResourceSwagger { private SelfClientsApiResourceSwagger() {} - @ApiModel(value = "GetSelfClientsResponse") + @Schema(description = "GetSelfClientsResponse") public static final class GetSelfClientsResponse { private GetSelfClientsResponse() {} @@ -45,39 +44,39 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "clientStatusType.active") + @Schema(example = "clientStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; + @Schema(example = "Active") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; public GetSelfClientsStatus status; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "[2013, 3, 1]") + @Schema(example = "[2013, 3, 1]") public LocalDate activationDate; - @ApiModelProperty(example = "Small shop") + @Schema(example = "Small shop") public String fullname; - @ApiModelProperty(example = "Small shop") + @Schema(example = "Small shop") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetSelfClientsClientIdResponse") + @Schema(description = "GetSelfClientsClientIdResponse") public static final class GetSelfClientsClientIdResponse { private GetSelfClientsClientIdResponse() {} @@ -86,54 +85,54 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsTimeline() {} - @ApiModelProperty(example = "[2013, 1, 1]") + @Schema(example = "[2013, 1, 1]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; - @ApiModelProperty(example = "[2013, 1, 1]") + @Schema(example = "[2013, 1, 1]") public LocalDate activatedOnDate; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String activatedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String activatedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String activatedByLastname; } - @ApiModelProperty(example = "27") + @Schema(example = "27") public Integer id; - @ApiModelProperty(example = "000000027") + @Schema(example = "000000027") public Long accountNo; public GetSelfClientsResponse.GetSelfClientsPageItems.GetSelfClientsStatus status; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "[2013, 1, 1]") + @Schema(example = "[2013, 1, 1]") public LocalDate activationDate; - @ApiModelProperty(example = "savings") + @Schema(example = "savings") public String firstname; - @ApiModelProperty(example = "test") + @Schema(example = "test") public String lastname; - @ApiModelProperty(example = "savings test") + @Schema(example = "savings test") public String displayName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetSelfClientsTimeline timeline; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer savingsProductId; - @ApiModelProperty(example = "account overdraft") + @Schema(example = "account overdraft") public String savingsProductName; - @ApiModelProperty(example = "") + @Schema(example = "") public List groups; } - @ApiModel(value = "GetSelfClientsClientIdAccountsResponse") + @Schema(description = "GetSelfClientsClientIdAccountsResponse") public static final class GetSelfClientsClientIdAccountsResponse { private GetSelfClientsClientIdAccountsResponse() {} @@ -146,27 +145,27 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsLoanAccountsStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "loanStatusType.active") + @Schema(example = "loanStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Active") + public String description; + @Schema(example = "false") public Boolean pendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } @@ -174,27 +173,27 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsLoanAccountsType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "loanType.individual") + @Schema(example = "loanType.individual") public String code; - @ApiModelProperty(example = "Individual") - public String value; + @Schema(example = "Individual") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "456") + @Schema(example = "456") public Integer externalId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "TestOne") + @Schema(example = "TestOne") public String productName; public GetSelfClientsLoanAccountsStatus status; public GetSelfClientsLoanAccountsType loanType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanCycle; } @@ -206,17 +205,17 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsSavingsAccountsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -224,33 +223,33 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsSavingsAccountsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer id; - @ApiModelProperty(example = "000000007") + @Schema(example = "000000007") public Long accountNo; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer productId; - @ApiModelProperty(example = "Other product") + @Schema(example = "Other product") public String productName; public GetSelfClientsSavingsAccountsStatus status; public GetSelfClientsSavingsAccountsCurrency currency; @@ -260,7 +259,7 @@ final class SelfClientsApiResourceSwagger { public Set savingsAccounts; } - @ApiModel(value = "GetSelfClientsClientIdChargesResponse") + @Schema(description = "GetSelfClientsClientIdChargesResponse") public static final class GetSelfClientsClientIdChargesResponse { private GetSelfClientsClientIdChargesResponse() {} @@ -273,103 +272,103 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsChargeTimeType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetSelfClientsChargeCalculationType { private GetSelfClientsChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer chargeId; - @ApiModelProperty(example = "Client Fees 2") + @Schema(example = "Client Fees 2") public String name; public GetSelfClientsChargeTimeType chargeTimeType; - @ApiModelProperty(example = "[2015, 9, 1]") + @Schema(example = "[2015, 9, 1]") public LocalDate dueDate; public GetSelfClientsChargeCalculationType chargeCalculationType; public GetSelfClientsClientIdAccountsResponse.GetSelfClientsSavingsAccounts.GetSelfClientsSavingsAccountsCurrency currency; - @ApiModelProperty(example = "550") + @Schema(example = "550") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "550") + @Schema(example = "550") public Float amountOutstanding; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isPaid; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isWaived; } - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetSelfClientsClientIdChargesChargeIdResponse") + @Schema(description = "GetSelfClientsClientIdChargesChargeIdResponse") public static final class GetSelfClientsClientIdChargesChargeIdResponse { private GetSelfClientsClientIdChargesChargeIdResponse() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Integer chargeId; - @ApiModelProperty(example = "Client Fee 1") + @Schema(example = "Client Fee 1") public String name; public GetSelfClientsClientIdChargesResponse.GetSelfClientsChargesPageItems.GetSelfClientsChargeTimeType chargeTimeType; - @ApiModelProperty(example = "[2015, 8, 17]") + @Schema(example = "[2015, 8, 17]") public LocalDate dueDate; public GetSelfClientsClientIdChargesResponse.GetSelfClientsChargesPageItems.GetSelfClientsChargeCalculationType chargeCalculationType; public GetSelfClientsClientIdAccountsResponse.GetSelfClientsSavingsAccounts.GetSelfClientsSavingsAccountsCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountOutstanding; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isActive; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isPaid; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isWaived; } - @ApiModel(value = "GetSelfClientsClientIdTransactionsResponse") + @Schema(description = "GetSelfClientsClientIdTransactionsResponse") public static final class GetSelfClientsClientIdTransactionsResponse { private GetSelfClientsClientIdTransactionsResponse() {} @@ -382,57 +381,57 @@ final class SelfClientsApiResourceSwagger { private GetSelfClientsClientIdTransactionsType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "clientTransactionType.payCharge") + @Schema(example = "clientTransactionType.payCharge") public String code; - @ApiModelProperty(example = "PAY_CHARGE") - public String value; + @Schema(example = "PAY_CHARGE") + public String description; } - @ApiModelProperty(example = "226") + @Schema(example = "226") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetSelfClientsClientIdTransactionsType type; - @ApiModelProperty(example = "[2015, 9, 2]") + @Schema(example = "[2015, 9, 2]") public LocalDate date; public GetSelfClientsClientIdAccountsResponse.GetSelfClientsSavingsAccounts.GetSelfClientsSavingsAccountsCurrency currency; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Double amount; - @ApiModelProperty(example = "[2015, 9, 2]") + @Schema(example = "[2015, 9, 2]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean reversed; } - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer totalFilteredRecords; public Set pageItems; } - @ApiModel(value = "GetSelfClientsClientIdTransactionsTransactionIdResponse") + @Schema(description = "GetSelfClientsClientIdTransactionsTransactionIdResponse") public static final class GetSelfClientsClientIdTransactionsTransactionIdResponse { private GetSelfClientsClientIdTransactionsTransactionIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; public GetSelfClientsClientIdTransactionsResponse.GetSelfClientsClientIdTransactionsPageItems.GetSelfClientsClientIdTransactionsType type; - @ApiModelProperty(example = "[2015, 8, 17]") + @Schema(example = "[2015, 8, 17]") public LocalDate date; public GetSelfClientsClientIdAccountsResponse.GetSelfClientsSavingsAccounts.GetSelfClientsSavingsAccountsCurrency currency; - @ApiModelProperty(example = "60.000000") + @Schema(example = "60.000000") public Float amount; - @ApiModelProperty(example = "[2015, 8, 19]") + @Schema(example = "[2015, 8, 19]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean reversed; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResource.java index c8b380a0b..a601b003f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.self.loanaccount.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.HashMap; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -61,8 +61,8 @@ import org.springframework.stereotype.Component; @Path("/self/loans") @Component @Scope("singleton") -@Api(tags = { "Self Loans" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Loans", description = "") }) + +@Tag(name = "Self Loans", description = "") public class SelfLoansApiResource { private final PlatformSecurityContext context; @@ -94,11 +94,12 @@ public class SelfLoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Loan", httpMethod = "GET", notes = "Retrieves a Loan\n\n" + "Example Requests:\n" + "\n" - + "self/loans/1\n" + "\n" + "\n" + "self/loans/1?fields=id,principal,annualInterestRate\n" + "\n" + "\n" + @Operation(summary = "Retrieve a Loan", description = "Retrieves a Loan\n\n" + "Example Requests:\n" + "\n" + "self/loans/1\n" + "\n" + + "\n" + "self/loans/1?fields=id,principal,annualInterestRate\n" + "\n" + "\n" + "self/loans/1?fields=id,principal,annualInterestRate&associations=repaymentSchedule,transactions") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdResponse.class) }) - public String retrieveLoan(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdResponse.class))) }) + public String retrieveLoan(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @Context final UriInfo uriInfo) { this.dataValidator.validateRetrieveLoan(uriInfo); @@ -112,12 +113,13 @@ public class SelfLoansApiResource { @Path("{loanId}/transactions/{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Loan Transaction Details", httpMethod = "GET", notes = "Retrieves a Loan Transaction Details" - + "Example Request:\n" + "\n" + "self/loans/5/transactions/3") + @Operation(summary = "Retrieve a Loan Transaction Details", description = "Retrieves a Loan Transaction Details" + "Example Request:\n" + + "\n" + "self/loans/5/transactions/3") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdTransactionsTransactionIdResponse.class) }) - public String retrieveTransaction(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdTransactionsTransactionIdResponse.class))) }) + public String retrieveTransaction(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Context final UriInfo uriInfo) { this.dataValidator.validateRetrieveTransaction(uriInfo); @@ -130,11 +132,11 @@ public class SelfLoansApiResource { @Path("{loanId}/charges") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Loan Charges", httpMethod = "GET", notes = "Lists loan Charges\n\n" + "Example Requests:\n" + "\n" + @Operation(summary = "List Loan Charges", description = "Lists loan Charges\n\n" + "Example Requests:\n" + "\n" + "self/loans/1/charges\n" + "\n" + "\n" + "self/loans/1/charges?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdChargesResponse.class, responseContainer = "List") }) - public String retrieveAllLoanCharges(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdChargesResponse.class)))) }) + public String retrieveAllLoanCharges(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @Context final UriInfo uriInfo) { validateAppuserLoanMapping(loanId); @@ -146,12 +148,12 @@ public class SelfLoansApiResource { @Path("{loanId}/charges/{chargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Loan Charge", httpMethod = "GET", notes = "Retrieves a Loan Charge\n\n" + "Example Requests:\n" + "\n" + @Operation(summary = "Retrieve a Loan Charge", description = "Retrieves a Loan Charge\n\n" + "Example Requests:\n" + "\n" + "self/loans/1/charges/1\n" + "\n" + "\n" + "self/loans/1/charges/1?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdChargesResponse.class) }) - public String retrieveLoanCharge(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @PathParam("chargeId") @ApiParam(value = "chargeId") final Long loanChargeId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.GetSelfLoansLoanIdChargesResponse.class))) }) + public String retrieveLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @PathParam("chargeId") @Parameter(description = "chargeId") final Long loanChargeId, @Context final UriInfo uriInfo) { validateAppuserLoanMapping(loanId); @@ -162,15 +164,17 @@ public class SelfLoansApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Loan Details Template", httpMethod = "GET", notes = "Retrieves Loan Details Template\n\n" + @Operation(summary = "Retrieve Loan Details Template", description = "Retrieves Loan Details Template\n\n" + "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n\n" + "Example Requests:\n" + "\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n\n" + "Example Requests:\n" + "\n" + "self/loans/template?templateType=individual&clientId=1\n" + "\n" + "\n" + "self/loans/template?templateType=individual&clientId=1&productId=1") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.GetSelfLoansTemplateResponse.class) }) - public String template(@QueryParam("clientId") @ApiParam(value = "clientId") final Long clientId, - @QueryParam("productId") @ApiParam(value = "productId") final Long productId, - @QueryParam("templateType") @ApiParam(value = "templateType") final String templateType, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.GetSelfLoansTemplateResponse.class))) }) + public String template(@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, + @QueryParam("productId") @Parameter(description = "productId") final Long productId, + @QueryParam("templateType") @Parameter(description = "templateType") final String templateType, + @Context final UriInfo uriInfo) { if (clientId != null) { validateAppuserClientsMapping(clientId); @@ -193,7 +197,7 @@ public class SelfLoansApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Calculate Loan Repayment Schedule | Submit a new Loan Application", httpMethod = "POST", notes = "Calculate Loan Repayment Schedule:\n\n" + @Operation(summary = "Calculate Loan Repayment Schedule | Submit a new Loan Application", description = "Calculate Loan Repayment Schedule:\n\n" + "Calculates Loan Repayment Schedule\n\n" + "Mandatory Fields: productId, principal, loanTermFrequency, loanTermFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, expectedDisbursementDate, transactionProcessingStrategyId\n\n" + "Submit a new Loan Application:\n\n" @@ -203,12 +207,12 @@ public class SelfLoansApiResource { + "Additional Mandatory Field if Entity-Datatable Check is enabled for the entity of type loan: datatables\n\n" + "Optional Fields: graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, linkAccountId, allowPartialPeriodInterestCalcualtion, fixedEmiAmount, maxOutstandingLoanBalance, disbursementData, graceOnArrearsAgeing, createStandingInstructionAtDisbursement (requires linkedAccountId if set to true)\n\n" + "Showing request/response for 'Submit a new Loan Application'") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SelfLoansApiResourceSwagger.PostSelfLoansRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.PostSelfLoansResponse.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.PostSelfLoansRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.PostSelfLoansResponse.class))) }) public String calculateLoanScheduleOrSubmitLoanApplication( - @QueryParam("command") @ApiParam(value = "command") final String commandParam, @Context final UriInfo uriInfo, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { HashMap attr = this.dataValidator.validateLoanApplication(apiRequestBodyAsJson); final Long clientId = (Long) attr.get("clientId"); @@ -221,12 +225,12 @@ public class SelfLoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Loan Application", httpMethod = "PUT", notes = "Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SelfLoansApiResourceSwagger.PutSelfLoansLoanIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.PutSelfLoansLoanIdResponse.class) }) - public String modifyLoanApplication(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Loan Application", description = "Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.PutSelfLoansLoanIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.PutSelfLoansLoanIdResponse.class))) }) + public String modifyLoanApplication(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { HashMap attr = this.dataValidator.validateModifyLoanApplication(apiRequestBodyAsJson); validateAppuserLoanMapping(loanId); @@ -242,14 +246,14 @@ public class SelfLoansApiResource { @Path("{loanId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Applicant Withdraws from Loan Application", httpMethod = "POST", notes = "Applicant Withdraws from Loan Application\n\n" + @Operation(summary = "Applicant Withdraws from Loan Application", description = "Applicant Withdraws from Loan Application\n\n" + "Mandatory Fields: withdrawnOnDate") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SelfLoansApiResourceSwagger.PostSelfLoansLoanIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfLoansApiResourceSwagger.PostSelfLoansLoanIdResponse.class) }) - public String stateTransitions(@PathParam("loanId") @ApiParam(value = "loanId") final Long loanId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.PostSelfLoansLoanIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfLoansApiResourceSwagger.PostSelfLoansLoanIdResponse.class))) }) + public String stateTransitions(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { if (!is(commandParam, "withdrawnByApplicant")) { throw new UnrecognizedQueryParamException("command", commandParam); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResourceSwagger.java index db783273f..b15a02214 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/loanaccount/api/SelfLoansApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.loanaccount.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class SelfLoansApiResourceSwagger { private SelfLoansApiResourceSwagger() {} - @ApiModel(value = "GetSelfLoansLoanIdResponse") + @Schema(description = "GetSelfLoansLoanIdResponse") public static final class GetSelfLoansLoanIdResponse { private GetSelfLoansLoanIdResponse() {} @@ -39,27 +38,27 @@ final class SelfLoansApiResourceSwagger { private GetLoansLoanIdStatus() {} - @ApiModelProperty(example = "300") + @Schema(example = "300") public Integer id; - @ApiModelProperty(example = "loanStatusType.active") + @Schema(example = "loanStatusType.active") public String code; - @ApiModelProperty(example = "Active") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Active") + public String description; + @Schema(example = "false") public Boolean pendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } @@ -67,29 +66,29 @@ final class SelfLoansApiResourceSwagger { private GetLoansLoanIdLoanType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "loanType.individual") + @Schema(example = "loanType.individual") public String code; - @ApiModelProperty(example = "Individual") - public String value; + @Schema(example = "Individual") + public String description; } static final class GetLoansLoanIdCurrency { private GetLoansLoanIdCurrency() {} - @ApiModelProperty(example = "UGX") + @Schema(example = "UGX") public String code; - @ApiModelProperty(example = "Uganda Shilling") + @Schema(example = "Uganda Shilling") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "USh") + @Schema(example = "USh") public String displaySymbol; - @ApiModelProperty(example = "currency.UGX") + @Schema(example = "currency.UGX") public String nameCode; - @ApiModelProperty(example = "Uganda Shilling (USh)") + @Schema(example = "Uganda Shilling (USh)") public String displayLabel; } @@ -97,105 +96,105 @@ final class SelfLoansApiResourceSwagger { private GetLoansLoanIdTermPeriodFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "termFrequency.periodFrequencyType.months") + @Schema(example = "termFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetLoansLoanIdRepaymentFrequencyType { private GetLoansLoanIdRepaymentFrequencyType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "repaymentFrequency.periodFrequencyType.months") + @Schema(example = "repaymentFrequency.periodFrequencyType.months") public String code; - @ApiModelProperty(example = "Months") - public String value; + @Schema(example = "Months") + public String description; } static final class GetLoansLoanIdInterestRateFrequencyType { private GetLoansLoanIdInterestRateFrequencyType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "interestRateFrequency.periodFrequencyType.years") + @Schema(example = "interestRateFrequency.periodFrequencyType.years") public String code; - @ApiModelProperty(example = "Per year") - public String value; + @Schema(example = "Per year") + public String description; } static final class GetLoansLoanIdAmortizationType { private GetLoansLoanIdAmortizationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "amortizationType.equal.installments") + @Schema(example = "amortizationType.equal.installments") public String code; - @ApiModelProperty(example = "Equal installments") - public String value; + @Schema(example = "Equal installments") + public String description; } static final class GetLoansLoanIdInterestType { private GetLoansLoanIdInterestType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestType.flat") + @Schema(example = "interestType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetLoansLoanIdInterestCalculationPeriodType { private GetLoansLoanIdInterestCalculationPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "interestCalculationPeriodType.same.as.repayment.period") + @Schema(example = "interestCalculationPeriodType.same.as.repayment.period") public String code; - @ApiModelProperty(example = "Same as repayment period") - public String value; + @Schema(example = "Same as repayment period") + public String description; } static final class GetLoansLoanIdTimeline { private GetLoansLoanIdTimeline() {} - @ApiModelProperty(example = "[2012, 4, 3]") + @Schema(example = "[2012, 4, 3]") public LocalDate submittedOnDate; - @ApiModelProperty(example = "admin") + @Schema(example = "admin") public String submittedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String submittedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String submittedByLastname; - @ApiModelProperty(example = "[2012, 4, 3]") + @Schema(example = "[2012, 4, 3]") public LocalDate approvedOnDate; - @ApiModelProperty(example = "admin") + @Schema(example = "admin") public String approvedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String approvedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String approvedByLastname; - @ApiModelProperty(example = "[2012, 4, 10]") + @Schema(example = "[2012, 4, 10]") public LocalDate expectedDisbursementDate; - @ApiModelProperty(example = "[2012, 4, 10]") + @Schema(example = "[2012, 4, 10]") public LocalDate actualDisbursementDate; - @ApiModelProperty(example = "admin") + @Schema(example = "admin") public String disbursedByUsername; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String disbursedByFirstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String disbursedByLastname; - @ApiModelProperty(example = "[2012, 4, 10]") + @Schema(example = "[2012, 4, 10]") public LocalDate expectedMaturityDate; } @@ -212,9 +211,9 @@ final class SelfLoansApiResourceSwagger { private GetLoansLoanIdLinkedAccount() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; } @@ -222,13 +221,13 @@ final class SelfLoansApiResourceSwagger { private GetLoansLoanIdDisbursementDetails() {} - @ApiModelProperty(example = "71") + @Schema(example = "71") public Integer id; - @ApiModelProperty(example = "[2013, 11, 1]") + @Schema(example = "[2013, 11, 1]") public LocalDate expectedDisbursementDate; - @ApiModelProperty(example = "22000.000000") + @Schema(example = "22000.000000") public Float principal; - @ApiModelProperty(example = "22000.000000") + @Schema(example = "22000.000000") public Float approvedPrincipal; } @@ -240,65 +239,65 @@ final class SelfLoansApiResourceSwagger { private GetLoansLoanIdChargeTimeType() {} - @ApiModelProperty(example = "9") + @Schema(example = "9") public Integer id; - @ApiModelProperty(example = "chargeTimeType.overdueInstallment") + @Schema(example = "chargeTimeType.overdueInstallment") public String code; - @ApiModelProperty(example = "overdue fees") - public String value; + @Schema(example = "overdue fees") + public String description; } static final class GetLoansLoanIdChargeCalculationType { private GetLoansLoanIdChargeCalculationType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.percent.of.amount") + @Schema(example = "chargeCalculationType.percent.of.amount") public String code; - @ApiModelProperty(example = "% Amount") - public String value; + @Schema(example = "% Amount") + public String description; } static final class GetLoansLoanIdChargePaymentMode { private GetLoansLoanIdChargePaymentMode() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.regular") + @Schema(example = "chargepaymentmode.regular") public String code; - @ApiModelProperty(example = "Regular") - public String value; + @Schema(example = "Regular") + public String description; } static final class GetLoansLoanIdFeeFrequency { private GetLoansLoanIdFeeFrequency() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "feeFrequencyperiodFrequencyType.weeks") + @Schema(example = "feeFrequencyperiodFrequencyType.weeks") public String code; - @ApiModelProperty(example = "Weeks") - public String value; + @Schema(example = "Weeks") + public String description; } static final class GetLoanCurrency { private GetLoanCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -306,169 +305,169 @@ final class SelfLoansApiResourceSwagger { private GetLoanChargeTemplateChargeAppliesTo() {} - @ApiModelProperty(example = "1 ") + @Schema(example = "1 ") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.loan") + @Schema(example = "chargeAppliesTo.loan") public String code; - @ApiModelProperty(example = "Loan") - public String value; + @Schema(example = "Loan") + public String description; } - @ApiModelProperty(example = "20") + @Schema(example = "20") public Integer id; - @ApiModelProperty(example = "overdraft penality") + @Schema(example = "overdraft penality") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean penalty; public GetLoanCurrency currency; - @ApiModelProperty(example = "3.000000") + @Schema(example = "3.000000") public Float amount; public GetLoansLoanIdChargeTimeType chargeTimeType; public GetLoanChargeTemplateChargeAppliesTo chargeAppliesTo; public GetLoansLoanIdChargeCalculationType chargeCalculationType; public GetLoansLoanIdChargePaymentMode chargePaymentMode; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer feeInterval; public GetLoansLoanIdFeeFrequency feeFrequency; } public GetLoansLoanIdCurrency currency; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long principalDisbursed; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long principalPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long principalWrittenOff; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long principalOutstanding; - @ApiModelProperty(example = "833333.3") + @Schema(example = "833333.3") public Double principalOverdue; - @ApiModelProperty(example = "240000") + @Schema(example = "240000") public Long interestCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long interestPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long interestWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long interestWrittenOff; - @ApiModelProperty(example = "240000") + @Schema(example = "240000") public Long interestOutstanding; - @ApiModelProperty(example = "200000") + @Schema(example = "200000") public Long interestOverdue; - @ApiModelProperty(example = "18000") + @Schema(example = "18000") public Long feeChargesCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesDueAtDisbursementCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long feeChargesWrittenOff; - @ApiModelProperty(example = "18000") + @Schema(example = "18000") public Long feeChargesOutstanding; - @ApiModelProperty(example = "15000") + @Schema(example = "15000") public Long feeChargesOverdue; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesCharged; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesWrittenOff; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesOutstanding; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long penaltyChargesOverdue; - @ApiModelProperty(example = "1258000") + @Schema(example = "1258000") public Long totalExpectedRepayment; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalRepayment; - @ApiModelProperty(example = "258000") + @Schema(example = "258000") public Long totalExpectedCostOfLoan; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalCostOfLoan; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long totalWrittenOff; - @ApiModelProperty(example = "1258000") + @Schema(example = "1258000") public Long totalOutstanding; - @ApiModelProperty(example = "1048333.3") + @Schema(example = "1048333.3") public Double totalOverdue; - @ApiModelProperty(example = "[2012, 5, 10]") + @Schema(example = "[2012, 5, 10]") public LocalDate overdueSinceDate; public GetLoansLoanIdLinkedAccount linkedAccount; public Set disbursementDetails; - @ApiModelProperty(example = "1100.000000") + @Schema(example = "1100.000000") public Float fixedEmiAmount; - @ApiModelProperty(example = "35000") + @Schema(example = "35000") public Long maxOutstandingLoanBalance; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean canDisburse; public Set emiAmountVariations; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean inArrears; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isNPA; public Set overdueCharges; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; public GetLoansLoanIdStatus status; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Kampala first Client") + @Schema(example = "Kampala first Client") public String clientName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientOfficeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanProductId; - @ApiModelProperty(example = "Kampala Product (with cash accounting)") + @Schema(example = "Kampala Product (with cash accounting)") public String loanProductName; - @ApiModelProperty(example = "Typical Kampala loan product with cash accounting enabled for testing.") + @Schema(example = "Typical Kampala loan product with cash accounting enabled for testing.") public String loanProductDescription; - @ApiModelProperty(example = "22") + @Schema(example = "22") public Integer loanPurposeId; - @ApiModelProperty(example = "option.HousingImprovement") + @Schema(example = "option.HousingImprovement") public String loanPurposeName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer loanOfficerId; - @ApiModelProperty(example = "LoanOfficer, Kampala") + @Schema(example = "LoanOfficer, Kampala") public String loanOfficerName; public GetLoansLoanIdLoanType loanType; public GetLoansLoanIdCurrency currency; - @ApiModelProperty(example = "1000000") + @Schema(example = "1000000") public Long principal; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer termFrequency; public GetLoansLoanIdTermPeriodFrequencyType termPeriodFrequencyType; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; public GetLoansLoanIdRepaymentFrequencyType repaymentFrequencyType; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer interestRatePerPeriod; public GetLoansLoanIdInterestRateFrequencyType interestRateFrequencyType; - @ApiModelProperty(example = "24") + @Schema(example = "24") public Integer annualInterestRate; public GetLoansLoanIdAmortizationType amortizationType; public GetLoansLoanIdInterestType interestType; public GetLoansLoanIdInterestCalculationPeriodType interestCalculationPeriodType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer transactionProcessingStrategyId; public GetLoansLoanIdTimeline timeline; public GetLoansLoanIdSummary summary; } - @ApiModel(value = "GetSelfLoansLoanIdTransactionsTransactionIdResponse") + @Schema(description = "GetSelfLoansLoanIdTransactionsTransactionIdResponse") public static final class GetSelfLoansLoanIdTransactionsTransactionIdResponse { private GetSelfLoansLoanIdTransactionsTransactionIdResponse() {} @@ -477,45 +476,45 @@ final class SelfLoansApiResourceSwagger { private GetSelfLoansLoanIdTransactionsType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "loanTransactionType.repayment") + @Schema(example = "loanTransactionType.repayment") public String code; - @ApiModelProperty(example = "Repayment") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Repayment") + public String description; + @Schema(example = "false") public Boolean disbursement; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean repaymentAtDisbursement; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean repayment; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean contra; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waiveInterest; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waiveCharges; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean writeOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean recoveryRepayment; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; public GetSelfLoansLoanIdTransactionsType type; - @ApiModelProperty(example = "[2012, 5, 14]") + @Schema(example = "[2012, 5, 14]") public LocalDate date; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean manuallyReversed; public GetSelfLoansLoanIdResponse.GetLoansLoanIdSummary.GetLoansLoanIdOverdueCharges.GetLoanCurrency currency; - @ApiModelProperty(example = "559.88") + @Schema(example = "559.88") public Float amount; - @ApiModelProperty(example = "559.88") + @Schema(example = "559.88") public Float interestPortion; } - @ApiModel(value = "GetSelfLoansLoanIdChargesResponse") + @Schema(description = "GetSelfLoansLoanIdChargesResponse") public static final class GetSelfLoansLoanIdChargesResponse { private GetSelfLoansLoanIdChargesResponse() {} @@ -524,56 +523,56 @@ final class SelfLoansApiResourceSwagger { private GetSelfLoansChargeTimeType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeTimeType.disbursement") + @Schema(example = "chargeTimeType.disbursement") public String code; - @ApiModelProperty(example = "Disbursement") - public String value; + @Schema(example = "Disbursement") + public String description; } static final class GetSelfLoansChargeCalculationType { private GetSelfLoansChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeId; - @ApiModelProperty(example = "Loan Processing fee") + @Schema(example = "Loan Processing fee") public String name; public GetSelfLoansChargeTimeType chargeTimeType; public GetSelfLoansChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetSelfLoansLoanIdResponse.GetLoansLoanIdSummary.GetLoansLoanIdOverdueCharges.GetLoanCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Float amountWrittenOff; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOutstanding; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Float amountOrPercentage; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = "GetSelfLoansTemplateResponse") + @Schema(description = "GetSelfLoansTemplateResponse") public static final class GetSelfLoansTemplateResponse { private GetSelfLoansTemplateResponse() {} @@ -582,7 +581,7 @@ final class SelfLoansApiResourceSwagger { private GetSelfLoansTimeline() {} - @ApiModelProperty(example = "[2013, 3, 8]") + @Schema(example = "[2013, 3, 8]") public LocalDate expectedDisbursementDate; } @@ -590,23 +589,23 @@ final class SelfLoansApiResourceSwagger { private GetSelfLoansProductOptions() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Kampala Product (with cash accounting)") + @Schema(example = "Kampala Product (with cash accounting)") public String name; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "Kampala first Client") + @Schema(example = "Kampala first Client") public String clientName; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer clientOfficeId; public GetSelfLoansTimeline timeline; public Set productOptions; } - @ApiModel(value = "PostSelfLoansRequest") + @Schema(description = "PostSelfLoansRequest") public static final class PostSelfLoansRequest { private PostSelfLoansRequest() {} @@ -615,11 +614,11 @@ final class SelfLoansApiResourceSwagger { private PostSelfLoansDisbursementData() {} - @ApiModelProperty(example = "01 November 2013") + @Schema(example = "01 November 2013") public String expectedDisbursementDate; - @ApiModelProperty(example = "22000") + @Schema(example = "22000") public Long principal; - @ApiModelProperty(example = "22000") + @Schema(example = "22000") public Long approvedPrincipal; } @@ -631,118 +630,118 @@ final class SelfLoansApiResourceSwagger { private PostSelfLoansData() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "01 December 2016 00:00") + @Schema(example = "01 December 2016 00:00") public String Activation_Date; - @ApiModelProperty(example = "dd MMMM yyyy HH:mm") + @Schema(example = "dd MMMM yyyy HH:mm") public String dateFormat; } - @ApiModelProperty(example = "Date Loan Field") + @Schema(example = "Date Loan Field") public String registeredTableName; public PostSelfLoansData data; } - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "en_GB") + @Schema(example = "en_GB") public String locale; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "10,000.00") + @Schema(example = "10,000.00") public Double principal; - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer loanTermFrequency; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer loanTermFrequencyType; - @ApiModelProperty(example = "individual") + @Schema(example = "individual") public String loanType; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer repaymentFrequencyType; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer interestRatePerPeriod; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amortizationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer interestCalculationPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transactionProcessingStrategyId; - @ApiModelProperty(example = "10 Jun 2013") + @Schema(example = "10 Jun 2013") public String expectedDisbursementDate; - @ApiModelProperty(example = "10 Jun 2013") + @Schema(example = "10 Jun 2013") public String submittedOnDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer linkAccountId; - @ApiModelProperty(example = "1100") + @Schema(example = "1100") public Integer fixedEmiAmount; - @ApiModelProperty(example = "35000") + @Schema(example = "35000") public Long maxOutstandingLoanBalance; public Set disbursementData; public Set datatables; } - @ApiModel(value = "PostSelfLoansResponse") + @Schema(description = "PostSelfLoansResponse") public static final class PostSelfLoansResponse { private PostSelfLoansResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutSelfLoansLoanIdRequest") + @Schema(description = "PutSelfLoansLoanIdRequest") public static final class PutSelfLoansLoanIdRequest { private PutSelfLoansLoanIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer productId; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Long principal; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer loanTermFrequency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer loanTermFrequencyType; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer numberOfRepayments; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer repaymentEvery; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer repaymentFrequencyType; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer interestRatePerPeriod; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer interestCalculationPeriodType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer amortizationType; - @ApiModelProperty(example = "04 March 2014") + @Schema(example = "04 March 2014") public String expectedDisbursementDate; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer transactionProcessingStrategyId; } - @ApiModel(value = "PutSelfLoansLoanIdResponse") + @Schema(description = "PutSelfLoansLoanIdResponse") public static final class PutSelfLoansLoanIdResponse { private PutSelfLoansLoanIdResponse() {} @@ -751,39 +750,39 @@ final class SelfLoansApiResourceSwagger { private PutSelfLoansChanges() {} - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Long principal; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer loanId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutSelfLoansChanges changes; } - @ApiModel(value = "PostSelfLoansLoanIdRequest") + @Schema(description = "PostSelfLoansLoanIdRequest") public static final class PostSelfLoansLoanIdRequest { private PostSelfLoansLoanIdRequest() {} - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "20 September 2011") + @Schema(example = "20 September 2011") public String withdrawnOnDate; - @ApiModelProperty(example = "Reason loan applicant withdrew from application.") + @Schema(example = "Reason loan applicant withdrew from application.") public String note; } - @ApiModel(value = "PostSelfLoansLoanIdResponse") + @Schema(description = "PostSelfLoansLoanIdResponse") public static final class PostSelfLoansLoanIdResponse { private PostSelfLoansLoanIdResponse() {} @@ -796,48 +795,48 @@ final class SelfLoansApiResourceSwagger { private PostSelfLoansLoanIdStatus() {} - @ApiModelProperty(example = "400") + @Schema(example = "400") public Integer id; - @ApiModelProperty(example = "loanStatusType.withdrawn.by.client") + @Schema(example = "loanStatusType.withdrawn.by.client") public String code; - @ApiModelProperty(example = "Withdrawn by applicant") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Withdrawn by applicant") + public String description; + @Schema(example = "false") public Boolean pendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean waitingForDisbursal; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedObligationsMet; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedWrittenOff; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closedRescheduled; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean overpaid; } public PostSelfLoansLoanIdStatus status; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "20 September 2011") + @Schema(example = "20 September 2011") public String withdrawnOnDate; - @ApiModelProperty(example = "20 September 2011") + @Schema(example = "20 September 2011") public String closedOnDate; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer loanId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer resourceId; public PostSelfLoansLoanIdChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResource.java index 047980ebc..857505546 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResource.java @@ -19,13 +19,13 @@ package org.apache.fineract.portfolio.self.pockets.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -50,8 +50,8 @@ import org.springframework.stereotype.Component; @Path("/self/pockets") @Component @Scope("singleton") -@Api(tags = { "Pocket" }) -@SwaggerDefinition(tags = { @Tag(name = "Pocket", description = "") }) + +@Tag(name = "Pocket", description = "") public class PocketApiResource { private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService; @@ -72,11 +72,11 @@ public class PocketApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Link/delink accounts to/from pocket", httpMethod = "POST", notes = "Pockets behave as favourites. An user can link his/her Loan, Savings and Share accounts to pocket for faster access. In a similar way linked accounts can be delinked from the pocket.\n\n" + @Operation(summary = "Link/delink accounts to/from pocket", description = "Pockets behave as favourites. An user can link his/her Loan, Savings and Share accounts to pocket for faster access. In a similar way linked accounts can be delinked from the pocket.\n\n" + "Example Requests:\n" + "\n" + "self/pockets?command=linkAccounts\n" + "\n" + "self/pockets?command=delinkAccounts") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = PocketApiResourceSwagger.PostLinkDelinkAccountsToFromPocketResponse.class) }) - public String handleCommands(@QueryParam("command") @ApiParam(value = "command") final String commandParam, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PocketApiResourceSwagger.PostLinkDelinkAccountsToFromPocketResponse.class))) }) + public String handleCommands(@QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo, final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -101,9 +101,10 @@ public class PocketApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve accounts linked to pocket", httpMethod = "GET", notes = "All linked loan\n\n" + "Example Requests:\n" - + "\n" + "\n" + "self/pockets") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = PocketApiResourceSwagger.GetAccountsLinkedToPocketResponse.class) }) + @Operation(summary = "Retrieve accounts linked to pocket", description = "All linked loan\n\n" + "Example Requests:\n" + "\n" + "\n" + + "self/pockets") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PocketApiResourceSwagger.GetAccountsLinkedToPocketResponse.class))) }) public String retrieveAll() { return this.toApiJsonSerializer.serialize(this.pocketAccountMappingReadPlatformService.retrieveAll()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResourceSwagger.java index 32480f737..4c6ca8b1a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/api/PocketApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.pockets.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -30,7 +29,7 @@ final class PocketApiResourceSwagger { private PocketApiResourceSwagger() {} - @ApiModel(value = "PostLinkDelinkAccountsToFromPocketRequest") + @Schema(description = "PostLinkDelinkAccountsToFromPocketRequest") public static final class PostLinkDelinkAccountsToFromPocketRequest { private PostLinkDelinkAccountsToFromPocketRequest() {} @@ -39,25 +38,25 @@ final class PocketApiResourceSwagger { private GetPocketAccountDetail() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer accountId; - @ApiModelProperty(example = "LOAN") + @Schema(example = "LOAN") public String accountType; } public Set accountDetail; } - @ApiModel(value = "PostLinkDelinkAccountsToFromPocketResponse") + @Schema(description = "PostLinkDelinkAccountsToFromPocketResponse") public static final class PostLinkDelinkAccountsToFromPocketResponse { private PostLinkDelinkAccountsToFromPocketResponse() {} - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer resourceId; } - @ApiModel(value = "GetAccountsLinkedToPocketResponse") + @Schema(description = "GetAccountsLinkedToPocketResponse") public static final class GetAccountsLinkedToPocketResponse { private GetAccountsLinkedToPocketResponse() {} @@ -66,15 +65,15 @@ final class PocketApiResourceSwagger { private GetPocketLoanAccounts() {} - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer pocketId; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer accountId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer accountType; - @ApiModelProperty(example = "000000011") + @Schema(example = "000000011") public Integer accountNumber; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer id; } @@ -82,15 +81,15 @@ final class PocketApiResourceSwagger { private GetPocketSavingAccounts() {} - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer pocketId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer accountId; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer accountType; - @ApiModelProperty(example = "000000002") + @Schema(example = "000000002") public Integer accountNumber; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/products/api/SelfLoanProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/products/api/SelfLoanProductsApiResource.java index 8d1ed8621..684a69fbe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/products/api/SelfLoanProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/products/api/SelfLoanProductsApiResource.java @@ -19,9 +19,7 @@ package org.apache.fineract.portfolio.self.products.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -41,92 +39,82 @@ import org.springframework.stereotype.Component; @Path("/self/loanproducts") @Component @Scope("singleton") -@Api(tags = { "Self Loan Products" }) -@SwaggerDefinition(tags = { - @Tag(name = "Self Loan Products", description = "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.\n" - + "\n" + "Field Descriptions\n" + "name\n" + "Name associated with loan product on system.\n" + "shortName\n" - + "Short name associated with a loan product. \n" - + "An abbreviated version of the name, used in reports or menus where space is limited, such as Collection Sheets.\n" - + "description\n" + "For providing helpful description of product offering.\n" + "fundId\n" - + "For associating a loan product with a given fund by default.\n" + "includeInBorrowerCycle\n" - + "It is a flag, Used to denote whether the loans should include in loan cycle counter or not.\n" + "useBorrowerCycle\n" - + "It is a flag, Used to denote whether the loans should depend on \n" + "borrower loan cycle counter or not.\n" - + "currencyCode\n" + "A three letter ISO code of currency.\n" + "digitsAfterDecimal\n" - + "Override the currency default value for digitsAfterDecimal.\n" + "inMultiplesOf\n" - + "Override the default value for rounding currency to multiples of value provided.\n" + "installmentAmountInMultiplesOf\n" - + "Override the default value for rounding instalment amount to multiples of value provided.\n" + "principal\n" - + "The loan amount to be disbursed to through loan.\n" + "numberOfRepayments\n" + "Number of installments to repay.\n" - + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + "e.g. 10 (repayments) Every 12 Weeks\n" - + "repaymentEvery\n" + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" - + "e.g. 10 (repayments) Every 12 Weeks\n" + "repaymentFrequencyType\n" - + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + "e.g. 10 (repayments) Every 12 Weeks \n" - + "Example Values: 0=Days, 1=Weeks, 2=Months\n" + "interestRatePerPeriod\n" + "Interest Rate.\n" - + "Used like: interestRatePerPeriod % interestRateFrequencyType - interestType\n" - + "e.g. 12.0000% Per year - Declining Balance\n" + "interestRateFrequencyType\n" - + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" - + "e.g. 12.0000% Per year - Declining Balance \n" + "Example Values: 2=Per month, 3=Per year\n" + "amortizationType\n" - + "Example Values: 0=Equal principle payments, 1=Equal installments\n" + "interestType\n" - + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" - + "e.g. 12.0000% Per year - Declining Balance \n" + "Example Values: 0=Declining Balance, 1=Flat\n" - + "interestCalculationPeriodType\n" + "Example Values: 0=Daily, 1=Same as repayment period\n" - + "allowPartialPeriodInterestCalcualtion\n" - + "This value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\n" - + "inArrearsTolerance\n" - + "The amount that can be 'waived' at end of all loan payments because it is too small to worry about.\n" - + "This is also the tolerance amount assessed when determining if a loan is in arrears.\n" - + "principalVariationsForBorrowerCycle,interestRateVariationsForBorrowerCycle,\n" - + "numberOfRepaymentVariationsForBorrowerCycle\n" + "Variations for loan, based on borrower cycle number\n" - + "minimumDaysBetweenDisbursalAndFirstRepayment\n" - + "The minimum number of days allowed between a Loan disbursal and its first repayment.\n" - + "principalThresholdForLastInstalment\n" - + "Field represents percentage of current instalment principal amount for comparing against principal outstanding to add another repayment instalment. If the outstanding principal amount is less then calculated amount, remaining outstanding amount will be added to current instalment. Default value for multi disburse loan is 50% and non-multi disburse loan is 0%\n" - + "canDefineInstallmentAmount\n" + "if provided as true, then fixed instalment amount can be provided from loan account.\n" - + "transactionProcessingStrategyId\n" - + "An enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\n" - + "A number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n" - + "\n" - + "Refer to the Payment Application Logic / Transaction Processing Strategy section in the appendix for more detailed overview of each available payment application logic provided out of the box.\n" - + "\n" + "List of current approaches:\n" + "1 = Mifos style (Similar to Old Mifos)\n" - + "2 = Heavensfamily (Custom MFI approach)\n" + "3 = Creocore (Custom MFI approach)\n" + "4 = RBI (India)\n" - + "5 = Principal Interest Penalties Fees Order\n" + "6 = Interest Principal Penalties Fees Order\n" - + "7 = Early Payment Strategy\n" + "graceOnPrincipalPayment\n" - + "Optional: Integer - represents the number of repayment periods that grace should apply to the principal component of a repayment period.\n" - + "graceOnInterestPayment\n" - + "Optional: Integer - represents the number of repayment periods that grace should apply to the interest component of a repayment period. Interest is still calculated but offset to later repayment periods.\n" - + "graceOnInterestCharged\n" - + "Optional: Integer - represents the number of repayment periods that should be interest-free.\n" - + "graceOnArrearsAgeing\n" - + "Optional: Integer - Used in Arrears calculation to only take into account loans that are more than graceOnArrearsAgeing days overdue.\n" - + "overdueDaysForNPA\n" - + "Optional: Integer - represents the maximum number of days a Loan may be overdue before being classified as a NPA (non performing asset)\n" - + "accountMovesOutOfNPAOnlyOnArrearsCompletion\n" - + "Optional: Boolean - if provided as true, Loan Account moves out of NPA state only when all arrears are cleared\n" - + "accountingRule\n" - + "Specifies if accounting is enabled for the particular product and the type of the accounting rule to be used Example Values:1=NONE, 2=CASH_BASED, 3=ACCRUAL_PERIODIC, 4=ACCRUAL_UPFRONT\n" - + "isInterestRecalculationEnabled\n" - + "It is a flag, Used to denote whether interest recalculation is enabled or disabled for the particular product\n" - + "daysInYearType\n" + "Specifies the number of days in a year. \n" - + "Example Values:1=ACTUAL(Actual number of days in year), 360=360 DAYS, 364=364 DAYS(52 WEEKS), 365=365 DAYS\n" - + "daysInMonthType\n" + "Specifies the number of days in a month. \n" - + "Example Values:1=ACTUAL(Actual number of days in month), 30=30 DAYS\n" + "interestRecalculationCompoundingMethod\n" - + "Specifies which amount portion should be added to principal for interest recalculation. \n" - + "Example Values:0=NONE(Only on principal), 1=INTEREST(Principal+Interest), 2=FEE(Principal+Fee), 3=FEE And INTEREST (Principal+Fee+Interest)\n" - + "rescheduleStrategyMethod\n" + "Specifies what action should perform on loan repayment schedule for advance payments. \n" - + "Example Values:1=Reschedule next repayments, 2=Reduce number of installments, 3=Reduce EMI amount\n" - + "recalculationCompoundingFrequencyType\n" - + "Specifies effective date from which the compounding of interest or fee amounts will be considered in recalculation on late payment.\n" - + "Example Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly\n" - + "recalculationCompoundingFrequencyInterval\n" + "Specifies compounding frequency interval for interest recalculation.\n" - + "recalculationCompoundingFrequencyDate\n" + "Specifies compounding frequency start date for interest recalculation.\n" - + "recalculationRestFrequencyType\n" - + "Specifies effective date from which the late or advanced payment amounts will be considered in recalculation.\n" - + "Example Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly\n" + "recalculationRestFrequencyInterval\n" - + "Specifies rest frequency interval for interest recalculation.\n" + "recalculationRestFrequencyDate\n" - + "Specifies rest frequency start date for interest recalculation.\n" + "preClosureInterestCalculationStrategy\n" - + "Specifies applicable days for interest calculation on pre closure of a loan.\n" - + "Example Values:1=Calculate till pre closure date, 2=Calculate till rest frequency date\n" - + "isArrearsBasedOnOriginalSchedule\n" + "If Specified as true, arrears will be identified based on original schedule.\n" - + "allowAttributeOverrides\n" + "Specifies if select attributes may be overridden for individual loan accounts.") }) +@Tag(name = "Self Loan Products", description = "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.\n" + + "\n" + "Field Descriptions\n" + "name\n" + "Name associated with loan product on system.\n" + "shortName\n" + + "Short name associated with a loan product. \n" + + "An abbreviated version of the name, used in reports or menus where space is limited, such as Collection Sheets.\n" + + "description\n" + "For providing helpful description of product offering.\n" + "fundId\n" + + "For associating a loan product with a given fund by default.\n" + "includeInBorrowerCycle\n" + + "It is a flag, Used to denote whether the loans should include in loan cycle counter or not.\n" + "useBorrowerCycle\n" + + "It is a flag, Used to denote whether the loans should depend on \n" + "borrower loan cycle counter or not.\n" + "currencyCode\n" + + "A three letter ISO code of currency.\n" + "digitsAfterDecimal\n" + + "Override the currency default value for digitsAfterDecimal.\n" + "inMultiplesOf\n" + + "Override the default value for rounding currency to multiples of value provided.\n" + "installmentAmountInMultiplesOf\n" + + "Override the default value for rounding instalment amount to multiples of value provided.\n" + "principal\n" + + "The loan amount to be disbursed to through loan.\n" + "numberOfRepayments\n" + "Number of installments to repay.\n" + + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + "e.g. 10 (repayments) Every 12 Weeks\n" + + "repaymentEvery\n" + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + + "e.g. 10 (repayments) Every 12 Weeks\n" + "repaymentFrequencyType\n" + + "Used like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\n" + "e.g. 10 (repayments) Every 12 Weeks \n" + + "Example Values: 0=Days, 1=Weeks, 2=Months\n" + "interestRatePerPeriod\n" + "Interest Rate.\n" + + "Used like: interestRatePerPeriod % interestRateFrequencyType - interestType\n" + "e.g. 12.0000% Per year - Declining Balance\n" + + "interestRateFrequencyType\n" + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" + + "e.g. 12.0000% Per year - Declining Balance \n" + "Example Values: 2=Per month, 3=Per year\n" + "amortizationType\n" + + "Example Values: 0=Equal principle payments, 1=Equal installments\n" + "interestType\n" + + "Used like: interestRatePerPeriod% interestRateFrequencyType - interestType\n" + "e.g. 12.0000% Per year - Declining Balance \n" + + "Example Values: 0=Declining Balance, 1=Flat\n" + "interestCalculationPeriodType\n" + + "Example Values: 0=Daily, 1=Same as repayment period\n" + "allowPartialPeriodInterestCalcualtion\n" + + "This value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\n" + + "inArrearsTolerance\n" + "The amount that can be 'waived' at end of all loan payments because it is too small to worry about.\n" + + "This is also the tolerance amount assessed when determining if a loan is in arrears.\n" + + "principalVariationsForBorrowerCycle,interestRateVariationsForBorrowerCycle,\n" + "numberOfRepaymentVariationsForBorrowerCycle\n" + + "Variations for loan, based on borrower cycle number\n" + "minimumDaysBetweenDisbursalAndFirstRepayment\n" + + "The minimum number of days allowed between a Loan disbursal and its first repayment.\n" + "principalThresholdForLastInstalment\n" + + "Field represents percentage of current instalment principal amount for comparing against principal outstanding to add another repayment instalment. If the outstanding principal amount is less then calculated amount, remaining outstanding amount will be added to current instalment. Default value for multi disburse loan is 50% and non-multi disburse loan is 0%\n" + + "canDefineInstallmentAmount\n" + "if provided as true, then fixed instalment amount can be provided from loan account.\n" + + "transactionProcessingStrategyId\n" + + "An enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\n" + + "A number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n" + + "\n" + + "Refer to the Payment Application Logic / Transaction Processing Strategy section in the appendix for more detailed overview of each available payment application logic provided out of the box.\n" + + "\n" + "List of current approaches:\n" + "1 = Mifos style (Similar to Old Mifos)\n" + "2 = Heavensfamily (Custom MFI approach)\n" + + "3 = Creocore (Custom MFI approach)\n" + "4 = RBI (India)\n" + "5 = Principal Interest Penalties Fees Order\n" + + "6 = Interest Principal Penalties Fees Order\n" + "7 = Early Payment Strategy\n" + "graceOnPrincipalPayment\n" + + "Optional: Integer - represents the number of repayment periods that grace should apply to the principal component of a repayment period.\n" + + "graceOnInterestPayment\n" + + "Optional: Integer - represents the number of repayment periods that grace should apply to the interest component of a repayment period. Interest is still calculated but offset to later repayment periods.\n" + + "graceOnInterestCharged\n" + "Optional: Integer - represents the number of repayment periods that should be interest-free.\n" + + "graceOnArrearsAgeing\n" + + "Optional: Integer - Used in Arrears calculation to only take into account loans that are more than graceOnArrearsAgeing days overdue.\n" + + "overdueDaysForNPA\n" + + "Optional: Integer - represents the maximum number of days a Loan may be overdue before being classified as a NPA (non performing asset)\n" + + "accountMovesOutOfNPAOnlyOnArrearsCompletion\n" + + "Optional: Boolean - if provided as true, Loan Account moves out of NPA state only when all arrears are cleared\n" + + "accountingRule\n" + + "Specifies if accounting is enabled for the particular product and the type of the accounting rule to be used Example Values:1=NONE, 2=CASH_BASED, 3=ACCRUAL_PERIODIC, 4=ACCRUAL_UPFRONT\n" + + "isInterestRecalculationEnabled\n" + + "It is a flag, Used to denote whether interest recalculation is enabled or disabled for the particular product\n" + + "daysInYearType\n" + "Specifies the number of days in a year. \n" + + "Example Values:1=ACTUAL(Actual number of days in year), 360=360 DAYS, 364=364 DAYS(52 WEEKS), 365=365 DAYS\n" + + "daysInMonthType\n" + "Specifies the number of days in a month. \n" + + "Example Values:1=ACTUAL(Actual number of days in month), 30=30 DAYS\n" + "interestRecalculationCompoundingMethod\n" + + "Specifies which amount portion should be added to principal for interest recalculation. \n" + + "Example Values:0=NONE(Only on principal), 1=INTEREST(Principal+Interest), 2=FEE(Principal+Fee), 3=FEE And INTEREST (Principal+Fee+Interest)\n" + + "rescheduleStrategyMethod\n" + "Specifies what action should perform on loan repayment schedule for advance payments. \n" + + "Example Values:1=Reschedule next repayments, 2=Reduce number of installments, 3=Reduce EMI amount\n" + + "recalculationCompoundingFrequencyType\n" + + "Specifies effective date from which the compounding of interest or fee amounts will be considered in recalculation on late payment.\n" + + "Example Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly\n" + "recalculationCompoundingFrequencyInterval\n" + + "Specifies compounding frequency interval for interest recalculation.\n" + "recalculationCompoundingFrequencyDate\n" + + "Specifies compounding frequency start date for interest recalculation.\n" + "recalculationRestFrequencyType\n" + + "Specifies effective date from which the late or advanced payment amounts will be considered in recalculation.\n" + + "Example Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly\n" + "recalculationRestFrequencyInterval\n" + + "Specifies rest frequency interval for interest recalculation.\n" + "recalculationRestFrequencyDate\n" + + "Specifies rest frequency start date for interest recalculation.\n" + "preClosureInterestCalculationStrategy\n" + + "Specifies applicable days for interest calculation on pre closure of a loan.\n" + + "Example Values:1=Calculate till pre closure date, 2=Calculate till rest frequency date\n" + "isArrearsBasedOnOriginalSchedule\n" + + "If Specified as true, arrears will be identified based on original schedule.\n" + "allowAttributeOverrides\n" + + "Specifies if select attributes may be overridden for individual loan accounts.") public class SelfLoanProductsApiResource { private final LoanProductsApiResource loanProductsApiResource; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/api/SelfServiceRegistrationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/api/SelfServiceRegistrationApiResource.java index 9ce4e1074..5eecb309e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/api/SelfServiceRegistrationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/api/SelfServiceRegistrationApiResource.java @@ -19,9 +19,7 @@ package org.apache.fineract.portfolio.self.registration.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -38,8 +36,8 @@ import org.springframework.stereotype.Component; @Path("/self/registration") @Component @Scope("singleton") -@Api(tags = { "Self Service Registration" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Service Registration", description = "") }) + +@Tag(name = "Self Service Registration", description = "") public class SelfServiceRegistrationApiResource { private final SelfServiceRegistrationWritePlatformService selfServiceRegistrationWritePlatformService; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResource.java index 0ec3fa7d4..6ce6fea9b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.portfolio.self.runreport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -43,17 +43,15 @@ import org.springframework.stereotype.Component; @Path("/self/runreports") @Component @Scope("singleton") -@Api(tags = { "Self Run Report " }) -@SwaggerDefinition(tags = { - @Tag(name = "Self Run Report", description = "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n" - + "\n" - + "The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n" - + "\n" - + "If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats.\n" - + "\n" - + "The Apache Fineract reference application uses a JQuery plugin called stretchyreporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI).\n" - + "\n" + "ARGUMENTS\n" - + "R_'parameter names' ... optional, No defaults The number and names of the parameters depend on the specific report and how it has been configured. R_officeId is an example parameter name.Note: the prefix R_ stands for ReportinggenericResultSetoptional, defaults to true If 'true' an optimised JSON format is returned suitable for tabular display of data. If 'false' a simple JSON format is returned. parameterType optional, The only valid value is 'true'. If any other value is provided the argument will be ignored Determines whether the request looks in the list of reports or the list of parameters for its data. Doesn't apply to Pentaho reports.exportCSV optional, The only valid value is 'true'. If any other value is provided the argument will be ignored Output will be delivered as a CSV file instead of JSON. Doesn't apply to Pentaho reports.output-type optional, Defaults to HTML. Valid Values are HTML, XLS, XSLX, CSV and PDF for html, Excel, Excel 2007+, CSV and PDF formats respectively.Only applies to Pentaho reports.locale optional Any valid locale Ex: en_US, en_IN, fr_FR etcOnly applies to Pentaho reports.") }) +@Tag(name = "Self Run Report", description = "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n" + + "\n" + + "The default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n" + + "\n" + + "If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats.\n" + + "\n" + + "The Apache Fineract reference application uses a JQuery plugin called stretchyreporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI).\n" + + "\n" + "ARGUMENTS\n" + + "R_'parameter names' ... optional, No defaults The number and names of the parameters depend on the specific report and how it has been configured. R_officeId is an example parameter name.Note: the prefix R_ stands for ReportinggenericResultSetoptional, defaults to true If 'true' an optimised JSON format is returned suitable for tabular display of data. If 'false' a simple JSON format is returned. parameterType optional, The only valid value is 'true'. If any other value is provided the argument will be ignored Determines whether the request looks in the list of reports or the list of parameters for its data. Doesn't apply to Pentaho reports.exportCSV optional, The only valid value is 'true'. If any other value is provided the argument will be ignored Output will be delivered as a CSV file instead of JSON. Doesn't apply to Pentaho reports.output-type optional, Defaults to HTML. Valid Values are HTML, XLS, XSLX, CSV and PDF for html, Excel, Excel 2007+, CSV and PDF formats respectively.Only applies to Pentaho reports.locale optional Any valid locale Ex: en_US, en_IN, fr_FR etcOnly applies to Pentaho reports.") public class SelfRunReportApiResource { private final PlatformSecurityContext context; @@ -69,11 +67,12 @@ public class SelfRunReportApiResource { @Path("{reportName}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON, "text/csv", "application/vnd.ms-excel", "application/pdf", "text/html" }) - @ApiOperation(value = "Running A Report", httpMethod = "GET", notes = "" + "Example Requests:\n" + "\n" + "\n" + @Operation(summary = "Running A Report", description = "" + "Example Requests:\n" + "\n" + "\n" + "self/runreports/Client%20Details?R_officeId=1" + "\n" + "\n" + "\n" + "self/runreports/Client%20Details?R_officeId=1&exportCSV=true") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfRunReportApiResourceSwagger.GetRunReportResponse.class) }) - public Response runReport(@PathParam("reportName") @ApiParam(value = "reportName") final String reportName, + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfRunReportApiResourceSwagger.GetRunReportResponse.class))) }) + public Response runReport(@PathParam("reportName") @Parameter(description = "reportName") final String reportName, @Context final UriInfo uriInfo) { this.context.authenticatedUser(); final boolean isSelfServiceUserReport = true; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResourceSwagger.java index e602670d1..9589858ba 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/runreport/SelfRunReportApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.runreport; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -30,7 +29,7 @@ final class SelfRunReportApiResourceSwagger { private SelfRunReportApiResourceSwagger() {} - @ApiModel(value = "GetRunReportResponse") + @Schema(description = "GetRunReportResponse") public static final class GetRunReportResponse { private GetRunReportResponse() {} @@ -39,15 +38,15 @@ final class SelfRunReportApiResourceSwagger { private GetRunReportColumnHeaders() {} - @ApiModelProperty(example = "Office/Branch") + @Schema(example = "Office/Branch") public String columnName; - @ApiModelProperty(example = "VARCHAR") + @Schema(example = "VARCHAR") public String columnType; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isColumnNullable; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean isColumnPrimaryKey; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public String columnValues; } @@ -56,7 +55,7 @@ final class SelfRunReportApiResourceSwagger { private GetPocketData() {} - @ApiModelProperty(example = "[\"Head Office\", \"000000001\", \"John Doe\" \"2017-03-04\", \"786YYH7\"") + @Schema(example = "[\"Head Office\", \"000000001\", \"John Doe\" \"2017-03-04\", \"786YYH7\"") public String row; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResource.java index 0fee886ff..7d71b6078 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.portfolio.self.savings.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.HashMap; import javax.ws.rs.Consumes; import javax.ws.rs.DefaultValue; @@ -56,8 +57,8 @@ import org.springframework.stereotype.Component; @Path("/self/savingsaccounts") @Component @Scope("singleton") -@Api(tags = { "Self Savings Account" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Savings Account", description = "") }) + +@Tag(name = "Self Savings Account", description = "") public class SelfSavingsApiResource { private final PlatformSecurityContext context; @@ -87,12 +88,12 @@ public class SelfSavingsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a savings account", httpMethod = "GET", notes = "Retrieves a savings account\n\n" - + "Example Requests :\n" + "\n" + "self/savingsaccounts/1\n" + "\n" + "\n" + "self/savingsaccounts/1?associations=transactions") + @Operation(summary = "Retrieve a savings account", description = "Retrieves a savings account\n\n" + "Example Requests :\n" + "\n" + + "self/savingsaccounts/1\n" + "\n" + "\n" + "self/savingsaccounts/1?associations=transactions") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsResponse.class) }) - public String retrieveSavings(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @DefaultValue("all") @QueryParam("chargeStatus") @ApiParam(value = "chargeStatus") final String chargeStatus, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsResponse.class))) }) + public String retrieveSavings(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @DefaultValue("all") @QueryParam("chargeStatus") @Parameter(description = "chargeStatus") final String chargeStatus, @Context final UriInfo uriInfo) { this.dataValidator.validateRetrieveSavings(uriInfo); @@ -107,12 +108,13 @@ public class SelfSavingsApiResource { @Path("{accountId}/transactions/{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Savings Account Transaction", httpMethod = "GET", notes = "Retrieves Savings Account Transaction\n\n" + @Operation(summary = "Retrieve Savings Account Transaction", description = "Retrieves Savings Account Transaction\n\n" + "Example Requests:\n" + "\n" + "self/savingsaccounts/1/transactions/1") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse.class) }) - public String retrieveSavingsTransaction(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @PathParam("transactionId") @ApiParam(value = "transactionId") final Long transactionId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse.class))) }) + public String retrieveSavingsTransaction(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId, + @Context final UriInfo uriInfo) { this.dataValidator.validateRetrieveSavingsTransaction(uriInfo); @@ -125,13 +127,13 @@ public class SelfSavingsApiResource { @Path("{accountId}/charges") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Savings Charges", httpMethod = "GET", notes = "Lists Savings Charges\n\n" + "Example Requests:\n" + "\n" + @Operation(summary = "List Savings Charges", description = "Lists Savings Charges\n\n" + "Example Requests:\n" + "\n" + "self/savingsaccounts/1/charges\n" + "\n" + "self/savingsaccounts/1/charges?chargeStatus=inactive\n" + "\n" + "self/savingsaccounts/1/charges?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsAccountIdChargesResponse.class, responseContainer = "List") }) - public String retrieveAllSavingsAccountCharges(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @DefaultValue("all") @QueryParam("chargeStatus") @ApiParam(value = "chargeStatus") final String chargeStatus, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsAccountIdChargesResponse.class)))) }) + public String retrieveAllSavingsAccountCharges(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @DefaultValue("all") @QueryParam("chargeStatus") @Parameter(description = "chargeStatus") final String chargeStatus, @Context final UriInfo uriInfo) { validateAppuserSavingsAccountMapping(accountId); @@ -143,13 +145,12 @@ public class SelfSavingsApiResource { @Path("{accountId}/charges/{savingsAccountChargeId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Savings account Charge", httpMethod = "GET", notes = "Retrieves a Savings account Charge\n\n" - + "Example Requests:\n" + "\n" + "self/savingsaccounts/1/charges/5\n" + "\n" + "\n" - + "self/savingsaccounts/1/charges/5?fields=name,amountOrPercentage") + @Operation(summary = "Retrieve a Savings account Charge", description = "Retrieves a Savings account Charge\n\n" + "Example Requests:\n" + + "\n" + "self/savingsaccounts/1/charges/5\n" + "\n" + "\n" + "self/savingsaccounts/1/charges/5?fields=name,amountOrPercentage") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse.class) }) - public String retrieveSavingsAccountCharge(@PathParam("accountId") @ApiParam(value = "accountId") final Long accountId, - @PathParam("savingsAccountChargeId") @ApiParam(value = "savingsAccountChargeId") final Long savingsAccountChargeId, + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfSavingsApiResourceSwagger.GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) + public String retrieveSavingsAccountCharge(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, + @PathParam("savingsAccountChargeId") @Parameter(description = "savingsAccountChargeId") final Long savingsAccountChargeId, @Context final UriInfo uriInfo) { validateAppuserSavingsAccountMapping(accountId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResourceSwagger.java index b5d1670fb..c5abbd477 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/savings/api/SelfSavingsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.savings.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; /** @@ -29,7 +28,7 @@ final class SelfSavingsApiResourceSwagger { private SelfSavingsApiResourceSwagger() {} - @ApiModel(value = "GetSelfSavingsAccountsResponse") + @Schema(description = "GetSelfSavingsAccountsResponse") public static final class GetSelfSavingsAccountsResponse { private GetSelfSavingsAccountsResponse() {} @@ -38,23 +37,23 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsStatus() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "savingsAccountStatusType.submitted.and.pending.approval") + @Schema(example = "savingsAccountStatusType.submitted.and.pending.approval") public String code; - @ApiModelProperty(example = "Submitted and pending approval") - public String value; - @ApiModelProperty(example = "true") + @Schema(example = "Submitted and pending approval") + public String description; + @Schema(example = "true") public Boolean submittedAndPendingApproval; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean approved; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean rejected; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean withdrawnByApplicant; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean closed; } @@ -63,7 +62,7 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsTimeline() {} - @ApiModelProperty(example = "[2013, 3, 1]") + @Schema(example = "[2013, 3, 1]") public LocalDate submittedOnDate; } @@ -71,17 +70,17 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -89,48 +88,48 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsInterestCompoundingPeriodType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") + @Schema(example = "savings.interest.period.savingsCompoundingInterestPeriodType.daily") public String code; - @ApiModelProperty(example = "Daily") - public String value; + @Schema(example = "Daily") + public String description; } static final class GetSelfSavingsInterestPostingPeriodType { private GetSelfSavingsInterestPostingPeriodType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") + @Schema(example = "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly") public String code; - @ApiModelProperty(example = "Monthly") - public String value; + @Schema(example = "Monthly") + public String description; } static final class GetSelfSavingsInterestCalculationType { private GetSelfSavingsInterestCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationType.dailybalance") + @Schema(example = "savingsInterestCalculationType.dailybalance") public String code; - @ApiModelProperty(example = "Daily Balance") - public String value; + @Schema(example = "Daily Balance") + public String description; } static final class GetSelfSavingsInterestCalculationDaysInYearType { private GetSelfSavingsInterestCalculationDaysInYearType() {} - @ApiModelProperty(example = "365") + @Schema(example = "365") public Integer id; - @ApiModelProperty(example = "savingsInterestCalculationDaysInYearType.days365") + @Schema(example = "savingsInterestCalculationDaysInYearType.days365") public String code; - @ApiModelProperty(example = "365 Days") - public String value; + @Schema(example = "365 Days") + public String description; } static final class GetSelfSavingsSummary { @@ -138,28 +137,28 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsSummary() {} public GetSelfSavingsCurrency currency; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer accountBalance; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer clientId; - @ApiModelProperty(example = "small business") + @Schema(example = "small business") public String clientName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer savingsProductId; - @ApiModelProperty(example = "Passbook Savings") + @Schema(example = "Passbook Savings") public String savingsProductName; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer fieldOfficerId; public GetSelfSavingsStatus status; public GetSelfSavingsTimeline timeline; public GetSelfSavingsCurrency currency; - @ApiModelProperty(example = "5") + @Schema(example = "5") public Double nominalAnnualInterestRate; public GetSelfSavingsInterestCompoundingPeriodType interestCompoundingPeriodType; public GetSelfSavingsInterestPostingPeriodType interestPostingPeriodType; @@ -168,7 +167,7 @@ final class SelfSavingsApiResourceSwagger { public GetSelfSavingsSummary summary; } - @ApiModel(value = "GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse") + @Schema(description = "GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse") public static final class GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse { private GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse() {} @@ -177,19 +176,19 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsTransactionType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "savingsAccountTransactionType.withdrawal") + @Schema(example = "savingsAccountTransactionType.withdrawal") public String code; - @ApiModelProperty(example = "Withdrawal") - public String value; - @ApiModelProperty(example = "false") + @Schema(example = "Withdrawal") + public String description; + @Schema(example = "false") public Boolean deposit; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean withdrawal; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean interestPosting; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean feeDeduction; } @@ -197,19 +196,19 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsTransactionCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer inMultiplesOf; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -221,47 +220,47 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsPaymentType() {} - @ApiModelProperty(example = "11") + @Schema(example = "11") public Integer id; - @ApiModelProperty(example = "cash") + @Schema(example = "cash") public String name; } - @ApiModelProperty(example = "62") + @Schema(example = "62") public Integer id; public GetSelfSavingsPaymentType paymentType; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer accountNumber; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer checkNumber; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer routingCode; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer receiptNumber; - @ApiModelProperty(example = "") + @Schema(example = "") public Integer bankNumber; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; public GetSelfSavingsTransactionType transactionType; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer accountId; - @ApiModelProperty(example = "000000001") + @Schema(example = "000000001") public Long accountNo; - @ApiModelProperty(example = "[2013, 8, 7]") + @Schema(example = "[2013, 8, 7]") public LocalDate date; public GetSelfSavingsTransactionCurrency currency; public GetSelfSavingsPaymentDetailData paymentDetailData; - @ApiModelProperty(example = "5000") + @Schema(example = "5000") public Integer amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer runningBalance; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean reversed; } - @ApiModel(value = "GetSelfSavingsAccountsAccountIdChargesResponse") + @Schema(description = "GetSelfSavingsAccountsAccountIdChargesResponse") public static final class GetSelfSavingsAccountsAccountIdChargesResponse { private GetSelfSavingsAccountsAccountIdChargesResponse() {} @@ -270,88 +269,88 @@ final class SelfSavingsApiResourceSwagger { private GetSelfSavingsChargeTimeType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeTimeType.specifiedDueDate") + @Schema(example = "chargeTimeType.specifiedDueDate") public String code; - @ApiModelProperty(example = "Specified due date") - public String value; + @Schema(example = "Specified due date") + public String description; } static final class GetSelfSavingsChargeCalculationType { private GetSelfSavingsChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer chargeId; - @ApiModelProperty(example = "57") + @Schema(example = "57") public Integer accountId; - @ApiModelProperty(example = "Savings account maintenance fee") + @Schema(example = "Savings account maintenance fee") public String name; public GetSelfSavingsChargeTimeType chargeTimeType; public GetSelfSavingsChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetSelfSavingsAccountsResponse.GetSelfSavingsCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer amountWrittenOff; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amountOutstanding; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amountOrPercentage; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } - @ApiModel(value = "GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse") + @Schema(description = "GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse") public static final class GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse { private GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer chargeId; - @ApiModelProperty(example = "Passbook fee") + @Schema(example = "Passbook fee") public String name; public GetSelfSavingsAccountsAccountIdChargesResponse.GetSelfSavingsChargeTimeType chargeTimeType; public GetSelfSavingsAccountsAccountIdChargesResponse.GetSelfSavingsChargeCalculationType chargeCalculationType; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double percentage; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Double amountPercentageAppliedTo; public GetSelfSavingsAccountsResponse.GetSelfSavingsCurrency currency; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amount; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer amountPaid; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer amountWaived; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer amountWrittenOff; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amountOutstanding; - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer amountOrPercentage; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java index 8b94a6204..f3f4ffbc7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java @@ -18,11 +18,12 @@ */ package org.apache.fineract.portfolio.self.security.api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -38,8 +39,7 @@ import org.springframework.stereotype.Component; @Scope("singleton") @Profile("basicauth") @Path("/self/authentication") -@SwaggerDefinition(tags = { - @Tag(name = "Self Authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed") }) +@Tag(name = "Self Authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed") public class SelfAuthenticationApiResource { private final AuthenticationApiResource authenticationApiResource; @@ -52,10 +52,10 @@ public class SelfAuthenticationApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Verify authentication", httpMethod = "POST", notes = "Authenticates the credentials provided and returns the set roles and permissions allowed.\n\n" + @Operation(summary = "Verify authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed.\n\n" + "Please visit this link for more info - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#selfbasicauth") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfAuthenticationApiResourceSwagger.PostSelfAuthenticationResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfAuthenticationApiResourceSwagger.PostSelfAuthenticationResponse.class))) }) public String authenticate(final String apiRequestBodyAsJson) { return this.authenticationApiResource.authenticate(apiRequestBodyAsJson); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResourceSwagger.java index 35ae6f061..817733ca6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.security.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import java.util.Set; @@ -30,7 +29,7 @@ final class SelfAuthenticationApiResourceSwagger { private SelfAuthenticationApiResourceSwagger() {} - @ApiModel(value = "PostSelfAuthenticationResponse") + @Schema(description = "PostSelfAuthenticationResponse") public static final class PostSelfAuthenticationResponse { private PostSelfAuthenticationResponse() {} @@ -39,49 +38,49 @@ final class SelfAuthenticationApiResourceSwagger { private GetSelfUserDetailsOrganisationalRole() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "staffOrganisationalRoleType.programDirector") + @Schema(example = "staffOrganisationalRoleType.programDirector") public String code; - @ApiModelProperty(example = "Program Director") - public String value; + @Schema(example = "Program Director") + public String description; } static final class GetSelfUserDetailsRoles { private GetSelfUserDetailsRoles() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Super user") + @Schema(example = "Super user") public String name; - @ApiModelProperty(example = "This role provides all application permissions.") + @Schema(example = "This role provides all application permissions.") public String description; } - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String username; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer userId; - @ApiModelProperty(example = "bWlmb3M6cGFzc3dvcmQ=") + @Schema(example = "bWlmb3M6cGFzc3dvcmQ=") public String base64EncodedAuthenticationKey; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean authenticated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer staffId; - @ApiModelProperty(example = "Director, Program") + @Schema(example = "Director, Program") public String staffDisplayName; public GetSelfUserDetailsOrganisationalRole organisationalRole; public Set roles; - @ApiModelProperty(example = "ALL_FUNCTIONS") + @Schema(example = "ALL_FUNCTIONS") public List permissions; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isSelfServiceUser; - @ApiModelProperty(example = "1, 2, 3") + @Schema(example = "1, 2, 3") public List clients; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResource.java index 22983740e..ed7e6dad7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResource.java @@ -20,15 +20,14 @@ package org.apache.fineract.portfolio.self.security.api; import com.google.gson.reflect.TypeToken; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.lang.reflect.Type; import java.util.Arrays; import java.util.HashSet; @@ -47,8 +46,8 @@ import org.springframework.stereotype.Component; @Path("/self/user") @Component -@Api(tags = { "Self User" }) -@SwaggerDefinition(tags = { @Tag(name = "Self User", description = "") }) + +@Tag(name = "Self User", description = "") public class SelfUserApiResource { private final UsersApiResource usersApiResource; @@ -66,11 +65,11 @@ public class SelfUserApiResource { } @PUT - @ApiOperation(value = "Update User", httpMethod = "PUT", notes = "This API can be used by Self Service user to update their own user information. Currently, \"password\" and \"repeatPassword\" are the only parameters accepted.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = SelfUserApiResourceSwagger.PutSelfUserRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = SelfUserApiResourceSwagger.PutSelfUserResponse.class) }) - public String update(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update User", description = "This API can be used by Self Service user to update their own user information. Currently, \"password\" and \"repeatPassword\" are the only parameters accepted.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SelfUserApiResourceSwagger.PutSelfUserRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfUserApiResourceSwagger.PutSelfUserResponse.class))) }) + public String update(@Parameter(hidden = true) final String apiRequestBodyAsJson) { if (StringUtils.isBlank(apiRequestBodyAsJson)) { throw new InvalidJsonException(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResourceSwagger.java index a49a4feac..3f3292b86 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.security.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by Chirag Gupta on 12/20/17. @@ -28,18 +27,18 @@ final class SelfUserApiResourceSwagger { private SelfUserApiResourceSwagger() {} - @ApiModel(value = "PutSelfUserRequest") + @Schema(description = "PutSelfUserRequest") public static final class PutSelfUserRequest { private PutSelfUserRequest() {} - @ApiModelProperty(example = "Abcd1234") + @Schema(example = "Abcd1234") public String password; - @ApiModelProperty(example = "Abcd1234") + @Schema(example = "Abcd1234") public String repeatPassword; } - @ApiModel(value = "PutSelfUserResponse") + @Schema(description = "PutSelfUserResponse") public static final class PutSelfUserResponse { private PutSelfUserResponse() {} @@ -48,13 +47,13 @@ final class SelfUserApiResourceSwagger { private PutSelfUserChanges() {} - @ApiModelProperty(example = "6a72a630795be86fe926ce540fc45b6b922fe5ba130f185fe806a26b5e5efcdd") + @Schema(example = "6a72a630795be86fe926ce540fc45b6b922fe5ba130f185fe806a26b5e5efcdd") public String passwordEncoded; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "6") + @Schema(example = "6") public Integer resourceId; public PutSelfUserChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java index 8b81cd543..dda871502 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java @@ -18,13 +18,13 @@ */ package org.apache.fineract.portfolio.self.security.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -40,8 +40,8 @@ import org.springframework.stereotype.Component; @Component @Profile("oauth") @Scope("singleton") -@Api(tags = { "Self User Details" }) -@SwaggerDefinition(tags = { @Tag(name = "Self User Details", description = "") }) + +@Tag(name = "Self User Details", description = "") public class SelfUserDetailsApiResource { private final UserDetailsApiResource userDetailsApiResource; @@ -53,11 +53,12 @@ public class SelfUserDetailsApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Fetch authenticated user details", httpMethod = "GET", notes = "Checks the Authentication and returns the set roles and permissions allowed\n\n" + @Operation(summary = "Fetch authenticated user details", description = "Checks the Authentication and returns the set roles and permissions allowed\n\n" + "For more info visit this link - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#selfoauth") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = SelfUserDetailsApiResourceSwagger.GetSelfUserDetailsResponse.class) }) - public String fetchAuthenticatedUserData(@QueryParam("access_token") @ApiParam(value = "äccess_token") final String accessToken) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfUserDetailsApiResourceSwagger.GetSelfUserDetailsResponse.class))) }) + public String fetchAuthenticatedUserData( + @QueryParam("access_token") @Parameter(description = "äccess_token") final String accessToken) { return this.userDetailsApiResource.fetchAuthenticatedUserData(accessToken); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResourceSwagger.java index 9d2d3c30c..2ccf0ebbb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.self.security.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import java.util.Set; @@ -30,7 +29,7 @@ final class SelfUserDetailsApiResourceSwagger { private SelfUserDetailsApiResourceSwagger() {} - @ApiModel(value = "GetSelfUserDetailsResponse") + @Schema(description = "GetSelfUserDetailsResponse") public static final class GetSelfUserDetailsResponse { private GetSelfUserDetailsResponse() {} @@ -39,49 +38,49 @@ final class SelfUserDetailsApiResourceSwagger { private GetSelfUserDetailsOrganisationalRole() {} - @ApiModelProperty(example = "100") + @Schema(example = "100") public Integer id; - @ApiModelProperty(example = "staffOrganisationalRoleType.programDirector") + @Schema(example = "staffOrganisationalRoleType.programDirector") public String code; - @ApiModelProperty(example = "Program Director") - public String value; + @Schema(example = "Program Director") + public String description; } static final class GetSelfUserDetailsRoles { private GetSelfUserDetailsRoles() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "Super user") + @Schema(example = "Super user") public String name; - @ApiModelProperty(example = "This role provides all application permissions.") + @Schema(example = "This role provides all application permissions.") public String description; } - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String username; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer userId; - @ApiModelProperty(example = "bWlmb3M6cGFzc3dvcmQ=") + @Schema(example = "bWlmb3M6cGFzc3dvcmQ=") public String base64EncodedAuthenticationKey; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean authenticated; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer staffId; - @ApiModelProperty(example = "Director, Program") + @Schema(example = "Director, Program") public String staffDisplayName; public GetSelfUserDetailsOrganisationalRole organisationalRole; public Set roles; - @ApiModelProperty(example = "ALL_FUNCTIONS") + @Schema(example = "ALL_FUNCTIONS") public List permissions; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isSelfServiceUser; - @ApiModelProperty(example = "[1, 2, 3]") + @Schema(example = "[1, 2, 3]") public List clients; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResource.java index 00186d6df..612e74df5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResource.java @@ -19,13 +19,14 @@ package org.apache.fineract.portfolio.self.shareaccounts.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -65,8 +66,8 @@ import org.springframework.stereotype.Component; @Path("/self/shareaccounts") @Component @Scope("singleton") -@Api(tags = { "Self Share Accounts" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Share Accounts", description = "") }) + +@Tag(name = "Self Share Accounts", description = "") public class SelfShareAccountsApiResource { private final PlatformSecurityContext context; @@ -104,15 +105,15 @@ public class SelfShareAccountsApiResource { @Path("template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Share Account Template", httpMethod = "GET", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + @Operation(summary = "Retrieve Share Account Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + "Field Defaults\n" + "\n" + "Allowed Value Lists\n" + "\n" + "\n" + "Arguments\n" + "\n" + "clientId:Integer mandatory\n" + "productId:Integer optionalIf entered, productId, productName and selectedProduct fields are returned.\n" + "Example Requests:\n" + "\n" + "self/shareaccounts/template?clientId=14\n" + "\n" + "self/shareaccounts/template?clientId=14&productId=3\n") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = SelfShareAccountsApiResourceSwagger.GetShareAccountsClientIdProductIdResponse.class) }) - public String template(@QueryParam("clientId") @ApiParam("clientId") final Long clientId, - @QueryParam("productId") @ApiParam("productId") final Long productId, @Context final UriInfo uriInfo) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfShareAccountsApiResourceSwagger.GetShareAccountsClientIdProductIdResponse.class)))) }) + public String template(@QueryParam("clientId") @Parameter(name = "clientId") final Long clientId, + @QueryParam("productId") @Parameter(name = "productId") final Long productId, @Context final UriInfo uriInfo) { validateAppuserClientsMapping(clientId); @@ -136,12 +137,12 @@ public class SelfShareAccountsApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Submit new share application", httpMethod = "POST", notes = "Mandatory fields:\n" + "\n" + @Operation(summary = "Submit new share application", description = "Mandatory fields:\n" + "\n" + "clientId, productId, submittedDate, savingsAccountId, requestedShares, applicationDate\n" + "\n" + "\n" + "Optional Fields\n" + "\n" + "accountNo, externalId\n" + "\n" + "\n" + "Inherited from Product (if not provided)\n" + "\n" + "minimumActivePeriod, minimumActivePeriodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType.") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", responseContainer = "List", response = SelfShareAccountsApiResourceSwagger.PostNewShareApplicationResponse.class) }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SelfShareAccountsApiResourceSwagger.PostNewShareApplicationResponse.class)))) }) public String createAccount(final String apiRequestBodyAsJson) { HashMap attr = this.selfShareAccountsDataValidator.validateShareAccountApplication(apiRequestBodyAsJson); final Long clientId = (Long) attr.get(ShareAccountApiConstants.clientid_paramname); @@ -154,13 +155,14 @@ public class SelfShareAccountsApiResource { @Path("{accountId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a share application/account", httpMethod = "GET", notes = "\n" + "\n" + "\n" + "Example Requests:\n" - + "\n" + "self/shareaccounts/12\n") + @Operation(summary = "Retrieve a share application/account", description = "\n" + "\n" + "\n" + "Example Requests:\n" + "\n" + + "self/shareaccounts/12\n") // TODO actually write // SelfShareAccountsApiResourceSwagger.GetShareAccountResponse (it currently // does not exist) - // @ApiResponses({@ApiResponse(code = 200, message = "OK", responseContainer - // = "List", response = + // @ApiResponses({@ApiResponse(responseCode = "200", description = "OK", + // responseContainer + // = "List", schema = @Schema(implementation = // SelfShareAccountsApiResourceSwagger.GetShareAccountResponse.class)}) public String retrieveShareAccount(@PathParam("accountId") final Long accountId, @Context final UriInfo uriInfo) { validateAppuserShareAccountMapping(accountId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResourceSwagger.java index 9da47924b..387033062 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/shareaccounts/api/SelfShareAccountsApiResourceSwagger.java @@ -19,8 +19,7 @@ package org.apache.fineract.portfolio.self.shareaccounts.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; /** @@ -33,7 +32,7 @@ final class SelfShareAccountsApiResourceSwagger { } - @ApiModel(value = "GetShareAccountsClientIdResponse") + @Schema(description = "GetShareAccountsClientIdResponse") public static final class GetShareAccountsClientIdResponse { private GetShareAccountsClientIdResponse() {} @@ -42,13 +41,13 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsProductOptions() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String name; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String shortName; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer totalShares; } @@ -60,17 +59,17 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsCurrency() {} - @ApiModelProperty(example = "USD") + @Schema(example = "USD") public String code; - @ApiModelProperty(example = "US Dollar") + @Schema(example = "US Dollar") public String name; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer decimalPlaces; - @ApiModelProperty(example = "$") + @Schema(example = "$") public String displaySymbol; - @ApiModelProperty(example = "currency.USD") + @Schema(example = "currency.USD") public String nameCode; - @ApiModelProperty(example = "US Dollar ($)") + @Schema(example = "US Dollar ($)") public String displayLabel; } @@ -79,60 +78,60 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsChargeTimeType() {} - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer id; - @ApiModelProperty(example = "chargeTimeType.sharespurchase") + @Schema(example = "chargeTimeType.sharespurchase") public String code; - @ApiModelProperty(example = "Share purchase") - public String value; + @Schema(example = "Share purchase") + public String description; } static final class GetShareAccountsChargeAppliesTo { private GetShareAccountsChargeAppliesTo() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "chargeAppliesTo.shares") + @Schema(example = "chargeAppliesTo.shares") public String code; - @ApiModelProperty(example = "Shares") - public String value; + @Schema(example = "Shares") + public String description; } static final class GetShareAccountsChargeCalculationType { private GetShareAccountsChargeCalculationType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "chargeCalculationType.flat") + @Schema(example = "chargeCalculationType.flat") public String code; - @ApiModelProperty(example = "Flat") - public String value; + @Schema(example = "Flat") + public String description; } static final class GetShareAccountsChargePaymentMode { private GetShareAccountsChargePaymentMode() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "chargepaymentmode.regular") + @Schema(example = "chargepaymentmode.regular") public String code; - @ApiModelProperty(example = "Regular") - public String value; + @Schema(example = "Regular") + public String description; } - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Activation fee") + @Schema(example = "Activation fee") public String name; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean penalty; public GetShareAccountsCurrency currency; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer amount; public GetShareAccountsChargeTimeType chargeTimeType; public GetShareAccountsChargeAppliesTo chargeAppliesTo; @@ -141,13 +140,13 @@ final class SelfShareAccountsApiResourceSwagger { } - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer clientId; public Set productOptions; public Set chargeOptions; } - @ApiModel(value = "GetShareAccountsClientIdProductIdResponse") + @Schema(description = "GetShareAccountsClientIdProductIdResponse") public static final class GetShareAccountsClientIdProductIdResponse { private GetShareAccountsClientIdProductIdResponse() {} @@ -160,12 +159,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsClientIdProductIdLockPeriodTypeEnum() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "shares.lockin.sharePeriodFrequencyType.days") + @Schema(example = "shares.lockin.sharePeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "days") - public String value; + @Schema(example = "days") + public String description; } @@ -173,12 +172,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsClientIdProductIdMinimumActivePeriodForDividendsTypeEnum() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "shares.minimumactive.sharePeriodFrequencyType.days") + @Schema(example = "shares.minimumactive.sharePeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "days") - public String value; + @Schema(example = "days") + public String description; } @@ -186,12 +185,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsClientIdProductIdAccountingRule() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountingRuleType.cash") + @Schema(example = "accountingRuleType.cash") public String code; - @ApiModelProperty(example = "CASH BASED") - public String value; + @Schema(example = "CASH BASED") + public String description; } @@ -203,11 +202,11 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsShareReferenceId() {} - @ApiModelProperty(example = "32") + @Schema(example = "32") public Integer id; - @ApiModelProperty(example = "Cash in Hand") + @Schema(example = "Cash in Hand") public String name; - @ApiModelProperty(example = "20301") + @Schema(example = "20301") public Integer glCode; } @@ -216,11 +215,11 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsIncomeFromFeeAccountId() {} - @ApiModelProperty(example = "40") + @Schema(example = "40") public Integer id; - @ApiModelProperty(example = "Other Operating Income") + @Schema(example = "Other Operating Income") public String name; - @ApiModelProperty(example = "30105") + @Schema(example = "30105") public Integer glCode; } @@ -229,11 +228,11 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsShareEquityId() {} - @ApiModelProperty(example = "56") + @Schema(example = "56") public Integer id; - @ApiModelProperty(example = "Share Equity") + @Schema(example = "Share Equity") public String name; - @ApiModelProperty(example = "00098") + @Schema(example = "00098") public Integer glCode; } @@ -242,11 +241,11 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsShareSuspenseId() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "Overpayment Liability") + @Schema(example = "Overpayment Liability") public String name; - @ApiModelProperty(example = "10200") + @Schema(example = "10200") public Integer glCode; } @@ -261,12 +260,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetClientIdProductIdMinimumActivePeriodFrequencyTypeOptions() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "shares.lockin.sharePeriodFrequencyType.days") + @Schema(example = "shares.lockin.sharePeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public Integer value; + @Schema(example = "Days") + public Integer description; } @@ -274,12 +273,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetClientIdProductIdLockinPeriodFrequencyTypeOptions() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "shares.lockin.sharePeriodFrequencyType.days") + @Schema(example = "shares.lockin.sharePeriodFrequencyType.days") public String code; - @ApiModelProperty(example = "Days") - public Integer value; + @Schema(example = "Days") + public Integer description; } @@ -295,12 +294,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetLiabilityAccountType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.liability") + @Schema(example = "accountType.liability") public String code; - @ApiModelProperty(example = "LIABILITY") - public Integer value; + @Schema(example = "LIABILITY") + public Integer description; } @@ -308,12 +307,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetLiabilityAccountUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public Integer value; + @Schema(example = "DETAIL") + public Integer description; } @@ -321,30 +320,30 @@ final class SelfShareAccountsApiResourceSwagger { private GetLiabilityAccountTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean mandatory; } - @ApiModelProperty(example = "30") + @Schema(example = "30") public Integer id; - @ApiModelProperty(example = "Recurring Deposits") + @Schema(example = "Recurring Deposits") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer parentId; - @ApiModelProperty(example = "10104") + @Schema(example = "10104") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetLiabilityAccountType type; public GetLiabilityAccountUsage usage; - @ApiModelProperty(example = " ....Recurring Deposits") + @Schema(example = " ....Recurring Deposits") public String nameDecorated; public GetLiabilityAccountTagId tagId; @@ -358,12 +357,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetAssetAccountType() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountType.asset") + @Schema(example = "accountType.asset") public String code; - @ApiModelProperty(example = "ASSET") - public Integer value; + @Schema(example = "ASSET") + public Integer description; } @@ -371,12 +370,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetAssetAccountUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public Integer value; + @Schema(example = "DETAIL") + public Integer description; } @@ -384,30 +383,30 @@ final class SelfShareAccountsApiResourceSwagger { private GetAssetAccountTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean mandatory; } - @ApiModelProperty(example = "31") + @Schema(example = "31") public Integer id; - @ApiModelProperty(example = "Furniture and Fixtures") + @Schema(example = "Furniture and Fixtures") public String name; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer parentId; - @ApiModelProperty(example = "20101") + @Schema(example = "20101") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetAssetAccountType type; public GetAssetAccountUsage usage; - @ApiModelProperty(example = " ....Furniture and Fixtures") + @Schema(example = " ....Furniture and Fixtures") public String nameDecorated; public GetAssetAccountTagId tagId; @@ -421,12 +420,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetIncomeAccountType() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "accountType.income") + @Schema(example = "accountType.income") public String code; - @ApiModelProperty(example = "INCOME") - public Integer value; + @Schema(example = "INCOME") + public Integer description; } @@ -434,12 +433,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetIncomeAccountUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public Integer value; + @Schema(example = "DETAIL") + public Integer description; } @@ -447,30 +446,30 @@ final class SelfShareAccountsApiResourceSwagger { private GetIncomeAccountTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean mandatory; } - @ApiModelProperty(example = "54") + @Schema(example = "54") public Integer id; - @ApiModelProperty(example = "Loan Recovery (Temp)") + @Schema(example = "Loan Recovery (Temp)") public String name; - @ApiModelProperty(example = "220002-Temp") + @Schema(example = "220002-Temp") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetIncomeAccountType type; public GetIncomeAccountUsage usage; - @ApiModelProperty(example = "Temporary account to track income from Loan recovery") + @Schema(example = "Temporary account to track income from Loan recovery") public String Description; - @ApiModelProperty(example = "Loan Recovery (Temp)") + @Schema(example = "Loan Recovery (Temp)") public String nameDecorated; public GetIncomeAccountTagId tagId; } @@ -483,12 +482,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsEquityAccountType() {} - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "accountType.equity") + @Schema(example = "accountType.equity") public String code; - @ApiModelProperty(example = "EQUITY") - public Integer value; + @Schema(example = "EQUITY") + public Integer description; } @@ -496,12 +495,12 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsEquityAccountUsage() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "accountUsage.detail") + @Schema(example = "accountUsage.detail") public String code; - @ApiModelProperty(example = "DETAIL") - public Integer value; + @Schema(example = "DETAIL") + public Integer description; } @@ -509,30 +508,30 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsEquityAccountTagId() {} - @ApiModelProperty(example = "0") + @Schema(example = "0") public Integer id; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean active; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean mandatory; } - @ApiModelProperty(example = "56") + @Schema(example = "56") public Integer id; - @ApiModelProperty(example = "Share Equity") + @Schema(example = "Share Equity") public String name; - @ApiModelProperty(example = "25") + @Schema(example = "25") public Integer parentId; - @ApiModelProperty(example = "00098") + @Schema(example = "00098") public Integer glCode; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean disabled; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean manualEntriesAllowed; public GetShareAccountsEquityAccountType type; public GetShareAccountsEquityAccountUsage usage; - @ApiModelProperty(example = "....Share Equity") + @Schema(example = "....Share Equity") public String nameDecorated; public GetShareAccountsEquityAccountTagId tagId; @@ -540,39 +539,39 @@ final class SelfShareAccountsApiResourceSwagger { } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer id; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String name; - @ApiModelProperty(example = "SP") + @Schema(example = "SP") public String shortName; - @ApiModelProperty(example = "SP1") + @Schema(example = "SP1") public String description; public GetShareAccountsClientIdResponse.GetShareAccountsChargeOptions.GetShareAccountsCurrency currency; - @ApiModelProperty(example = "1000") + @Schema(example = "1000") public Integer totalShares; - @ApiModelProperty(example = "900") + @Schema(example = "900") public Integer totalSharesIssued; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer unitPrice; - @ApiModelProperty(example = "900") + @Schema(example = "900") public Integer shareCapital; - @ApiModelProperty(example = "8") + @Schema(example = "8") public Integer minimumShares; - @ApiModelProperty(example = "500") + @Schema(example = "500") public Integer norminalShares; - @ApiModelProperty(example = "500") + @Schema(example = "500") public Integer maximumShares; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public String marketPrice; - @ApiModelProperty(example = "[]") + @Schema(example = "[]") public String charges; - @ApiModelProperty(example = "False") + @Schema(example = "False") public Boolean allowDividendCalculationForInactiveClients; - @ApiModelProperty(example = "50") + @Schema(example = "50") public Integer lockinPeriod; public GetShareAccountsClientIdProductIdLockPeriodTypeEnum lockinPeriodEnum; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Integer minimumActivePeriod; public GetShareAccountsClientIdProductIdMinimumActivePeriodForDividendsTypeEnum minimumActivePeriodForDividendsTypeEnum; public GetShareAccountsClientIdProductIdAccountingRule accountingRule; @@ -595,7 +594,7 @@ final class SelfShareAccountsApiResourceSwagger { public Set chargeOptions; } - @ApiModel(value = "PostNewShareApplicationRequest") + @Schema(description = "PostNewShareApplicationRequest") public static final class PostNewShareApplicationRequest { private PostNewShareApplicationRequest() {} @@ -604,39 +603,39 @@ final class SelfShareAccountsApiResourceSwagger { private GetShareAccountsCharges() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer chargeId; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer amount; } - @ApiModelProperty(example = "3") + @Schema(example = "3") public Integer productId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer unitPrice; - @ApiModelProperty(example = "500") + @Schema(example = "500") public Integer requestedShares; - @ApiModelProperty(example = "31 July 2018") + @Schema(example = "31 July 2018") public String submittedDate; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer savingsAccountId; - @ApiModelProperty(example = "31 July 2018") + @Schema(example = "31 July 2018") public String applicationDate; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM YYYY") + @Schema(example = "dd MMMM YYYY") public String dateFormat; public GetShareAccountsCharges charges; - @ApiModelProperty(example = "14") + @Schema(example = "14") public Integer clientId; } - @ApiModel(value = "PostNewShareApplicationResponse") + @Schema(description = "PostNewShareApplicationResponse") public static final class PostNewShareApplicationResponse { private PostNewShareApplicationResponse() {} - @ApiModelProperty(example = "12") + @Schema(example = "12") public Integer resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfScorecardApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfScorecardApiResource.java index 85d3f3d7f..a87780a1a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfScorecardApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfScorecardApiResource.java @@ -19,9 +19,7 @@ package org.apache.fineract.portfolio.self.spm.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -44,8 +42,8 @@ import org.springframework.transaction.annotation.Transactional; @Path("/self/surveys/scorecards") @Component @Scope("singleton") -@Api(tags = { "Self Score Card" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Score Card", description = "") }) + +@Tag(name = "Self Score Card", description = "") public class SelfScorecardApiResource { private final PlatformSecurityContext context; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfSpmApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfSpmApiResource.java index 8222ab2c2..b0d53bd6d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfSpmApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/spm/api/SelfSpmApiResource.java @@ -19,9 +19,7 @@ package org.apache.fineract.portfolio.self.spm.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -39,8 +37,8 @@ import org.springframework.transaction.annotation.Transactional; @Path("/self/surveys") @Component @Scope("singleton") -@Api(tags = { "Self Spm" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Spm", description = "") }) + +@Tag(name = "Self Spm", description = "") public class SelfSpmApiResource { private final PlatformSecurityContext securityContext; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/api/ShareDividendApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/api/ShareDividendApiResource.java index e8315d359..d3a6bd55a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/api/ShareDividendApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/api/ShareDividendApiResource.java @@ -18,9 +18,7 @@ */ package org.apache.fineract.portfolio.shareproducts.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.tags.Tag; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -52,8 +50,8 @@ import org.springframework.stereotype.Component; @Path("/shareproduct/{productId}/dividend") @Component @Scope("singleton") -@Api(tags = { "Self Dividend" }) -@SwaggerDefinition(tags = { @Tag(name = "Self Dividend", description = "") }) + +@Tag(name = "Self Dividend", description = "") public class ShareDividendApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java index 052f952e4..47df4d8cb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.tax.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -55,8 +55,8 @@ import org.springframework.stereotype.Component; @Path("/taxes/component") @Component @Scope("singleton") -@Api(tags = { "Tax Components" }) -@SwaggerDefinition(tags = { @Tag(name = "Tax Components", description = "This defines the Tax Components") }) + +@Tag(name = "Tax Components", description = "This defines the Tax Components") public class TaxComponentApiResource { private final String resourceNameForPermissions = "TAXCOMPONENT"; @@ -82,9 +82,9 @@ public class TaxComponentApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Tax Components", httpMethod = "GET", notes = "List Tax Components") + @Operation(summary = "List Tax Components", description = "List Tax Components") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = TaxComponentApiResourceSwagger.GetTaxesComponentsResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TaxComponentApiResourceSwagger.GetTaxesComponentsResponse.class)))) }) public String retrieveAllTaxComponents(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -99,9 +99,10 @@ public class TaxComponentApiResource { @Path("{taxComponentId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Tax Component", httpMethod = "GET", notes = "Retrieve Tax Component") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = TaxComponentApiResourceSwagger.GetTaxesComponentsResponse.class) }) - public String retrieveTaxComponent(@PathParam("taxComponentId") @ApiParam(value = "taxComponentId") final Long taxComponentId, + @Operation(summary = "Retrieve Tax Component", description = "Retrieve Tax Component") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.GetTaxesComponentsResponse.class))) }) + public String retrieveTaxComponent(@PathParam("taxComponentId") @Parameter(description = "taxComponentId") final Long taxComponentId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -129,13 +130,13 @@ public class TaxComponentApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a new Tax Component", httpMethod = "POST", notes = "Creates a new Tax Component\n\n" + @Operation(summary = "Create a new Tax Component", description = "Creates a new Tax Component\n\n" + "Mandatory Fields: name, percentage\n\n" + "Optional Fields: debitAccountType, debitAcountId, creditAccountType, creditAcountId, startDate") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TaxComponentApiResourceSwagger.PostTaxesComponentsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = TaxComponentApiResourceSwagger.PostTaxesComponentsResponse.class) }) - public String createTaxCompoent(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.PostTaxesComponentsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.PostTaxesComponentsResponse.class))) }) + public String createTaxCompoent(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createTaxComponent().withJson(apiRequestBodyAsJson).build(); @@ -148,13 +149,12 @@ public class TaxComponentApiResource { @Path("{taxComponentId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Tax Component", httpMethod = "PUT", notes = "Updates Tax component. Debit and credit account details cannot be modified. All the future tax components would be replaced with the new percentage.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TaxComponentApiResourceSwagger.PutTaxesComponentsTaxComponentIdRequest.class) }) + @Operation(summary = "Update Tax Component", description = "Updates Tax component. Debit and credit account details cannot be modified. All the future tax components would be replaced with the new percentage.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.PutTaxesComponentsTaxComponentIdRequest.class))) @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = TaxComponentApiResourceSwagger.PutTaxesComponentsTaxComponentIdResponse.class) }) - public String updateTaxCompoent(@PathParam("taxComponentId") @ApiParam(value = "taxComponentId") final Long taxComponentId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.PutTaxesComponentsTaxComponentIdResponse.class))) }) + public String updateTaxCompoent(@PathParam("taxComponentId") @Parameter(description = "taxComponentId") final Long taxComponentId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateTaxComponent(taxComponentId).withJson(apiRequestBodyAsJson) .build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResourceSwagger.java index 99368b86c..3eadbb6fd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.tax.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.Set; @@ -30,7 +29,7 @@ final class TaxComponentApiResourceSwagger { private TaxComponentApiResourceSwagger() {} - @ApiModel(value = "GetTaxesComponentsResponse") + @Schema(description = "GetTaxesComponentsResponse") public static final class GetTaxesComponentsResponse { private GetTaxesComponentsResponse() {} @@ -39,23 +38,23 @@ final class TaxComponentApiResourceSwagger { private GetTaxesComponentsCreditAccountType() {} - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer id; - @ApiModelProperty(example = "accountType.liability") + @Schema(example = "accountType.liability") public String code; - @ApiModelProperty(example = "LIABILITY") - public String value; + @Schema(example = "LIABILITY") + public String description; } static final class GetTaxesComponentsCreditAccount { private GetTaxesComponentsCreditAccount() {} - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer id; - @ApiModelProperty(example = "ACCOUNT_NAME_7BR9C") + @Schema(example = "ACCOUNT_NAME_7BR9C") public String name; - @ApiModelProperty(example = "LIABILITY_PA1460364665046") + @Schema(example = "LIABILITY_PA1460364665046") public String glCode; } @@ -64,67 +63,67 @@ final class TaxComponentApiResourceSwagger { private GetTaxesComponentsHistories() {} } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer id; - @ApiModelProperty(example = "tax component 1") + @Schema(example = "tax component 1") public String name; - @ApiModelProperty(example = "10.000000") + @Schema(example = "10.000000") public Float percentage; public GetTaxesComponentsCreditAccountType creditAccountType; public GetTaxesComponentsCreditAccount creditAccount; - @ApiModelProperty(example = "[2016, 4, 11]") + @Schema(example = "[2016, 4, 11]") public LocalDate startDate; public Set taxComponentsHistories; } - @ApiModel(value = "PostTaxesComponentsRequest") + @Schema(description = "PostTaxesComponentsRequest") public static final class PostTaxesComponentsRequest { private PostTaxesComponentsRequest() {} - @ApiModelProperty(example = "tax component 1") + @Schema(example = "tax component 1") public String name; - @ApiModelProperty(example = "10") + @Schema(example = "10") public Float percentage; - @ApiModelProperty(example = "2") + @Schema(example = "2") public Integer creditAccountType; - @ApiModelProperty(example = "4") + @Schema(example = "4") public Integer creditAcountId; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "11 April 2016") + @Schema(example = "11 April 2016") public String startDate; } - @ApiModel(value = "PostTaxesComponentsResponse") + @Schema(description = "PostTaxesComponentsResponse") public static final class PostTaxesComponentsResponse { private PostTaxesComponentsResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutTaxesComponentsTaxComponentIdRequest") + @Schema(description = "PutTaxesComponentsTaxComponentIdRequest") public static final class PutTaxesComponentsTaxComponentIdRequest { private PutTaxesComponentsTaxComponentIdRequest() {} - @ApiModelProperty(example = "tax component 2") + @Schema(example = "tax component 2") public String name; - @ApiModelProperty(example = "15") + @Schema(example = "15") public Float percentage; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; - @ApiModelProperty(example = "15 April 2016") + @Schema(example = "15 April 2016") public String startDate; } - @ApiModel(value = "PutTaxesComponentsTaxComponentIdResponse") + @Schema(description = "PutTaxesComponentsTaxComponentIdResponse") public static final class PutTaxesComponentsTaxComponentIdResponse { private PutTaxesComponentsTaxComponentIdResponse() {} @@ -133,15 +132,15 @@ final class TaxComponentApiResourceSwagger { private PutTaxesComponentsChanges() {} - @ApiModelProperty(example = "15") + @Schema(example = "15") public Float percentage; - @ApiModelProperty(example = "tax component 2") + @Schema(example = "tax component 2") public String name; - @ApiModelProperty(example = "[2016, 4, 15]") + @Schema(example = "[2016, 4, 15]") public LocalDate startDate; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; public PutTaxesComponentsChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java index 6373445d5..5fce11847 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.portfolio.tax.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -55,8 +55,8 @@ import org.springframework.stereotype.Component; @Path("/taxes/group") @Component @Scope("singleton") -@Api(tags = { "Tax Group" }) -@SwaggerDefinition(tags = { @Tag(name = "Tax Group", description = "This defines the Tax Group") }) + +@Tag(name = "Tax Group", description = "This defines the Tax Group") public class TaxGroupApiResource { private final String resourceNameForPermissions = "TAXGROUP"; @@ -81,9 +81,9 @@ public class TaxGroupApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Tax Group", httpMethod = "GET", notes = "List Tax Group") + @Operation(summary = "List Tax Group", description = "List Tax Group") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = TaxGroupApiResourceSwagger.GetTaxesGroupResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TaxGroupApiResourceSwagger.GetTaxesGroupResponse.class)))) }) public String retrieveAllTaxGroups(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -98,9 +98,10 @@ public class TaxGroupApiResource { @Path("{taxGroupId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve Tax Group", httpMethod = "GET", notes = "Retrieve Tax Group") - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = TaxGroupApiResourceSwagger.GetTaxesGroupResponse.class) }) - public String retrieveTaxGroup(@PathParam("taxGroupId") @ApiParam(value = "taxGroupId") final Long taxGroupId, + @Operation(summary = "Retrieve Tax Group", description = "Retrieve Tax Group") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.GetTaxesGroupResponse.class))) }) + public String retrieveTaxGroup(@PathParam("taxGroupId") @Parameter(description = "taxGroupId") final Long taxGroupId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -132,13 +133,12 @@ public class TaxGroupApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a new Tax Group", httpMethod = "POST", notes = "Create a new Tax Group\n" - + "Mandatory Fields: name and taxComponents\n" + "Mandatory Fields in taxComponents: taxComponentId\n" - + "Optional Fields in taxComponents: id, startDate and endDate") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TaxGroupApiResourceSwagger.PostTaxesGroupRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = TaxGroupApiResourceSwagger.PostTaxesGroupResponse.class) }) - public String createTaxGroup(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a new Tax Group", description = "Create a new Tax Group\n" + "Mandatory Fields: name and taxComponents\n" + + "Mandatory Fields in taxComponents: taxComponentId\n" + "Optional Fields in taxComponents: id, startDate and endDate") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.PostTaxesGroupRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.PostTaxesGroupResponse.class))) }) + public String createTaxGroup(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createTaxGroup().withJson(apiRequestBodyAsJson).build(); @@ -151,12 +151,12 @@ public class TaxGroupApiResource { @Path("{taxGroupId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update Tax Group", httpMethod = "PUT", notes = "Updates Tax Group. Only end date can be up-datable and can insert new tax components.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TaxGroupApiResourceSwagger.PutTaxesGroupTaxGroupIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = TaxGroupApiResourceSwagger.PutTaxesGroupTaxGroupIdResponse.class) }) - public String updateTaxGroup(@PathParam("taxGroupId") @ApiParam(value = "taxGroupId") final Long taxGroupId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update Tax Group", description = "Updates Tax Group. Only end date can be up-datable and can insert new tax components.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.PutTaxesGroupTaxGroupIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.PutTaxesGroupTaxGroupIdResponse.class))) }) + public String updateTaxGroup(@PathParam("taxGroupId") @Parameter(description = "taxGroupId") final Long taxGroupId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateTaxGroup(taxGroupId).withJson(apiRequestBodyAsJson).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResourceSwagger.java index e5bfbf613..1a3c4a0f9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.portfolio.tax.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDate; import java.util.List; import java.util.Set; @@ -31,7 +30,7 @@ final class TaxGroupApiResourceSwagger { private TaxGroupApiResourceSwagger() {} - @ApiModel(value = "GetTaxesGroupResponse") + @Schema(description = "GetTaxesGroupResponse") public static final class GetTaxesGroupResponse { private GetTaxesGroupResponse() {} @@ -44,27 +43,27 @@ final class TaxGroupApiResourceSwagger { private GetTaxesGroupTaxComponent() {} - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer id; - @ApiModelProperty(example = "tax component 2") + @Schema(example = "tax component 2") public String name; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer id; public GetTaxesGroupTaxComponent taxComponent; - @ApiModelProperty(example = "[2016, 4, 11]") + @Schema(example = "[2016, 4, 11]") public LocalDate startDate; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer id; - @ApiModelProperty(example = "tax group 1") + @Schema(example = "tax group 1") public String name; public Set taxAssociations; } - @ApiModel(value = "PostTaxesGroupRequest") + @Schema(description = "PostTaxesGroupRequest") public static final class PostTaxesGroupRequest { private PostTaxesGroupRequest() {} @@ -73,31 +72,31 @@ final class TaxGroupApiResourceSwagger { private PostTaxesGroupTaxComponents() {} - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer taxComponentId; - @ApiModelProperty(example = "11 April 2016") + @Schema(example = "11 April 2016") public String startDate; } - @ApiModelProperty(example = "tax group 1") + @Schema(example = "tax group 1") public String name; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; public Set taxComponents; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; } - @ApiModel(value = "PostTaxesGroupResponse") + @Schema(description = "PostTaxesGroupResponse") public static final class PostTaxesGroupResponse { private PostTaxesGroupResponse() {} - @ApiModelProperty(example = "1") + @Schema(example = "1") public Integer resourceId; } - @ApiModel(value = "PutTaxesGroupTaxGroupIdRequest") + @Schema(description = "PutTaxesGroupTaxGroupIdRequest") public static final class PutTaxesGroupTaxGroupIdRequest { private PutTaxesGroupTaxGroupIdRequest() {} @@ -106,24 +105,24 @@ final class TaxGroupApiResourceSwagger { private PutTaxesGroupTaxComponents() {} - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer id; - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer taxComponentId; - @ApiModelProperty(example = "22 April 2016") + @Schema(example = "22 April 2016") public String endDate; } - @ApiModelProperty(example = "tax group 2") + @Schema(example = "tax group 2") public String name; - @ApiModelProperty(example = "en") + @Schema(example = "en") public String locale; public Set taxComponents; - @ApiModelProperty(example = "dd MMMM yyyy") + @Schema(example = "dd MMMM yyyy") public String dateFormat; } - @ApiModel(value = "PutTaxesGroupTaxGroupIdResponse") + @Schema(description = "PutTaxesGroupTaxGroupIdResponse") public static final class PutTaxesGroupTaxGroupIdResponse { private PutTaxesGroupTaxGroupIdResponse() {} @@ -136,20 +135,20 @@ final class TaxGroupApiResourceSwagger { private PutTaxesGroupModifiedComponents() {} - @ApiModelProperty(example = "Apr 22, 2016 12:00:00 AM") + @Schema(example = "Apr 22, 2016 12:00:00 AM") public String endDate; - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer taxComponentId; } - @ApiModelProperty(example = "[6]") + @Schema(example = "[6]") public List addComponents; public Set modifiedComponents; - @ApiModelProperty(example = "tax group 2") + @Schema(example = "tax group 2") public String name; } - @ApiModelProperty(example = "7") + @Schema(example = "7") public Integer resourceId; public PutTaxesGroupChanges changes; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java index ff12beb40..280500a4c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.spm.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collections; import java.util.List; import javax.ws.rs.Consumes; @@ -51,9 +52,7 @@ import org.springframework.transaction.annotation.Transactional; @Path("/surveys/{surveyId}/lookuptables") @Component @Scope("singleton") -@Api(tags = { "SPM API - LookUp Table" }) -@SwaggerDefinition(tags = { - @Tag(name = "SPM API - LookUp Table", description = "The Apache Fineract SPM API provides the ability to create custom surveys to collect social performance measurentment data or any additional questionnaire a financial institute want to collect.") }) +@Tag(name = "SPM API - LookUp Table", description = "The Apache Fineract SPM API provides the ability to create custom surveys to collect social performance measurentment data or any additional questionnaire a financial institute want to collect.") public class LookupTableApiResource { private final PlatformSecurityContext securityContext; @@ -73,9 +72,10 @@ public class LookupTableApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "List all Lookup Table entries", notes = "List all Lookup Table entries for a survey.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = LookupTableData.class, responseContainer = "list") }) - public List fetchLookupTables(@PathParam("surveyId") @ApiParam(value = "Enter surveyId") final Long surveyId) { + @Operation(summary = "List all Lookup Table entries", description = "List all Lookup Table entries for a survey.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = LookupTableData.class)))) }) + public List fetchLookupTables(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId) { this.securityContext.authenticatedUser(); final Survey survey = findSurvey(surveyId); @@ -94,10 +94,11 @@ public class LookupTableApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "Retrieve a Lookup Table entry", notes = "Retrieve a Lookup Table entry for a survey.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = LookupTableData.class) }) - public LookupTableData findLookupTable(@PathParam("surveyId") @ApiParam(value = "Enter surveyId") final Long surveyId, - @PathParam("key") @ApiParam(value = "Enter key") final String key) { + @Operation(summary = "Retrieve a Lookup Table entry", description = "Retrieve a Lookup Table entry for a survey.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = LookupTableData.class))) }) + public LookupTableData findLookupTable(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId, + @PathParam("key") @Parameter(description = "Enter key") final String key) { this.securityContext.authenticatedUser(); findSurvey(surveyId); @@ -115,10 +116,10 @@ public class LookupTableApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "Create a Lookup Table entry", notes = "Add a new entry to a survey.\n" + "\n" + "Mandatory Fields\n" + @Operation(summary = "Create a Lookup Table entry", description = "Add a new entry to a survey.\n" + "\n" + "Mandatory Fields\n" + "key, score, validFrom, validTo") - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) - public void createLookupTable(@PathParam("surveyId") @ApiParam(value = "Enter surveyId") final Long surveyId, + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + public void createLookupTable(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId, final LookupTableData lookupTableData) { this.securityContext.authenticatedUser(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/api/ScorecardApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/spm/api/ScorecardApiResource.java index 5f713a0b5..3a93417d6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/api/ScorecardApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/api/ScorecardApiResource.java @@ -18,13 +18,14 @@ */ package org.apache.fineract.spm.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -52,8 +53,8 @@ import org.springframework.transaction.annotation.Transactional; @Path("/surveys/scorecards") @Component @Scope("singleton") -@Api(tags = { "Score Card" }) -@SwaggerDefinition(tags = { @Tag(name = "Score Card", description = "") }) + +@Tag(name = "Score Card", description = "") public class ScorecardApiResource { private final PlatformSecurityContext securityContext; @@ -78,9 +79,10 @@ public class ScorecardApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "List all Scorecard entries", notes = "List all Scorecard entries for a survey.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = Scorecard.class, responseContainer = "list") }) - public List findBySurvey(@PathParam("surveyId") @ApiParam(value = "Enter surveyId") final Long surveyId) { + @Operation(summary = "List all Scorecard entries", description = "List all Scorecard entries for a survey.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Scorecard.class)))) }) + public List findBySurvey(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId) { this.securityContext.authenticatedUser(); this.spmService.findById(surveyId); return (List) this.scorecardReadPlatformService.retrieveScorecardBySurvey(surveyId); @@ -91,11 +93,11 @@ public class ScorecardApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "Create a Scorecard entry", notes = "Add a new entry to a survey.\n" + "\n" + "Mandatory Fields\n" + @Operation(summary = "Create a Scorecard entry", description = "Add a new entry to a survey.\n" + "\n" + "Mandatory Fields\n" + "clientId, createdOn, questionId, responseId, staffId") - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) - public void createScorecard(@PathParam("surveyId") @ApiParam(value = "Enter surveyId") final Long surveyId, - @ApiParam(format = "body", type = "body") final ScorecardData scorecardData) { + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + public void createScorecard(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId, + @Parameter(description = "scorecardData") final ScorecardData scorecardData) { final AppUser appUser = this.securityContext.authenticatedUser(); final Survey survey = this.spmService.findById(surveyId); final Client client = this.clientRepositoryWrapper.findOneWithNotFoundDetection(scorecardData.getClientId()); @@ -107,8 +109,8 @@ public class ScorecardApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - public List findBySurveyAndClient(@PathParam("surveyId") @ApiParam(value = "Enter surveyId") final Long surveyId, - @PathParam("clientId") @ApiParam(value = "Enter clientId") final Long clientId) { + public List findBySurveyAndClient(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId, + @PathParam("clientId") @Parameter(description = "Enter clientId") final Long clientId) { this.securityContext.authenticatedUser(); this.spmService.findById(surveyId); this.clientRepositoryWrapper.findOneWithNotFoundDetection(clientId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/api/SpmApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/spm/api/SpmApiResource.java index a4f84aa7f..254f94494 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/api/SpmApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/api/SpmApiResource.java @@ -19,13 +19,14 @@ package org.apache.fineract.spm.api; import com.google.gson.Gson; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -52,8 +53,8 @@ import org.springframework.transaction.annotation.Transactional; @Path("/surveys") @Component @Scope("singleton") -@Api(tags = { "Spm-Surveys" }) -@SwaggerDefinition(tags = { @Tag(name = "Spm-Surveys", description = "") }) + +@Tag(name = "Spm-Surveys", description = "") public class SpmApiResource { private final PlatformSecurityContext securityContext; @@ -69,8 +70,9 @@ public class SpmApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "List all Surveys", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SurveyData.class, responseContainer = "list") }) + @Operation(summary = "List all Surveys", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SurveyData.class)))) }) public List fetchAllSurveys(@QueryParam("isActive") final Boolean isActive) { this.securityContext.authenticatedUser(); final List result = new ArrayList<>(); @@ -93,9 +95,10 @@ public class SpmApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "Retrieve a Survey", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = SurveyData.class) }) - public SurveyData findSurvey(@PathParam("id") @ApiParam(value = "Enter id") final Long id) { + @Operation(summary = "Retrieve a Survey", description = "") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = SurveyData.class))) }) + public SurveyData findSurvey(@PathParam("id") @Parameter(description = "Enter id") final Long id) { this.securityContext.authenticatedUser(); final Survey survey = this.spmService.findById(id); return SurveyMapper.map(survey); @@ -105,10 +108,10 @@ public class SpmApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "Create a Survey", notes = "Adds a new survey to collect client related data.\n" + "\n" + "Mandatory Fields\n" - + "\n" + "countryCode, key, name, questions, responses, sequenceNo, text, value") - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) - public String createSurvey(@ApiParam(value = "Create survey") final SurveyData surveyData) { + @Operation(summary = "Create a Survey", description = "Adds a new survey to collect client related data.\n" + "\n" + + "Mandatory Fields\n" + "\n" + "countryCode, key, name, questions, responses, sequenceNo, text, description") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + public String createSurvey(@Parameter(description = "Create survey") final SurveyData surveyData) { this.securityContext.authenticatedUser(); final Survey survey = SurveyMapper.map(surveyData, new Survey()); this.spmService.createSurvey(survey); @@ -134,8 +137,8 @@ public class SpmApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @ApiOperation(value = "Deactivate Survey", notes = "") - @ApiResponses({ @ApiResponse(code = 200, message = "OK") }) + @Operation(summary = "Deactivate Survey", description = "") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) public void activateOrDeactivateSurvey(@PathParam("id") final Long id, @QueryParam("command") final String command) { this.securityContext.authenticatedUser(); if (command != null && command.equalsIgnoreCase("activate")) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResource.java index dc616fa74..b3c35cf29 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResource.java @@ -18,15 +18,14 @@ */ package org.apache.fineract.template.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.IOException; import java.net.MalformedURLException; import java.util.ArrayList; @@ -74,13 +73,12 @@ import org.springframework.stereotype.Component; @Produces({ MediaType.APPLICATION_JSON }) @Component @Scope("singleton") -@Api(tags = { "User Generated Documents" }) -@SwaggerDefinition(tags = { - @Tag(name = "User Generated Documents", description = "User Generated Documents(alternatively, Templates) are used for end-user features such as custom user defined document generation (AKA UGD). They are based on {{ moustache }} templates. Think of them as a sort of built-in \"mail merge\" functionality.\n" - + "\n" - + "User Generated Documents (and other types of templates) can aggregate data from several Apache Fineract back-end API calls via mappers. Mappers can even access non-Apache Fineract REST services from other servers. UGDs can render such data in tables, show images, etc. TBD: Please have a look at some of the Example UGDs included in Apache Fineract (or the Wiki page, for now.).\n" - + "\n" - + "UGDs can be assigned to an entity like client or loan and be of a type like Document or SMS. The entity and type of a UGD is only there for the convenience of user agents (UIs), in order to know where to show UGDs for the user (i.e. which tab). The Template Engine back-end runner does not actually need this metadata.") }) + +@Tag(name = "User Generated Documents", description = "User Generated Documents(alternatively, Templates) are used for end-user features such as custom user defined document generation (AKA UGD). They are based on {{ moustache }} templates. Think of them as a sort of built-in \"mail merge\" functionality.\n" + + "\n" + + "User Generated Documents (and other types of templates) can aggregate data from several Apache Fineract back-end API calls via mappers. Mappers can even access non-Apache Fineract REST services from other servers. UGDs can render such data in tables, show images, etc. TBD: Please have a look at some of the Example UGDs included in Apache Fineract (or the Wiki page, for now.).\n" + + "\n" + + "UGDs can be assigned to an entity like client or loan and be of a type like Document or SMS. The entity and type of a UGD is only there for the convenience of user agents (UIs), in order to know where to show UGDs for the user (i.e. which tab). The Template Engine back-end runner does not actually need this metadata.") public class TemplatesApiResource { private final Set RESPONSE_TEMPLATES_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id")); @@ -112,13 +110,15 @@ public class TemplatesApiResource { } @GET - @ApiOperation(value = "Retrieve all UGDs", notes = "Example Requests:\n" + "\n" + "templates\n" + "\n" + @Operation(summary = "Retrieve all UGDs", description = "Example Requests:\n" + "\n" + "templates\n" + "\n" + "It is also possible to get specific UGDs by entity and type:\n" + "\n" + "templates?type=0&entity=0\n" + "[Entity: Id]\n\n\n\n" + "\n\n" + "client: 0, loan: 1" + "\n\n" + "[Type: Id]\n\n\n\n" + "Document: 0, E-Mail (not yet): 1, SMS: 2") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TemplatesApiResourcesSwagger.GetTemplatesResponse.class) }) - public String retrieveAll(@DefaultValue("-1") @QueryParam("typeId") @ApiParam(value = "typeId") final int typeId, - @DefaultValue("-1") @QueryParam("entityId") @ApiParam(value = "entityId") final int entityId, @Context final UriInfo uriInfo) { + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.GetTemplatesResponse.class))) }) + public String retrieveAll(@DefaultValue("-1") @QueryParam("typeId") @Parameter(description = "typeId") final int typeId, + @DefaultValue("-1") @QueryParam("entityId") @Parameter(description = "entityId") final int entityId, + @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION); @@ -138,10 +138,11 @@ public class TemplatesApiResource { @GET @Path("template") - @ApiOperation(value = "Retrieve UGD Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for UGDs. The UGD data returned consists of any or all of:\n" + @Operation(summary = "Retrieve UGD Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for UGDs. The UGD data returned consists of any or all of:\n" + "\n" + "ARGUMENTS\n" + "name String entity String type String text String optional mappers Mapper optional\n" + "Example Request:\n" + "\n" + "templates/template") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TemplatesApiResourcesSwagger.GetTemplatesTemplateResponse.class) }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.GetTemplatesTemplateResponse.class))) }) public String template(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION); @@ -153,12 +154,12 @@ public class TemplatesApiResource { } @POST - @ApiOperation(value = "Add a UGD", notes = "Adds a new UGD.\n" + "\n" + "Mandatory Fields\n" + "name\n\n\n\n" + "Example Requests:\n" - + "\n" + "templates/1") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TemplatesApiResourcesSwagger.PostTemplatesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TemplatesApiResourcesSwagger.PostTemplatesResponse.class) }) - public String createTemplate(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Add a UGD", description = "Adds a new UGD.\n" + "\n" + "Mandatory Fields\n" + "name\n\n\n\n" + + "Example Requests:\n" + "\n" + "templates/1") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.PostTemplatesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.PostTemplatesResponse.class))) }) + public String createTemplate(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createTemplate().withJson(apiRequestBodyAsJson).build(); final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); @@ -168,9 +169,10 @@ public class TemplatesApiResource { @GET @Path("{templateId}") - @ApiOperation(value = "Retrieve a UGD", notes = "Example Requests:\n" + "\n" + "templates/1") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TemplatesApiResourcesSwagger.GetTemplatesTemplateIdResponse.class) }) - public String retrieveOne(@PathParam("templateId") @ApiParam(value = "templateId") final Long templateId, + @Operation(summary = "Retrieve a UGD", description = "Example Requests:\n" + "\n" + "templates/1") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.GetTemplatesTemplateIdResponse.class))) }) + public String retrieveOne(@PathParam("templateId") @Parameter(description = "templateId") final Long templateId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION); @@ -195,12 +197,12 @@ public class TemplatesApiResource { @PUT @Path("{templateId}") - @ApiOperation(value = "Update a UGD", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = TemplatesApiResourcesSwagger.PutTemplatesTemplateIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = TemplatesApiResourcesSwagger.PutTemplatesTemplateIdResponse.class) }) - public String saveTemplate(@PathParam("templateId") @ApiParam(value = "templateId") final Long templateId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a UGD", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.PutTemplatesTemplateIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.PutTemplatesTemplateIdResponse.class))) }) + public String saveTemplate(@PathParam("templateId") @Parameter(description = "templateId") final Long templateId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateTemplate(templateId).withJson(apiRequestBodyAsJson).build(); @@ -211,10 +213,10 @@ public class TemplatesApiResource { @DELETE @Path("{templateId}") - @ApiOperation(value = "Delete a UGD", notes = "") + @Operation(summary = "Delete a UGD", description = "") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = TemplatesApiResourcesSwagger.DeleteTemplatesTemplateIdResponse.class) }) - public String deleteTemplate(@PathParam("templateId") @ApiParam(value = "templateId") final Long templateId) { + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.DeleteTemplatesTemplateIdResponse.class))) }) + public String deleteTemplate(@PathParam("templateId") @Parameter(description = "templateId") final Long templateId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteTemplate(templateId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResourcesSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResourcesSwagger.java index 702b56e28..0372d8da4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResourcesSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/template/api/TemplatesApiResourcesSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.template.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import org.apache.fineract.template.domain.TemplateMapper; @@ -32,143 +31,143 @@ final class TemplatesApiResourcesSwagger { } - @ApiModel(value = "GetTemplatesResponse") + @Schema(description = "GetTemplatesResponse") public static final class GetTemplatesResponse { private GetTemplatesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Text") + @Schema(example = "Text") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long entity; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long type; - @ApiModelProperty(example = "This is a loan for {{loan.clientName}}") + @Schema(example = "This is a loan for {{loan.clientName}}") public String text; public List mappers; } - @ApiModel(value = "GetTemplatesTemplateResponse") + @Schema(description = "GetTemplatesTemplateResponse") public static final class GetTemplatesTemplateResponse { private GetTemplatesTemplateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Text") + @Schema(example = "Text") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long entity; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long type; - @ApiModelProperty(example = "This is a loan for {{loan.clientName}}") + @Schema(example = "This is a loan for {{loan.clientName}}") public String text; public List mappers; } - @ApiModel(value = "PostTemplatesRequest") + @Schema(description = "PostTemplatesRequest") public static final class PostTemplatesRequest { private PostTemplatesRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Text") + @Schema(example = "Text") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long entity; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long type; - @ApiModelProperty(example = "This is a loan for {{loan.clientName}}") + @Schema(example = "This is a loan for {{loan.clientName}}") public String text; public List mappers; } - @ApiModel(value = "PostTemplatesResponse") + @Schema(description = "PostTemplatesResponse") public static final class PostTemplatesResponse { private PostTemplatesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "GetTemplatesTemplateIdResponse") + @Schema(description = "GetTemplatesTemplateIdResponse") public static final class GetTemplatesTemplateIdResponse { private GetTemplatesTemplateIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Text") + @Schema(example = "Text") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long entity; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long type; - @ApiModelProperty(example = "This is a loan for {{loan.clientName}}") + @Schema(example = "This is a loan for {{loan.clientName}}") public String text; public List mappers; } - @ApiModel(value = "PutTemplatesTemplateIdRequest") + @Schema(description = "PutTemplatesTemplateIdRequest") public static final class PutTemplatesTemplateIdRequest { private PutTemplatesTemplateIdRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Text") + @Schema(example = "Text") public String name; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long entity; - @ApiModelProperty(example = "0") + @Schema(example = "0") public Long type; - @ApiModelProperty(example = "This is a loan for {{loan.clientName}}") + @Schema(example = "This is a loan for {{loan.clientName}}") public String text; public List mappers; } - @ApiModel(value = "PutTemplatesTemplateIdResponse") + @Schema(description = "PutTemplatesTemplateIdResponse") public static final class PutTemplatesTemplateIdResponse { private PutTemplatesTemplateIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "DeleteTemplatesTemplateIdResponse") + @Schema(description = "DeleteTemplatesTemplateIdResponse") public static final class DeleteTemplatesTemplateIdResponse { private DeleteTemplatesTemplateIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResource.java index bcb5b6221..5540be18d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -53,11 +53,9 @@ import org.springframework.stereotype.Component; @Path("/" + PasswordPreferencesApiConstants.RESOURCE_NAME) @Component @Scope("singleton") -@Api(tags = { "Password preferences" }) -@SwaggerDefinition(tags = { - @Tag(name = "Password preferences", description = "This API enables management of password policy for user administration.\n" + "\n" - + "There is no Apache Fineract functionality for creating a validation policy. The validation policies come pre-installed.\n" - + "\n" + "Validation policies may be updated") }) +@Tag(name = "Password preferences", description = "This API enables management of password policy for user administration.\n" + "\n" + + "There is no Apache Fineract functionality for creating a validation policy. The validation policies come pre-installed.\n" + "\n" + + "Validation policies may be updated") public class PasswordPreferencesApiResource { private final PlatformSecurityContext context; @@ -83,7 +81,7 @@ public class PasswordPreferencesApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @ApiResponses({ - @ApiResponse(code = 200, message = "", response = PasswordPreferencesApiResourceSwagger.GetPasswordPreferencesTemplateResponse.class) }) + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = PasswordPreferencesApiResourceSwagger.GetPasswordPreferencesTemplateResponse.class))) }) public String retrieve(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(PasswordPreferencesApiConstants.ENTITY_NAME); @@ -99,11 +97,10 @@ public class PasswordPreferencesApiResource { @PUT @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update password preferences", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = PasswordPreferencesApiResourceSwagger.PutPasswordPreferencesTemplateRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "") }) - public String update(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update password preferences", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = PasswordPreferencesApiResourceSwagger.PutPasswordPreferencesTemplateRequest.class))) + @ApiResponses({ @ApiResponse(responseCode = "200", description = "") }) + public String update(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updatePasswordPreferences() // @@ -119,10 +116,10 @@ public class PasswordPreferencesApiResource { @Path("/template") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Application Password validation policies", notes = "ARGUMENTS\n" + "Example Requests:\n" + "\n" + @Operation(summary = "List Application Password validation policies", description = "ARGUMENTS\n" + "Example Requests:\n" + "\n" + "passwordpreferences") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = PasswordPreferencesApiResourceSwagger.GetPasswordPreferencesTemplateResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PasswordPreferencesApiResourceSwagger.GetPasswordPreferencesTemplateResponse.class)))) }) public String template(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(PasswordPreferencesApiConstants.ENTITY_NAME); diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResourceSwagger.java index 876d16e00..f93078e5b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PasswordPreferencesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 22/8/17. @@ -30,31 +29,31 @@ final class PasswordPreferencesApiResourceSwagger { } - @ApiModel(value = "GetPasswordPreferencesTemplateResponse") + @Schema(description = "GetPasswordPreferencesTemplateResponse") public static final class GetPasswordPreferencesTemplateResponse { private GetPasswordPreferencesTemplateResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Password must be at least 1 character and not more that 50 characters long") + @Schema(example = "Password must be at least 1 character and not more that 50 characters long") public String description; - @ApiModelProperty(example = "true") + @Schema(example = "true") public boolean active; - @ApiModelProperty(example = "simple") + @Schema(example = "simple") public String key; } - @ApiModel(value = "PutPasswordPreferencesTemplateRequest") + @Schema(description = "PutPasswordPreferencesTemplateRequest") public static final class PutPasswordPreferencesTemplateRequest { private PutPasswordPreferencesTemplateRequest() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long validationPolicyId; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResource.java index 0b3a663c8..04e574bda 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResource.java @@ -18,15 +18,15 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -56,12 +56,9 @@ import org.springframework.stereotype.Component; @Path("/permissions") @Component @Scope("singleton") -@Api(tags = { "Permissions" }) -@SwaggerDefinition(tags = { - @Tag(name = "Permissions", description = "An API capability to support management of application permissions for user administration.\n" - + "\n" + "There is no Apache Fineract functionality for creating or deleting permissions. Permissions come pre-installed.\n" - + "\n" - + "Permissions are not updated, except in the case of enabling or disabling non-read transactions for Maker Checker functionality") }) +@Tag(name = "Permissions", description = "An API capability to support management of application permissions for user administration.\n" + + "\n" + "There is no Apache Fineract functionality for creating or deleting permissions. Permissions come pre-installed.\n" + "\n" + + "Permissions are not updated, except in the case of enabling or disabling non-read transactions for Maker Checker functionality") public class PermissionsApiResource { private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( @@ -88,7 +85,7 @@ public class PermissionsApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Application Permissions", notes = "ARGUMENTS\n" + @Operation(summary = "List Application Permissions", description = "ARGUMENTS\n" + "makerCheckerableoptional, Values are true, false. Default is false.\n" + "If makerCheckerable=false or not supplied then a list of application permissions is returned. The \"selected\" attribute is always true in this case.\n" + "\n" @@ -96,7 +93,7 @@ public class PermissionsApiResource { + "\n" + "Note: Each Apache Fineract transaction is associated with a permission.\n" + "\n" + "Example Requests:\n" + "\n" + "permissions\n" + "\n" + "\n" + "permissions?makerCheckerable=true\n" + "\n" + "\n" + "permissions?fields=grouping,code") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = PermissionsApiResourceSwagger.GetPermissionsResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PermissionsApiResourceSwagger.GetPermissionsResponse.class)))) }) public String retrieveAllPermissions(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -116,11 +113,11 @@ public class PermissionsApiResource { @PUT @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Enable/Disable Permissions for Maker Checker", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = PermissionsApiResourceSwagger.PutPermissionsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = CommandProcessingResult.class) }) - public String updatePermissionsDetails(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Enable/Disable Permissions for Maker Checker", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = PermissionsApiResourceSwagger.PutPermissionsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) }) + public String updatePermissionsDetails(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updatePermissions() // diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResourceSwagger.java index 21b486b4c..7bd32499a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/PermissionsApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Created by sanyam on 22/8/17. @@ -30,33 +29,33 @@ final class PermissionsApiResourceSwagger { } - @ApiModel(value = "GetPermissionsResponse") + @Schema(description = "GetPermissionsResponse") public static final class GetPermissionsResponse { private GetPermissionsResponse() { } - @ApiModelProperty(example = "authorisation") + @Schema(example = "authorisation") public String grouping; - @ApiModelProperty(example = "READ_PERMISSION") + @Schema(example = "READ_PERMISSION") public String code; - @ApiModelProperty(example = "PERMISSION") + @Schema(example = "PERMISSION") public String entityName; - @ApiModelProperty(example = "READ") + @Schema(example = "READ") public String actionName; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean selected; } - @ApiModel(value = "PutPermissionsRequest") + @Schema(description = "PutPermissionsRequest") public static final class PutPermissionsRequest { private PutPermissionsRequest() { } - @ApiModelProperty(example = "\"CREATE_GUARANTOR\":true,\n" + " \"CREATE_CLIENT\":true") + @Schema(example = "\"CREATE_GUARANTOR\":true,\n" + " \"CREATE_CLIENT\":true") public String permissions; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResource.java index 8828d8493..c489ad046 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResource.java @@ -18,15 +18,16 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -64,9 +65,7 @@ import org.springframework.stereotype.Component; @Path("/roles") @Component @Scope("singleton") -@Api(tags = { "Roles" }) -@SwaggerDefinition(tags = { - @Tag(name = "Roles", description = "An API capability to support management of application roles for user administration.") }) +@Tag(name = "Roles", description = "An API capability to support management of application roles for user administration.") public class RolesApiResource { /** @@ -110,9 +109,9 @@ public class RolesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "List Roles", notes = "Example Requests:\n" + "\n" + "roles\n" + "\n" + "\n" + "roles?fields=name") + @Operation(summary = "List Roles", description = "Example Requests:\n" + "\n" + "roles\n" + "\n" + "\n" + "roles?fields=name") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.GetRolesResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = RolesApiResourceSwagger.GetRolesResponse.class)))) }) public String retrieveAllRoles(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -126,11 +125,11 @@ public class RolesApiResource { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Create a New Role", notes = "Mandatory Fields\n" + "name, description") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RolesApiResourceSwagger.PostRolesRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.PostRolesResponse.class) }) - public String createRole(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Create a New Role", description = "Mandatory Fields\n" + "name, description") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PostRolesRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PostRolesResponse.class))) }) + public String createRole(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createRole() // @@ -146,9 +145,10 @@ public class RolesApiResource { @Path("{roleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Role", notes = "Example Requests:\n" + "\n" + "roles/1\n" + "\n" + "\n" + "roles/1?fields=name") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.GetRolesRoleIdResponse.class) }) - public String retrieveRole(@PathParam("roleId") @ApiParam(value = "roleId") final Long roleId, @Context final UriInfo uriInfo) { + @Operation(summary = "Retrieve a Role", description = "Example Requests:\n" + "\n" + "roles/1\n" + "\n" + "\n" + "roles/1?fields=name") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.GetRolesRoleIdResponse.class))) }) + public String retrieveRole(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -171,14 +171,15 @@ public class RolesApiResource { @Path("{roleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Enable Role | Disable Role", notes = "Description : Enable role in case role is disabled. | Disable the role in case role is not associated with any users.\n\n\n\n" + @Operation(summary = "Enable Role | Disable Role", description = "Description : Enable role in case role is disabled. | Disable the role in case role is not associated with any users.\n\n\n\n" + "\n\n" + "Example Request: https://DomainName/api/v1/roles/{roleId}?command=enable" + "\n\n\n\n" + "\n\n" + "https://DomainName/api/v1/roles/{roleId}?command=disable") - @ApiImplicitParams({ @ApiImplicitParam(value = "No Request Body", name = "No Request Body") }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.PostRolesRoleIdResponse.class) }) - public String actionsOnRoles(@PathParam("roleId") @ApiParam(value = "roleId") final Long roleId, - @QueryParam("command") @ApiParam(value = "command") final String commandParam, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Parameters({ @Parameter(description = "No Request Body", name = "No Request Body") }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PostRolesRoleIdResponse.class))) }) + public String actionsOnRoles(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId, + @QueryParam("command") @Parameter(description = "command") final String commandParam, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -198,12 +199,12 @@ public class RolesApiResource { @Path("{roleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Role", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RolesApiResourceSwagger.PutRolesRoleIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.PutRolesRoleIdResponse.class) }) - public String updateRole(@PathParam("roleId") @ApiParam(value = "roleId") final Long roleId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Role", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PutRolesRoleIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PutRolesRoleIdResponse.class))) }) + public String updateRole(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateRole(roleId) // @@ -219,9 +220,10 @@ public class RolesApiResource { @Path("{roleId}/permissions") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Retrieve a Role's Permissions", notes = "Example Requests:\n" + "\n" + "roles/1/permissions") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.GetRolesRoleIdPermissionsResponse.class) }) - public String retrieveRolePermissions(@PathParam("roleId") @ApiParam(value = "roleId") final Long roleId, + @Operation(summary = "Retrieve a Role's Permissions", description = "Example Requests:\n" + "\n" + "roles/1/permissions") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.GetRolesRoleIdPermissionsResponse.class))) }) + public String retrieveRolePermissions(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -238,12 +240,12 @@ public class RolesApiResource { @Path("{roleId}/permissions") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Update a Role's Permissions", notes = "") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = RolesApiResourceSwagger.PutRolesRoleIdPermissionsRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.PutRolesRoleIdPermissionsResponse.class) }) - public String updateRolePermissions(@PathParam("roleId") @ApiParam(value = "roleId") final Long roleId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + @Operation(summary = "Update a Role's Permissions", description = "") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PutRolesRoleIdPermissionsRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PutRolesRoleIdPermissionsResponse.class))) }) + public String updateRolePermissions(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateRolePermissions(roleId) // @@ -265,9 +267,10 @@ public class RolesApiResource { @Path("{roleId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @ApiOperation(value = "Delete a Role", notes = "Description : Delete the role in case role is not associated with any users.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = RolesApiResourceSwagger.DeleteRolesRoleIdResponse.class) }) - public String deleteRole(@PathParam("roleId") @ApiParam(value = "roleId") final Long roleId) { + @Operation(summary = "Delete a Role", description = "Description : Delete the role in case role is not associated with any users.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.DeleteRolesRoleIdResponse.class))) }) + public String deleteRole(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteRole(roleId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java index 6a5d904a9..919d44ec4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/RolesApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; /** @@ -31,77 +30,77 @@ final class RolesApiResourceSwagger { } - @ApiModel(value = "GetRolesResponse") + @Schema(description = "GetRolesResponse") public static final class GetRolesResponse { private GetRolesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Super Users") + @Schema(example = "Super Users") public String name; - @ApiModelProperty(example = "This role provides all application permissions.") + @Schema(example = "This role provides all application permissions.") public String description; } - @ApiModel(value = "GetRolesRoleIdResponse") + @Schema(description = "GetRolesRoleIdResponse") public static final class GetRolesRoleIdResponse { private GetRolesRoleIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Super Users") + @Schema(example = "Super Users") public String name; - @ApiModelProperty(example = "This role provides all application permissions.") + @Schema(example = "This role provides all application permissions.") public String description; } - @ApiModel(value = "PostRolesRequest") + @Schema(description = "PostRolesRequest") public static final class PostRolesRequest { private PostRolesRequest() { } - @ApiModelProperty(example = "Another Role Name") + @Schema(example = "Another Role Name") public String name; - @ApiModelProperty(example = "A description outlining the purpose of this role in relation to the application.") + @Schema(example = "A description outlining the purpose of this role in relation to the application.") public String description; } - @ApiModel(value = "PostRolesResponse") + @Schema(description = "PostRolesResponse") public static final class PostRolesResponse { private PostRolesResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "PutRolesRoleIdRequest") + @Schema(description = "PutRolesRoleIdRequest") public static final class PutRolesRoleIdRequest { private PutRolesRoleIdRequest() { } - @ApiModelProperty(example = "some description(changed)") + @Schema(example = "some description(changed)") public String description; } - @ApiModel(value = "PutRolesRoleIdResponse") + @Schema(description = "PutRolesRoleIdResponse") public static final class PutRolesRoleIdResponse { private PutRolesRoleIdResponse() { @@ -112,29 +111,29 @@ final class RolesApiResourceSwagger { private PutRolesRoleIdResponseChanges() {} - @ApiModelProperty(example = "some description(changed)") + @Schema(example = "some description(changed)") public String description; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; public PutRolesRoleIdResponseChanges changes; } - @ApiModel(value = "PostRolesRoleIdResponse") + @Schema(description = "PostRolesRoleIdResponse") public static final class PostRolesRoleIdResponse { private PostRolesRoleIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } - @ApiModel(value = "GetRolesRoleIdPermissionsResponse") + @Schema(description = "GetRolesRoleIdPermissionsResponse") public static final class GetRolesRoleIdPermissionsResponse { private GetRolesRoleIdPermissionsResponse() { @@ -147,29 +146,29 @@ final class RolesApiResourceSwagger { } - @ApiModelProperty(example = "authorisation") + @Schema(example = "authorisation") public String grouping; - @ApiModelProperty(example = "READ_PERMISSION") + @Schema(example = "READ_PERMISSION") public String code; - @ApiModelProperty(example = "PERMISSION") + @Schema(example = "PERMISSION") public String entityName; - @ApiModelProperty(example = "READ") + @Schema(example = "READ") public String actionName; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean selected; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "Super Users") + @Schema(example = "Super Users") public String name; - @ApiModelProperty(example = "This role provides all application permissions.") + @Schema(example = "This role provides all application permissions.") public String description; public Collection permissionUsageData; } - @ApiModel(value = "PutRolesRoleIdPermissionsRequest") + @Schema(description = "PutRolesRoleIdPermissionsRequest") public static final class PutRolesRoleIdPermissionsRequest { private PutRolesRoleIdPermissionsRequest() { @@ -182,7 +181,7 @@ final class RolesApiResourceSwagger { } - @ApiModelProperty(example = "true") + @Schema(example = "true") public String ALL_FUNCTIONS_READ; } @@ -190,7 +189,7 @@ final class RolesApiResourceSwagger { } - @ApiModel(value = "PutRolesRoleIdPermissionsResponse") + @Schema(description = "PutRolesRoleIdPermissionsResponse") public static final class PutRolesRoleIdPermissionsResponse { private PutRolesRoleIdPermissionsResponse() { @@ -203,24 +202,24 @@ final class RolesApiResourceSwagger { } - @ApiModelProperty(example = "true") + @Schema(example = "true") public String ALL_FUNCTIONS_READ; } - @ApiModelProperty(example = "8") + @Schema(example = "8") public Long resourceId; public PutRolesRoleIdPermissionsRequest.PostRolesRoleIdPermissionsResponsePermissions permissions; } - @ApiModel(value = "DeleteRolesRoleIdResponse") + @Schema(description = "DeleteRolesRoleIdResponse") public static final class DeleteRolesRoleIdResponse { private DeleteRolesRoleIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long resourceId; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java index b154e5031..9de531639 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java @@ -20,15 +20,15 @@ package org.apache.fineract.useradministration.api; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import java.util.Arrays; import java.util.Collection; @@ -69,8 +69,8 @@ import org.springframework.stereotype.Component; @Path("/users") @Component @Scope("singleton") -@Api(tags = { "Users" }) -@SwaggerDefinition(tags = { @Tag(name = "Users", description = "An API capability to support administration of application users.") }) + +@Tag(name = "Users", description = "An API capability to support administration of application users.") public class UsersApiResource { /** @@ -108,10 +108,10 @@ public class UsersApiResource { } @GET - @ApiOperation(value = "Retrieve list of users", notes = "Example Requests:\n" + "\n" + "users\n" + "\n" + "\n" + @Operation(summary = "Retrieve list of users", description = "Example Requests:\n" + "\n" + "users\n" + "\n" + "\n" + "users?fields=id,username,email,officeName") @ApiResponses({ - @ApiResponse(code = 200, message = "", response = UsersApiResourceSwagger.GetUsersResponse.class, responseContainer = "List") }) + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = UsersApiResourceSwagger.GetUsersResponse.class)))) }) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) public String retrieveAll(@Context final UriInfo uriInfo) { @@ -126,12 +126,13 @@ public class UsersApiResource { @GET @Path("{userId}") - @ApiOperation(value = "Retrieve a User", notes = "Example Requests:\n" + "\n" + "users/1\n" + "\n" + "\n" + "users/1?template=true\n" - + "\n" + "\n" + "users/1?fields=username,officeName") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = UsersApiResourceSwagger.GetUsersUserIdResponse.class) }) + @Operation(summary = "Retrieve a User", description = "Example Requests:\n" + "\n" + "users/1\n" + "\n" + "\n" + + "users/1?template=true\n" + "\n" + "\n" + "users/1?fields=username,officeName") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.GetUsersUserIdResponse.class))) }) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String retrieveOne(@PathParam("userId") @ApiParam(value = "userId") final Long userId, @Context final UriInfo uriInfo) { + public String retrieveOne(@PathParam("userId") @Parameter(description = "userId") final Long userId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions, userId); @@ -148,9 +149,10 @@ public class UsersApiResource { @GET @Path("template") - @ApiOperation(value = "Retrieve User Details Template", notes = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" - + "\n" + "Field Defaults\n" + "Allowed Value Lists\n" + "Example Request:\n" + "\n" + "users/template") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = UsersApiResourceSwagger.GetUsersTemplateResponse.class) }) + @Operation(summary = "Retrieve User Details Template", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n" + + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "users/template") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.GetUsersTemplateResponse.class))) }) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) public String template(@Context final UriInfo uriInfo) { @@ -164,16 +166,16 @@ public class UsersApiResource { } @POST - @ApiOperation(value = "Create a User", notes = "Adds new application user.\n" + "\n" + @Operation(summary = "Create a User", description = "Adds new application user.\n" + "\n" + "Note: Password information is not required (or processed). Password details at present are auto-generated and then sent to the email account given (which is why it can take a few seconds to complete).\n" + "\n" + "Mandatory Fields: \n" + "username, firstname, lastname, email, officeId, roles, sendPasswordToEmail\n" + "\n" + "Optional Fields: \n" + "staffId,passwordNeverExpires,isSelfServiceUser,clients") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = UsersApiResourceSwagger.PostUsersRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = UsersApiResourceSwagger.PostUsersResponse.class) }) + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PostUsersRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PostUsersResponse.class))) }) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String create(@ApiParam(hidden = true) final String apiRequestBodyAsJson) { + public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .createUser() // @@ -187,14 +189,14 @@ public class UsersApiResource { @PUT @Path("{userId}") - @ApiOperation(value = "Update a User", notes = "When updating a password you must provide the repeatPassword parameter also.") - @ApiImplicitParams({ - @ApiImplicitParam(value = "body", required = true, paramType = "body", dataType = "body", format = "body", dataTypeClass = UsersApiResourceSwagger.PutUsersUserIdRequest.class) }) - @ApiResponses({ @ApiResponse(code = 200, message = "", response = UsersApiResourceSwagger.PutUsersUserIdResponse.class) }) + @Operation(summary = "Update a User", description = "When updating a password you must provide the repeatPassword parameter also.") + @RequestBody(required = true, content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PutUsersUserIdRequest.class))) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PutUsersUserIdResponse.class))) }) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String update(@PathParam("userId") @ApiParam(value = "userId") final Long userId, - @ApiParam(hidden = true) final String apiRequestBodyAsJson) { + public String update(@PathParam("userId") @Parameter(description = "userId") final Long userId, + @Parameter(hidden = true) final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .updateUser(userId) // @@ -208,11 +210,12 @@ public class UsersApiResource { @DELETE @Path("{userId}") - @ApiOperation(value = "Delete a User", notes = "Removes the user and the associated roles and permissions.") - @ApiResponses({ @ApiResponse(code = 200, message = "", response = UsersApiResourceSwagger.DeleteUsersUserIdResponse.class) }) + @Operation(summary = "Delete a User", description = "Removes the user and the associated roles and permissions.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.DeleteUsersUserIdResponse.class))) }) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String delete(@PathParam("userId") @ApiParam(value = "userId") final Long userId) { + public String delete(@PathParam("userId") @Parameter(description = "userId") final Long userId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // .deleteUser(userId) // diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResourceSwagger.java index 0da5c46d1..681190fbe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResourceSwagger.java @@ -18,8 +18,7 @@ */ package org.apache.fineract.useradministration.api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.apache.fineract.organisation.office.data.OfficeData; import org.apache.fineract.organisation.staff.data.StaffData; @@ -34,56 +33,56 @@ final class UsersApiResourceSwagger { } - @ApiModel(value = "GetUsersResponse") + @Schema(description = "GetUsersResponse") public static final class GetUsersResponse { private GetUsersResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String username; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String firstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String lastname; - @ApiModelProperty(example = "demomfi@mifos.org") + @Schema(example = "demomfi@mifos.org") public String email; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean passwordNeverExpires; public StaffData staff; public Collection selectedRoles; } - @ApiModel(value = "GetUsersUserIdResponse") + @Schema(description = "GetUsersUserIdResponse") public static final class GetUsersUserIdResponse { private GetUsersUserIdResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long id; - @ApiModelProperty(example = "mifos") + @Schema(example = "mifos") public String username; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "Head Office") + @Schema(example = "Head Office") public String officeName; - @ApiModelProperty(example = "App") + @Schema(example = "App") public String firstname; - @ApiModelProperty(example = "Administrator") + @Schema(example = "Administrator") public String lastname; - @ApiModelProperty(example = "demomfi@mifos.org") + @Schema(example = "demomfi@mifos.org") public String email; - @ApiModelProperty(example = "false") + @Schema(example = "false") public Boolean passwordNeverExpires; public StaffData staff; public Collection availableRoles; @@ -91,7 +90,7 @@ final class UsersApiResourceSwagger { } - @ApiModel(value = "GetUsersTemplateResponse") + @Schema(description = "GetUsersTemplateResponse") public static final class GetUsersTemplateResponse { private GetUsersTemplateResponse() { @@ -103,62 +102,62 @@ final class UsersApiResourceSwagger { public Collection selfServiceRoles; } - @ApiModel(value = "PostUsersRequest") + @Schema(description = "PostUsersRequest") public static final class PostUsersRequest { private PostUsersRequest() { } - @ApiModelProperty(example = "newuser") + @Schema(example = "newuser") public String username; - @ApiModelProperty(example = "Test") + @Schema(example = "Test") public String firstname; - @ApiModelProperty(example = "User") + @Schema(example = "User") public String lastname; - @ApiModelProperty(example = "whatever@mifos.org") + @Schema(example = "whatever@mifos.org") public String email; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long staffId; - @ApiModelProperty(example = "[2,3]") + @Schema(example = "[2,3]") public String Roles; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean sendPasswordToEmail; - @ApiModelProperty(example = "true") + @Schema(example = "true") public Boolean isSelfServiceUser; } - @ApiModel(value = "PostUsersResponse") + @Schema(description = "PostUsersResponse") public static final class PostUsersResponse { private PostUsersResponse() { } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Long resourceId; } - @ApiModel(value = "PutUsersUserIdRequest") + @Schema(description = "PutUsersUserIdRequest") public static final class PutUsersUserIdRequest { private PutUsersUserIdRequest() { } - @ApiModelProperty(example = "Test") + @Schema(example = "Test") public String firstname; - @ApiModelProperty(example = "window75") + @Schema(example = "window75") public String password; - @ApiModelProperty(example = "window75") + @Schema(example = "window75") public String repeatPassword; } - @ApiModel(value = "PutUsersUserIdResponse") + @Schema(description = "PutUsersUserIdResponse") public static final class PutUsersUserIdResponse { private PutUsersUserIdResponse() { @@ -171,20 +170,20 @@ final class UsersApiResourceSwagger { } - @ApiModelProperty(example = "Test") + @Schema(example = "Test") public String firstname; - @ApiModelProperty(example = "abc3326b1bb376351c7baeb4175f5e0504e33aadf6a158474a6d71de1befae51") + @Schema(example = "abc3326b1bb376351c7baeb4175f5e0504e33aadf6a158474a6d71de1befae51") public String passwordEncoded; } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Long resourceId; public PutUsersUserIdResponseChanges changes; } - @ApiModel(value = "DeleteUsersUserIdResponse") + @Schema(description = "DeleteUsersUserIdResponse") public static final class DeleteUsersUserIdResponse { private DeleteUsersUserIdResponse() { @@ -198,9 +197,9 @@ final class UsersApiResourceSwagger { } } - @ApiModelProperty(example = "1") + @Schema(example = "1") public Long officeId; - @ApiModelProperty(example = "11") + @Schema(example = "11") public Long resourceId; public DeleteUsersUserIdResponseChanges changes; } diff --git a/fineract-provider/src/main/resources/META-INF/spring/appContext.xml b/fineract-provider/src/main/resources/META-INF/spring/appContext.xml index 64f4b91d7..8ed13e37a 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/appContext.xml +++ b/fineract-provider/src/main/resources/META-INF/spring/appContext.xml @@ -112,6 +112,4 @@ - - diff --git a/fineract-provider/src/main/resources/META-INF/spring/swagger.xml b/fineract-provider/src/main/resources/META-INF/spring/swagger.xml deleted file mode 100644 index 8104293fd..000000000 --- a/fineract-provider/src/main/resources/META-INF/spring/swagger.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fineract-provider/src/main/resources/static/swagger-ui/index.html b/fineract-provider/src/main/resources/static/swagger-ui/index.html index 7bc89131c..c21ebe405 100644 --- a/fineract-provider/src/main/resources/static/swagger-ui/index.html +++ b/fineract-provider/src/main/resources/static/swagger-ui/index.html @@ -39,7 +39,7 @@ window.onload = function() { // Begin Swagger UI call region const ui = SwaggerUIBundle({ - url: "response.json", + url: "fineract.json", dom_id: '#swagger-ui', deepLinking: true, presets: [ diff --git a/gradle.properties b/gradle.properties index 4069de224..eb8caad07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,8 +16,5 @@ # specific language governing permissions and limitations # under the License. # - -# Increased memory and disabled daemon are required by gradle-tomcat-plugin -# The daemon is more pain than gain, because the Tomcat in the Gradle process does not shut down cleanly. -# TODO remove this after https://issues.apache.org/jira/browse/FINERACT-764 -org.gradle.jvmargs=-Xmx4g +# Increased memory needed for swagger-gradle-plugin - but can't be too close to 4G as memory within Docker in Travis is limited +org.gradle.jvmargs=-Xmx2g From 570a18a2060cadaf45d2b476119abb5c1428e4f3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 26 Jun 2020 19:07:22 +0200 Subject: [PATCH 022/131] Update dependency org.flywaydb:flyway-core to v6.5.0 (#1116) --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index f6e1a4cfd..13bcab983 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -94,7 +94,7 @@ dependencyManagement { dependency 'org.drizzle.jdbc:drizzle-jdbc:1.4' dependency 'com.github.librepdf:openpdf:1.3.20' dependency 'org.mnode.ical4j:ical4j:3.0.19' - dependency 'org.flywaydb:flyway-core:6.4.4' + dependency 'org.flywaydb:flyway-core:6.5.0' dependency 'org.quartz-scheduler:quartz:2.3.2' dependency 'com.amazonaws:aws-java-sdk-s3:1.11.804' dependency 'org.ehcache:ehcache:3.8.1' From 4fd176ba6629bb3f0f9ab96cceb9799a2d35698e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 29 Jun 2020 02:59:45 +0000 Subject: [PATCH 023/131] Update dependency gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin to v4.4.4 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 13bcab983..551f19223 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -44,7 +44,7 @@ buildscript { classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0' - classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.4.3" + classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.4.4" classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" From 5e9b4cafa884a84718b16b2525308ed053516438 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 27 Jun 2020 16:44:26 +0000 Subject: [PATCH 024/131] Update dependency io.swagger.core.v3:swagger-annotations to v2.1.3 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 551f19223..96bb6e546 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -102,7 +102,7 @@ dependencyManagement { dependency 'com.jayway.jsonpath:json-path:2.4.0' dependency 'org.apache.tika:tika-core:1.24.1' dependency 'org.apache.httpcomponents:httpclient:4.5.12' - dependency 'io.swagger.core.v3:swagger-annotations:2.1.2' + dependency 'io.swagger.core.v3:swagger-annotations:2.1.3' dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4' dependency 'jakarta.jms:jakarta.jms-api:2.0.3' dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' From e1e230d660db62ac9939df4ad1557463a35c7cf5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 27 Jun 2020 15:47:36 +0000 Subject: [PATCH 025/131] Update dependency io.swagger.core.v3:swagger-gradle-plugin to v2.1.3 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 96bb6e546..78e134d87 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -49,7 +49,7 @@ buildscript { classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" classpath "com.diffplug.spotless:spotless-plugin-gradle:4.4.0" - classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.2" + classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.3" } } From fde3d9f83e22f4c35cc0c7b68e81a67b908e8b0e Mon Sep 17 00:00:00 2001 From: percyashu Date: Sat, 27 Jun 2020 18:57:55 +0100 Subject: [PATCH 026/131] FINERACT-822 Enforce NonCanonicalType check --- fineract-provider/build.gradle | 2 +- .../fineract/batch/command/CommandStrategyProvider.java | 5 +++-- .../infrastructure/security/utils/ColumnValidator.java | 2 +- .../java/org/apache/fineract/common/RestAssuredFixture.java | 2 ++ .../src/test/java/org/apache/fineract/common/Utils.java | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 78e134d87..871ad68cb 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -397,7 +397,6 @@ tasks.withType(JavaCompile) { "ProtectedMembersInFinalClass", "StaticAssignmentInConstructor", "InvalidBlockTag", - "NonCanonicalType", "InvalidInlineTag", ) //TODO gradually enable these checks @@ -456,6 +455,7 @@ tasks.withType(JavaCompile) { "PublicConstructorForAbstractClass", "UnescapedEntity", "ModifyCollectionInEnhancedForLoop", + "NonCanonicalType", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java index 47877d7d1..79abc061c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/command/CommandStrategyProvider.java @@ -18,6 +18,7 @@ */ package org.apache.fineract.batch.command; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.fineract.batch.command.internal.UnknownCommandStrategy; import org.springframework.beans.factory.annotation.Autowired; @@ -36,7 +37,7 @@ import org.springframework.stereotype.Component; public class CommandStrategyProvider { private final ApplicationContext applicationContext; - private final ConcurrentHashMap commandStrategies = new ConcurrentHashMap<>(); + private final Map commandStrategies = new ConcurrentHashMap<>(); /** * Constructs a CommandStrategyProvider with argument of ApplicationContext type. It also initialize @@ -68,7 +69,7 @@ public class CommandStrategyProvider { return (CommandStrategy) this.applicationContext.getBean(this.commandStrategies.get(commandContext)); } - for (ConcurrentHashMap.Entry entry : this.commandStrategies.entrySet()) { + for (Map.Entry entry : this.commandStrategies.entrySet()) { if (commandContext.matcher(entry.getKey())) { return (CommandStrategy) this.applicationContext.getBean(this.commandStrategies.get(entry.getKey())); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java index a5953f52b..c3236fb01 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java @@ -54,7 +54,7 @@ public class ColumnValidator { connection = this.jdbcTemplate.getDataSource().getConnection(); DatabaseMetaData dbMetaData = connection.getMetaData(); ResultSet resultSet = null; - for (HashMap.Entry> entry : tableColumnMap.entrySet()) { + for (Map.Entry> entry : tableColumnMap.entrySet()) { Set columns = entry.getValue(); resultSet = dbMetaData.getColumns(null, null, entry.getKey(), null); Set tableColumns = getTableColumns(resultSet); diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java index 91662eda2..48cd3b05f 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java @@ -48,10 +48,12 @@ public class RestAssuredFixture { this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); } + @SuppressWarnings("TypeParameterUnusedInFormals") public T httpGet(String apiPath, String jsonAttributeToGetBack) { return Utils.performServerGet(this.requestSpec, this.responseSpec, getApiPath(apiPath), jsonAttributeToGetBack); } + @SuppressWarnings("TypeParameterUnusedInFormals") public T httpGet(String apiPath) { return httpGet(apiPath, ""); } diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java index f1cf5c260..f0ff2cead 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java @@ -69,6 +69,7 @@ public class Utils { } } + @SuppressWarnings("TypeParameterUnusedInFormals") public static T performServerGet(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String getURL, final String jsonAttributeToGetBack) { final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().get(getURL).andReturn().asString(); From 63c72ee53c4e8fb05db84775a9e647b0ab6d79f3 Mon Sep 17 00:00:00 2001 From: percyashu Date: Sat, 27 Jun 2020 19:29:58 +0100 Subject: [PATCH 027/131] FINERACT-822 Enforce InvalidInlineTag check --- fineract-provider/build.gradle | 2 +- .../accounting/closure/api/GLClosuresApiResourceSwagger.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 871ad68cb..5bbf625d6 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -397,7 +397,6 @@ tasks.withType(JavaCompile) { "ProtectedMembersInFinalClass", "StaticAssignmentInConstructor", "InvalidBlockTag", - "InvalidInlineTag", ) //TODO gradually enable these checks error( @@ -456,6 +455,7 @@ tasks.withType(JavaCompile) { "UnescapedEntity", "ModifyCollectionInEnhancedForLoop", "NonCanonicalType", + "InvalidInlineTag", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java index 781085864..1464c33ad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResourceSwagger.java @@ -28,7 +28,7 @@ final class GLClosuresApiResourceSwagger { } /** - * TODO: describe where this belongs: {@link GLClosuresApiResource } {@Link GLClosuresApiResource} + * TODO: describe where this belongs: {@link GLClosuresApiResource } {@link GLClosuresApiResource} */ // Check !! From 649eb4f84324b866074e71a9ae4d494643d5800e Mon Sep 17 00:00:00 2001 From: percyashu Date: Sat, 27 Jun 2020 20:48:41 +0100 Subject: [PATCH 028/131] FINERACT-822 Enforce MutablePublicArray check --- fineract-provider/build.gradle | 2 +- .../apache/fineract/interoperation/data/ExtensionData.java | 5 +++-- .../apache/fineract/interoperation/data/GeoCodeData.java | 5 +++-- .../interoperation/data/InteropTransactionTypeData.java | 7 ++++--- .../org/apache/fineract/interoperation/data/MoneyData.java | 5 +++-- .../portfolio/search/data/AdHocQuerySearchConstants.java | 5 ++++- .../self/registration/SelfServiceApiConstants.java | 4 +++- .../org/apache/fineract/common/RestAssuredFixture.java | 2 -- .../src/test/java/org/apache/fineract/common/Utils.java | 1 - 9 files changed, 21 insertions(+), 15 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 5bbf625d6..10da8eeaf 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -390,7 +390,6 @@ tasks.withType(JavaCompile) { "JdkObsolete", "EmptyBlockTag", "MissingSummary", - "MutablePublicArray", "InvalidParam", "ReturnFromVoid", "AlmostJavadoc", @@ -456,6 +455,7 @@ tasks.withType(JavaCompile) { "ModifyCollectionInEnhancedForLoop", "NonCanonicalType", "InvalidInlineTag", + "MutablePublicArray", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/ExtensionData.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/ExtensionData.java index 18ed4c0a7..9a9f6d799 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/ExtensionData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/ExtensionData.java @@ -23,13 +23,14 @@ import static org.apache.fineract.interoperation.util.InteropUtil.PARAM_VALUE; import com.google.gson.JsonObject; import java.util.Arrays; +import java.util.List; import javax.validation.constraints.NotNull; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; public class ExtensionData { - public static final String[] PARAMS = { PARAM_KEY, PARAM_VALUE }; + public static final List PARAMS = List.copyOf(Arrays.asList(PARAM_KEY, PARAM_VALUE)); @NotNull private final String key; @@ -58,7 +59,7 @@ public class ExtensionData { return null; } - jsonHelper.checkForUnsupportedParameters(element, Arrays.asList(PARAMS)); + jsonHelper.checkForUnsupportedParameters(element, PARAMS); String key = jsonHelper.extractStringNamed(PARAM_KEY, element); DataValidatorBuilder dataValidatorCopy = dataValidator.reset().parameter(PARAM_KEY).value(key).notBlank(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/GeoCodeData.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/GeoCodeData.java index addf8e8dc..782c6881f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/GeoCodeData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/GeoCodeData.java @@ -23,13 +23,14 @@ import static org.apache.fineract.interoperation.util.InteropUtil.PARAM_LONGITUD import com.google.gson.JsonObject; import java.util.Arrays; +import java.util.List; import javax.validation.constraints.NotNull; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; public class GeoCodeData { - public static final String[] PARAMS = { PARAM_LATITUDE, PARAM_LONGITUDE }; + public static final List PARAMS = List.copyOf(Arrays.asList(PARAM_LATITUDE, PARAM_LONGITUDE)); @NotNull private final String latitude; @@ -54,7 +55,7 @@ public class GeoCodeData { return null; } - jsonHelper.checkForUnsupportedParameters(element, Arrays.asList(PARAMS)); + jsonHelper.checkForUnsupportedParameters(element, PARAMS); String latitude = jsonHelper.extractStringNamed(PARAM_LATITUDE, element); DataValidatorBuilder dataValidatorCopy = dataValidator.reset().parameter(PARAM_LATITUDE).value(latitude).notBlank(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/InteropTransactionTypeData.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/InteropTransactionTypeData.java index 09139ab5f..4a3301304 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/InteropTransactionTypeData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/InteropTransactionTypeData.java @@ -27,6 +27,7 @@ import static org.apache.fineract.interoperation.util.InteropUtil.PARAM_SUB_SCEN import com.google.gson.JsonObject; import java.util.Arrays; +import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotNull; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; @@ -37,8 +38,8 @@ import org.apache.fineract.interoperation.domain.InteropTransactionScenario; public class InteropTransactionTypeData { - public static final String[] PARAMS = { PARAM_SCENARIO, PARAM_SUB_SCENARIO, PARAM_INITIATOR, PARAM_INITIATOR_TYPE, PARAM_REFUND_INFO, - PARAM_BALANCE_OF_PAYMENTS }; + public static final List PARAMS = List.copyOf(Arrays.asList(PARAM_SCENARIO, PARAM_SUB_SCENARIO, PARAM_INITIATOR, + PARAM_INITIATOR_TYPE, PARAM_REFUND_INFO, PARAM_BALANCE_OF_PAYMENTS)); @NotNull private final InteropTransactionScenario scenario; @@ -92,7 +93,7 @@ public class InteropTransactionTypeData { return null; } - jsonHelper.checkForUnsupportedParameters(element, Arrays.asList(PARAMS)); + jsonHelper.checkForUnsupportedParameters(element, PARAMS); String scenarioString = jsonHelper.extractStringNamed(PARAM_SCENARIO, element); DataValidatorBuilder dataValidatorCopy = dataValidator.reset().parameter(PARAM_SCENARIO).value(scenarioString).notBlank(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/MoneyData.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/MoneyData.java index 068dfeed6..a1bb88763 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/MoneyData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/data/MoneyData.java @@ -26,6 +26,7 @@ import static org.apache.fineract.interoperation.util.InteropUtil.PARAM_LOCALE; import com.google.gson.JsonObject; import java.math.BigDecimal; import java.util.Arrays; +import java.util.List; import javax.validation.constraints.NotNull; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; @@ -34,7 +35,7 @@ import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency; public class MoneyData { - public static final String[] PARAMS = { PARAM_AMOUNT, PARAM_CURRENCY, PARAM_LOCALE }; + public static final List PARAMS = List.copyOf(Arrays.asList(PARAM_AMOUNT, PARAM_CURRENCY, PARAM_LOCALE)); @NotNull private final BigDecimal amount; @@ -70,7 +71,7 @@ public class MoneyData { return null; } - jsonHelper.checkForUnsupportedParameters(element, Arrays.asList(PARAMS)); + jsonHelper.checkForUnsupportedParameters(element, PARAMS); String locale = jsonHelper.extractStringNamed(PARAM_LOCALE, element); BigDecimal amount = locale == null ? jsonHelper.extractBigDecimalNamed(PARAM_AMOUNT, element, DEFAULT_LOCALE) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/AdHocQuerySearchConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/AdHocQuerySearchConstants.java index dac8ebaf2..efd963935 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/AdHocQuerySearchConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/data/AdHocQuerySearchConstants.java @@ -18,6 +18,9 @@ */ package org.apache.fineract.portfolio.search.data; +import java.util.Arrays; +import java.util.List; + public interface AdHocQuerySearchConstants { public static final String AD_HOC_SEARCH_QUERY_RESOURCE_NAME = "adHocQuery"; @@ -53,6 +56,6 @@ public interface AdHocQuerySearchConstants { public static final String closedLoanStatusOption = "closed"; public static final String writeoffLoanStatusOption = "writeoff"; - public static final Object[] entityTypeOptions = { "clients", "groups", "loans", "clientIdentifiers" }; + public static final List entityTypeOptions = List.copyOf(Arrays.asList("clients", "groups", "loans", "clientIdentifiers")); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/SelfServiceApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/SelfServiceApiConstants.java index 3b5c4d6ff..03d6ded8d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/SelfServiceApiConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/SelfServiceApiConstants.java @@ -21,6 +21,7 @@ package org.apache.fineract.portfolio.self.registration; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; +import java.util.List; import java.util.Set; public class SelfServiceApiConstants { @@ -43,7 +44,8 @@ public class SelfServiceApiConstants { mobileNumberParamName, lastNameParamName, emailParamName, authenticationModeParamName))); public static final Set CREATE_USER_REQUEST_DATA_PARAMETERS = Collections .unmodifiableSet(new HashSet<>(Arrays.asList(requestIdParamName, authenticationTokenParamName))); - public static final Object[] SUPPORTED_AUTHENTICATION_MODE_PARAMETERS = new Object[] { emailModeParamName, mobileModeParamName }; + public static final List SUPPORTED_AUTHENTICATION_MODE_PARAMETERS = List + .copyOf(Arrays.asList(emailModeParamName, mobileModeParamName)); public static final String SELF_SERVICE_USER_ROLE = "Self Service User"; } diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java index 48cd3b05f..91662eda2 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java @@ -48,12 +48,10 @@ public class RestAssuredFixture { this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); } - @SuppressWarnings("TypeParameterUnusedInFormals") public T httpGet(String apiPath, String jsonAttributeToGetBack) { return Utils.performServerGet(this.requestSpec, this.responseSpec, getApiPath(apiPath), jsonAttributeToGetBack); } - @SuppressWarnings("TypeParameterUnusedInFormals") public T httpGet(String apiPath) { return httpGet(apiPath, ""); } diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java index f0ff2cead..f1cf5c260 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java @@ -69,7 +69,6 @@ public class Utils { } } - @SuppressWarnings("TypeParameterUnusedInFormals") public static T performServerGet(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String getURL, final String jsonAttributeToGetBack) { final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().get(getURL).andReturn().asString(); From 022f214ad5adec3134458cda226320189d70e9cc Mon Sep 17 00:00:00 2001 From: thesmallstar Date: Thu, 18 Jun 2020 01:19:07 +0530 Subject: [PATCH 029/131] FINERACT-942 Added and Enforced AvoidHidingCauseException Checkstyle --- .../config/checkstyle/checkstyle.xml | 3 +- ...ualAccountingWritePlatformServiceImpl.java | 2 +- .../exception/GLClosureNotFoundException.java | 5 +++ .../GLClosureReadPlatformServiceImpl.java | 2 +- ...ncialActivityAccountNotFoundException.java | 5 +++ ...ctivityAccountReadPlatformServiceImpl.java | 2 +- .../exception/GLAccountNotFoundException.java | 5 +++ .../GLAccountReadPlatformServiceImpl.java | 2 +- .../JournalEntriesNotFoundException.java | 5 +++ .../JournalEntryReadPlatformServiceImpl.java | 4 +- .../AccountingRuleNotFoundException.java | 5 +++ ...AccountingRuleReadPlatformServiceImpl.java | 2 +- .../exception/AdHocNotFoundException.java | 5 +++ .../service/AdHocReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 6 +-- ...CommandSourceWritePlatformServiceImpl.java | 1 + .../AccountNumberFormatNotFoundException.java | 6 +++ ...ntNumberFormatReadPlatformServiceImpl.java | 2 +- .../populator/AbstractWorkbookPopulator.java | 2 +- .../BulkImportWorkbookServiceImpl.java | 2 +- .../exception/EmailBusinessRuleNotFound.java | 5 +++ .../exception/EmailCampaignNotFound.java | 6 +++ .../EmailConfigurationNotFoundException.java | 6 +++ .../exception/EmailNotFoundException.java | 5 +++ .../EmailCampaignReadPlatformServiceImpl.java | 4 +- ...lConfigurationReadPlatformServiceImpl.java | 2 +- .../service/EmailReadPlatformServiceImpl.java | 2 +- .../exception/ConnectionFailureException.java | 5 +++ .../sms/exception/SmsCampaignNotFound.java | 6 +++ .../SmsCampaignReadPlatformServiceImpl.java | 2 +- .../exception/CodeNotFoundException.java | 10 +++++ .../exception/CodeValueNotFoundException.java | 5 +++ .../service/CodeReadPlatformServiceImpl.java | 4 +- .../CodeValueReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../exception/AbstractPlatformException.java | 45 +++++++++++++++++++ ...ractPlatformResourceNotFoundException.java | 26 +---------- .../PlatformApiDataValidationException.java | 15 +++++++ .../PlatformDataIntegrityException.java | 6 ++- .../core/serialization/FromJsonHelper.java | 1 + .../core/serialization/JsonParserHelper.java | 12 ++--- .../core/service/DateUtils.java | 2 +- .../service/TenantDatabaseUpgradeService.java | 2 +- .../service/GenericDataServiceImpl.java | 2 +- .../service/ReadReportingServiceImpl.java | 4 +- .../ReadWriteNonCoreDataServiceImpl.java | 32 ++++++------- .../FileSystemContentRepository.java | 4 +- .../S3ContentRepository.java | 7 +-- .../exception/ContentManagementException.java | 17 +++++++ .../exception/DocumentNotFoundException.java | 12 +++++ .../DocumentReadPlatformServiceImpl.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 6 +-- .../service/ImageReadPlatformServiceImpl.java | 2 +- .../DeviceRegistrationNotFoundException.java | 10 +++++ ...ceRegistrationReadPlatformServiceImpl.java | 4 +- .../exception/HookNotFoundException.java | 5 +++ .../service/HookReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../jobs/exception/JobNotFoundException.java | 5 +++ .../jobs/service/JobRegisterServiceImpl.java | 2 +- .../SchedulerJobRunnerReadServiceImpl.java | 2 +- ...lingJobConfigurationNotFoundException.java | 6 +++ .../ReportMailingJobNotFoundException.java | 6 +++ ...bConfigurationReadPlatformServiceImpl.java | 2 +- ...portMailingJobReadPlatformServiceImpl.java | 2 +- .../InvalidTenantIdentiferException.java | 6 +++ .../BasicAuthTenantDetailsServiceJdbc.java | 2 +- .../service/JdbcTenantDetailsService.java | 2 +- .../security/utils/ColumnValidator.java | 2 +- .../security/utils/SQLInjectionException.java | 5 +++ .../sms/exception/SmsNotFoundException.java | 5 +++ .../SmsMessageScheduledJobServiceImpl.java | 2 +- .../service/SmsReadPlatformServiceImpl.java | 2 +- .../mix/service/XBRLResultServiceImpl.java | 2 +- .../exception/TopicNotFoundException.java | 5 +++ .../service/TopicReadPlatformServiceImpl.java | 2 +- .../exception/HolidayNotFoundException.java | 5 +++ .../HolidayReadPlatformServiceImpl.java | 2 +- .../exception/OfficeNotFoundException.java | 5 +++ .../OfficeReadPlatformServiceImpl.java | 2 +- ...ProvisioningCriteriaNotFoundException.java | 5 +++ ...ioningCriteriaReadPlatformServiceImpl.java | 2 +- .../exception/StaffNotFoundException.java | 5 +++ .../service/StaffReadPlatformServiceImpl.java | 2 +- ...llerManagementReadPlatformServiceImpl.java | 4 +- .../WorkingDaysNotFoundException.java | 5 +++ .../WorkingDaysReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- .../AccountTransferNotFoundException.java | 5 +++ ...countTransfersReadPlatformServiceImpl.java | 2 +- ...rtfolioAccountReadPlatformServiceImpl.java | 4 +- ...ingInstructionReadPlatformServiceImpl.java | 2 +- .../accounts/api/AccountsApiResource.java | 6 +-- .../ShareAccountNotFoundException.java | 5 +++ .../exception/CalendarNotFoundException.java | 5 +++ .../CalendarReadPlatformServiceImpl.java | 2 +- .../calendar/service/CalendarUtils.java | 4 +- .../exception/ChargeNotFoundException.java | 5 +++ ...SavingsAccountChargeNotFoundException.java | 5 +++ .../ChargeReadPlatformServiceImpl.java | 2 +- .../ClientChargeNotFoundException.java | 6 +++ .../ClientIdentifierNotFoundException.java | 5 +++ .../exception/ClientNotFoundException.java | 5 +++ .../ClientTransactionNotFoundException.java | 7 +++ .../exception/ImageNotFoundException.java | 6 +++ .../ClientChargeReadPlatformServiceImpl.java | 2 +- ...ientIdentifierReadPlatformServiceImpl.java | 2 +- .../ClientReadPlatformServiceImpl.java | 4 +- ...entTransactionReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../CollateralNotFoundException.java | 6 +++ .../CollateralReadPlatformServiceImpl.java | 2 +- .../FloatingRateNotFoundException.java | 9 ++++ .../FloatingRatesReadPlatformServiceImpl.java | 6 +-- .../fund/exception/FundNotFoundException.java | 5 +++ .../service/FundReadPlatformServiceImpl.java | 2 +- .../exception/CenterNotFoundException.java | 5 +++ .../exception/GroupNotFoundException.java | 5 +++ .../exception/GroupRoleNotFoundException.java | 5 +++ .../CenterReadPlatformServiceImpl.java | 2 +- .../service/GroupReadPlatformServiceImpl.java | 2 +- .../GroupRolesReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../InterestRateChartNotFoundException.java | 5 +++ ...erestRateChartReadPlatformServiceImpl.java | 2 +- .../domain/LoanAccountDomainServiceJpa.java | 8 ++-- .../exception/LoanNotFoundException.java | 5 +++ .../LoanTransactionNotFoundException.java | 5 +++ .../service/GuarantorDomainServiceImpl.java | 2 +- ...cheduleHistoryReadPlatformServiceImpl.java | 2 +- ...heduleRequestWritePlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../service/LoanReadPlatformServiceImpl.java | 8 ++-- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- .../LoanProductNotFoundException.java | 5 +++ .../ProductMixNotFoundException.java | 5 +++ .../ProductMixReadPlatformServiceImpl.java | 2 +- .../LoanProductReadPlatformServiceImpl.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 11 +++-- .../exception/MeetingNotFoundException.java | 5 +++ .../MeetingReadPlatformServiceImpl.java | 2 +- .../note/exception/NoteNotFoundException.java | 6 +++ .../service/NoteReadPlatformServiceImpl.java | 2 +- .../products/api/ProductsApiResource.java | 6 +-- .../exception/ProductNotFoundException.java | 5 +++ .../exception/ResourceNotFoundException.java | 5 +++ .../rate/exception/RateNotFoundException.java | 8 ++++ .../rate/service/RateReadServiceImpl.java | 4 +- ...SavingsAccountTransactionsApiResource.java | 5 ++- ...untInterestRateChartNotFoundException.java | 6 +++ .../DepositAccountNotFoundException.java | 6 +++ .../FixedDepositProductNotFoundException.java | 5 +++ .../SavingsAccountNotFoundException.java | 5 +++ .../SavingsProductNotFoundException.java | 5 +++ ...erestRateChartReadPlatformServiceImpl.java | 2 +- ...DepositAccountReadPlatformServiceImpl.java | 6 +-- ...DepositProductReadPlatformServiceImpl.java | 2 +- ...sAccountChargeReadPlatformServiceImpl.java | 2 +- ...SavingsAccountReadPlatformServiceImpl.java | 8 ++-- ...SavingsProductReadPlatformServiceImpl.java | 2 +- .../ShareAccountReadPlatformServiceImpl.java | 2 +- .../ShareProductReadPlatformServiceImpl.java | 2 +- ...wordValidationPolicyNotFoundException.java | 5 +++ ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...lidationPolicyReadPlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 6 +-- 168 files changed, 602 insertions(+), 192 deletions(-) create mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml index 5720b78a5..b94e3f803 100644 --- a/fineract-provider/config/checkstyle/checkstyle.xml +++ b/fineract-provider/config/checkstyle/checkstyle.xml @@ -50,6 +50,7 @@ + @@ -189,7 +190,7 @@ - + diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java index 4584410db..f20bcf028 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java @@ -61,7 +61,7 @@ public class AccrualAccountingWritePlatformServiceImpl implements AccrualAccount .resource(PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME); baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(PERIODIC_ACCRUAL_ACCOUNTING_EXECUTION_ERROR_CODE, e.getMessage()); - throw new PlatformApiDataValidationException(dataValidationErrors); + throw new PlatformApiDataValidationException(dataValidationErrors, e); } return CommandProcessingResult.empty(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java index 92fa3f5d9..fab656449 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.accounting.closure.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when GL account closure resources are not found. @@ -28,4 +29,8 @@ public class GLClosureNotFoundException extends AbstractPlatformResourceNotFound public GLClosureNotFoundException(final Long id) { super("error.msg.glclosure.id.invalid", "Accounting Closure with identifier " + id + " does not exist", id); } + + public GLClosureNotFoundException(final Long id, EmptyResultDataAccessException e) { + super("error.msg.glclosure.id.invalid", "Accounting Closure with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureReadPlatformServiceImpl.java index 5f652aae9..a875f2e0b 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureReadPlatformServiceImpl.java @@ -106,7 +106,7 @@ public class GLClosureReadPlatformServiceImpl implements GLClosureReadPlatformSe return glAccountData; } catch (final EmptyResultDataAccessException e) { - throw new GLClosureNotFoundException(glClosureId); + throw new GLClosureNotFoundException(glClosureId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java index e6350be58..6f18f84a9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.accounting.financialactivityaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when product to GL account mapping are not found. @@ -29,6 +30,10 @@ public class FinancialActivityAccountNotFoundException extends AbstractPlatformR super("error.msg.financialActivityAccount.not.found", "Financial Activity account with Id " + id + " does not exist", id); } + public FinancialActivityAccountNotFoundException(final Long id, EmptyResultDataAccessException e) { + super("error.msg.financialActivityAccount.not.found", "Financial Activity account with Id " + id + " does not exist", id, e); + } + public FinancialActivityAccountNotFoundException(final Integer financialActivityType) { super("error.msg.financialActivityAccount.not.found", "Financial Activity account with for the financial Activity with Id " + financialActivityType + " does not exist", diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java index 3937de1c3..e55256c3c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java @@ -67,7 +67,7 @@ public class FinancialActivityAccountReadPlatformServiceImpl implements Financia return this.jdbcTemplate.queryForObject(sqlBuilder.toString(), this.financialActivityAccountMapper, new Object[] { financialActivityAccountId }); } catch (final EmptyResultDataAccessException e) { - throw new FinancialActivityAccountNotFoundException(financialActivityAccountId); + throw new FinancialActivityAccountNotFoundException(financialActivityAccountId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountNotFoundException.java index 9e4d63ccf..01b7c6322 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.accounting.glaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when GL account resources are not found. @@ -28,4 +29,8 @@ public class GLAccountNotFoundException extends AbstractPlatformResourceNotFound public GLAccountNotFoundException(final Long id) { super("error.msg.glaccount.id.invalid", "General Ledger account with identifier " + id + " does not exist ", id); } + + public GLAccountNotFoundException(final Long id, EmptyResultDataAccessException e) { + super("error.msg.glaccount.id.invalid", "General Ledger account with identifier " + id + " does not exist ", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java index 893f4d05e..6c40a4fce 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java @@ -224,7 +224,7 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe return glAccountData; } catch (final EmptyResultDataAccessException e) { - throw new GLAccountNotFoundException(glAccountId); + throw new GLAccountNotFoundException(glAccountId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntriesNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntriesNotFoundException.java index 44778e71e..7ff6baf78 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntriesNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntriesNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.accounting.journalentry.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when journal entry resources are not found. @@ -34,4 +35,8 @@ public class JournalEntriesNotFoundException extends AbstractPlatformResourceNot public JournalEntriesNotFoundException(final Long entryId) { super("error.msg.journalEntries.id.invalid", "Journal Entry with entry Id " + entryId + " does not exist ", entryId); } + + public JournalEntriesNotFoundException(final Long entryId, EmptyResultDataAccessException e) { + super("error.msg.journalEntries.id.invalid", "Journal Entry with entry Id " + entryId + " does not exist ", entryId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java index 56e322123..86e70ee2b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java @@ -391,7 +391,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat return glJournalEntryData; } catch (final EmptyResultDataAccessException e) { - throw new JournalEntriesNotFoundException(glJournalEntryId); + throw new JournalEntriesNotFoundException(glJournalEntryId, e); } } @@ -534,7 +534,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat Object[] data = { transactionId, entityId, entityType }; return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sql, data, rm); } catch (final EmptyResultDataAccessException e) { - throw new JournalEntriesNotFoundException(entityId); + throw new JournalEntriesNotFoundException(entityId, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java index 0768b46a3..c32d47ba9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.accounting.rule.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when Accounting rule resources are not found. @@ -28,4 +29,8 @@ public class AccountingRuleNotFoundException extends AbstractPlatformResourceNot public AccountingRuleNotFoundException(final Long id) { super("error.msg.accounting.rule.id.invalid", "Accounting Rule with identifier " + id + " does not exist", id); } + + public AccountingRuleNotFoundException(final Long id, EmptyResultDataAccessException e) { + super("error.msg.accounting.rule.id.invalid", "Accounting Rule with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleReadPlatformServiceImpl.java index 2a54cad81..94f906ae2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleReadPlatformServiceImpl.java @@ -184,7 +184,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead } return accountingRuleData; } catch (final EmptyResultDataAccessException e) { - throw new AccountingRuleNotFoundException(accountingRuleId); + throw new AccountingRuleNotFoundException(accountingRuleId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/exception/AdHocNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/exception/AdHocNotFoundException.java index e30cf213f..50de8b40c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/exception/AdHocNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/exception/AdHocNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.adhocquery.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when AdHoc resources are not found. @@ -28,4 +29,8 @@ public class AdHocNotFoundException extends AbstractPlatformResourceNotFoundExce public AdHocNotFoundException(final Long id) { super("error.msg.adhocquery.adhoc.id.invalid", "Adhoc Record with identifier " + id + " does not exist", id); } + + public AdHocNotFoundException(final Long id, EmptyResultDataAccessException e) { + super("error.msg.adhocquery.adhoc.id.invalid", "Adhoc Record with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocReadPlatformServiceImpl.java index 16492b0eb..4204934d0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocReadPlatformServiceImpl.java @@ -66,7 +66,7 @@ public class AdHocReadPlatformServiceImpl implements AdHocReadPlatformService { return this.jdbcTemplate.queryForObject(sql, this.adHocRowMapper, new Object[] { id }); } catch (final EmptyResultDataAccessException e) { - throw new AdHocNotFoundException(id); + throw new AdHocNotFoundException(id, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java index cd5861276..33d39303a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java @@ -139,7 +139,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla return new CommandProcessingResultBuilder().withEntityId(adHocId).build(); } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } } @@ -160,7 +160,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } } @@ -181,7 +181,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java index aea732f6e..3beab9e73 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java @@ -64,6 +64,7 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio } @Override + @SuppressWarnings("AvoidHidingCauseException") public CommandProcessingResult logCommandSource(final CommandWrapper wrapper) { boolean isApprovedByChecker = false; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/exception/AccountNumberFormatNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/exception/AccountNumberFormatNotFoundException.java index 45d713b92..b9f7c9ab6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/exception/AccountNumberFormatNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/exception/AccountNumberFormatNotFoundException.java @@ -20,6 +20,7 @@ package org.apache.fineract.infrastructure.accountnumberformat.exception; import org.apache.fineract.infrastructure.accountnumberformat.service.AccountNumberFormatConstants; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when client resources are not found. @@ -31,4 +32,9 @@ public class AccountNumberFormatNotFoundException extends AbstractPlatformResour "AccountNumber format with identifier " + id + " does not exist", id); } + public AccountNumberFormatNotFoundException(final Long id, EmptyResultDataAccessException e) { + super(AccountNumberFormatConstants.EXCEPTION_ACCOUNT_NUMBER_FORMAT_NOT_FOUND, + "AccountNumber format with identifier " + id + " does not exist", id, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java index d79fe7c8a..ff8c298a6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java @@ -101,7 +101,7 @@ public class AccountNumberFormatReadPlatformServiceImpl implements AccountNumber new Object[] { id }); return accountNumberFormatData; } catch (final EmptyResultDataAccessException e) { - throw new AccountNumberFormatNotFoundException(id); + throw new AccountNumberFormatNotFoundException(id, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java index 59c58d323..e9148c584 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java @@ -85,7 +85,7 @@ public abstract class AbstractWorkbookPopulator implements WorkbookPopulator { row.createCell(colIndex).setCellValue(dateWithoutTime); row.getCell(colIndex).setCellStyle(dateCellStyle); } catch (ParseException pe) { - throw new IllegalArgumentException("ParseException"); + throw new IllegalArgumentException(pe); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java index d215567be..c6de1668f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java @@ -176,7 +176,7 @@ public class BulkImportWorkbookServiceImpl implements BulkImportWorkbookService } catch (IOException e) { LOG.error("Problem occurred in importWorkbook function", e); throw new GeneralPlatformDomainRuleException("error.msg.io.exception", - "IO exception occured with " + fileDetail.getFileName() + " " + e.getMessage()); + "IO exception occured with " + fileDetail.getFileName() + " " + e.getMessage(), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailBusinessRuleNotFound.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailBusinessRuleNotFound.java index c29122e29..dae6f5e13 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailBusinessRuleNotFound.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailBusinessRuleNotFound.java @@ -26,4 +26,9 @@ public class EmailBusinessRuleNotFound extends AbstractPlatformResourceNotFoundE super("error.msg.email.business.rule.not.found", "Email business rule with identifier `" + resourceId + "` does not exist", resourceId); } + + public EmailBusinessRuleNotFound(final Long resourceId, IndexOutOfBoundsException e) { + super("error.msg.email.business.rule.not.found", "Email business rule with identifier `" + resourceId + "` does not exist", + resourceId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailCampaignNotFound.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailCampaignNotFound.java index 0682e9324..f8ceeaced 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailCampaignNotFound.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailCampaignNotFound.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.campaigns.email.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class EmailCampaignNotFound extends AbstractPlatformResourceNotFoundException { @@ -26,4 +27,9 @@ public class EmailCampaignNotFound extends AbstractPlatformResourceNotFoundExcep super("error.msg.email.campaign.identifier.not.found", "EMAIL_CAMPAIGN with identifier `" + resourceId + "` does not exist", resourceId); } + + public EmailCampaignNotFound(final Long resourceId, EmptyResultDataAccessException e) { + super("error.msg.email.campaign.identifier.not.found", "EMAIL_CAMPAIGN with identifier `" + resourceId + "` does not exist", + resourceId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailConfigurationNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailConfigurationNotFoundException.java index 2f8234b28..899bc9c0d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailConfigurationNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailConfigurationNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.campaigns.email.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when a code is not found. @@ -28,4 +29,9 @@ public class EmailConfigurationNotFoundException extends AbstractPlatformResourc public EmailConfigurationNotFoundException(final String name) { super("error.msg.email.configuration.name.not.found", "Email configuration with name " + name + " does not exist", name); } + + public EmailConfigurationNotFoundException(String name, EmptyResultDataAccessException e) { + super("error.msg.email.configuration.name.not.found", "Email configuration with name " + name + " does not exist", name, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailNotFoundException.java index 6e726b36c..5506da775 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/exception/EmailNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.campaigns.email.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when a code is not found. @@ -28,4 +29,8 @@ public class EmailNotFoundException extends AbstractPlatformResourceNotFoundExce public EmailNotFoundException(final Long resourceId) { super("error.msg.email.identifier.not.found", "Email with identifier `" + resourceId + "` does not exist", resourceId); } + + public EmailNotFoundException(Long resourceId, EmptyResultDataAccessException e) { + super("error.msg.email.identifier.not.found", "Email with identifier `" + resourceId + "` does not exist", resourceId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java index e56d988e0..ff0a8727d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignReadPlatformServiceImpl.java @@ -246,7 +246,7 @@ public class EmailCampaignReadPlatformServiceImpl implements EmailCampaignReadPl EmailBusinessRulesData emailBusinessRulesData = retrieveOne.get(0); return emailBusinessRulesData; } catch (final IndexOutOfBoundsException e) { - throw new EmailBusinessRuleNotFound(resourceId); + throw new EmailBusinessRuleNotFound(resourceId, e); } } @@ -258,7 +258,7 @@ public class EmailCampaignReadPlatformServiceImpl implements EmailCampaignReadPl final String sql = "select " + this.emailCampaignMapper.schema + " where ec.id = ? and ec.is_visible = ?"; return this.jdbcTemplate.queryForObject(sql, this.emailCampaignMapper, resourceId, isVisible); } catch (final EmptyResultDataAccessException e) { - throw new EmailCampaignNotFound(resourceId); + throw new EmailCampaignNotFound(resourceId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailConfigurationReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailConfigurationReadPlatformServiceImpl.java index 9dfc55052..1ddd2afd3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailConfigurationReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailConfigurationReadPlatformServiceImpl.java @@ -91,7 +91,7 @@ public class EmailConfigurationReadPlatformServiceImpl implements EmailConfigura catch (final EmptyResultDataAccessException e) { - throw new EmailConfigurationNotFoundException(name); + throw new EmailConfigurationNotFoundException(name, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java index e7fd91674..0f1d7633a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java @@ -123,7 +123,7 @@ public class EmailReadPlatformServiceImpl implements EmailReadPlatformService { return this.jdbcTemplate.queryForObject(sql, this.emailRowMapper, resourceId); } catch (final EmptyResultDataAccessException e) { - throw new EmailNotFoundException(resourceId); + throw new EmailNotFoundException(resourceId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/ConnectionFailureException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/ConnectionFailureException.java index 0a37f881c..5e6217a2e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/ConnectionFailureException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/ConnectionFailureException.java @@ -27,4 +27,9 @@ public class ConnectionFailureException extends AbstractPlatformServiceUnavailab "Unable to connect to the server with connection name - " + connectionName, connectionName); } + public ConnectionFailureException(String connectionName, Exception e) { + super("error.msg.unable.to.connect.to.intermediate.server", + "Unable to connect to the server with connection name - " + connectionName, connectionName, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/SmsCampaignNotFound.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/SmsCampaignNotFound.java index a51bccf82..539488d4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/SmsCampaignNotFound.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/exception/SmsCampaignNotFound.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.campaigns.sms.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class SmsCampaignNotFound extends AbstractPlatformResourceNotFoundException { @@ -26,4 +27,9 @@ public class SmsCampaignNotFound extends AbstractPlatformResourceNotFoundExcepti super("error.msg.sms.campaign.identifier.not.found", "Sms Campaign with identifier `" + resourceId + "` does not exist", resourceId); } + + public SmsCampaignNotFound(final Long resourceId, EmptyResultDataAccessException e) { + super("error.msg.sms.campaign.identifier.not.found", "Sms Campaign with identifier `" + resourceId + "` does not exist", resourceId, + e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignReadPlatformServiceImpl.java index 6fde3c550..1b7342998 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignReadPlatformServiceImpl.java @@ -79,7 +79,7 @@ public class SmsCampaignReadPlatformServiceImpl implements SmsCampaignReadPlatfo final String sql = "select " + this.smsCampaignMapper.schema + " where sc.id = ? and sc.is_visible = ?"; return this.jdbcTemplate.queryForObject(sql, this.smsCampaignMapper, new Object[] { campaignId, isVisible }); } catch (final EmptyResultDataAccessException e) { - throw new SmsCampaignNotFound(campaignId); + throw new SmsCampaignNotFound(campaignId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeNotFoundException.java index b277c6182..874ec799c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.codes.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when a code is not found. @@ -32,4 +33,13 @@ public class CodeNotFoundException extends AbstractPlatformResourceNotFoundExcep public CodeNotFoundException(final Long codeId) { super("error.msg.code.identifier.not.found", "Code with identifier `" + codeId + "` does not exist", codeId); } + + public CodeNotFoundException(final String name, EmptyResultDataAccessException e) { + super("error.msg.code.not.found", "Code with name `" + name + "` does not exist", name, e); + } + + public CodeNotFoundException(final Long codeId, EmptyResultDataAccessException e) { + super("error.msg.code.identifier.not.found", "Code with identifier `" + codeId + "` does not exist", codeId, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeValueNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeValueNotFoundException.java index ef5f10fcd..fc9b85666 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeValueNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/exception/CodeValueNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.codes.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when client resources are not found. @@ -38,4 +39,8 @@ public class CodeValueNotFoundException extends AbstractPlatformResourceNotFound super("error.msg.codevalue.codename.id.combination.invalid", "Code value with label " + label + " does not exist for a code with name " + codeName, label, codeName); } + + public CodeValueNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.codevalue.id.invalid", "Code value with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeReadPlatformServiceImpl.java index 19bc39c18..dbcd89c5f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeReadPlatformServiceImpl.java @@ -82,7 +82,7 @@ public class CodeReadPlatformServiceImpl implements CodeReadPlatformService { return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { codeId }); } catch (final EmptyResultDataAccessException e) { - throw new CodeNotFoundException(codeId); + throw new CodeNotFoundException(codeId, e); } } @@ -96,7 +96,7 @@ public class CodeReadPlatformServiceImpl implements CodeReadPlatformService { return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { codeName }); } catch (final EmptyResultDataAccessException e) { - throw new CodeNotFoundException(codeName); + throw new CodeNotFoundException(codeName, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformServiceImpl.java index cc38bed79..a81e68a98 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformServiceImpl.java @@ -99,7 +99,7 @@ public class CodeValueReadPlatformServiceImpl implements CodeValueReadPlatformSe return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { codeValueId }); } catch (final EmptyResultDataAccessException e) { - throw new CodeValueNotFoundException(codeValueId); + throw new CodeValueNotFoundException(codeValueId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java index e06e52a28..2cd959153 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java @@ -161,10 +161,10 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue LOG.error("Error occured.", dve); final Throwable realCause = dve.getMostSpecificCause(); if (realCause.getMessage().contains("code_value")) { - throw new PlatformDataIntegrityException("error.msg.codeValue.in.use", "This code value is in use", codeValueId); + throw new PlatformDataIntegrityException("error.msg.codeValue.in.use", "This code value is in use", codeValueId, dve); } throw new PlatformDataIntegrityException("error.msg.code.value.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + dve.getMostSpecificCause().getMessage()); + "Unknown data integrity issue with resource: " + dve.getMostSpecificCause().getMessage(), dve); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java index f0b860dd1..a798a3dd7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java @@ -129,7 +129,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf this.codeRepository.flush(); } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.cund.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } return new CommandProcessingResultBuilder().withEntityId(codeId).build(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java new file mode 100644 index 000000000..8eeb8b53c --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.infrastructure.core.exception; + +import java.util.ArrayList; +import java.util.List; + +public abstract class AbstractPlatformException { + + protected static Throwable findThrowableCause(Object[] defaultUserMessageArgs) { + for (Object defaultUserMessageArg : defaultUserMessageArgs) { + if (defaultUserMessageArg instanceof Throwable) { + return (Throwable) defaultUserMessageArg; + } + } + return null; + } + + protected static Object[] filterThrowableCause(Object[] defaultUserMessageArgs) { + List filteredDefaultUserMessageArgs = new ArrayList<>(defaultUserMessageArgs.length); + for (Object defaultUserMessageArg : defaultUserMessageArgs) { + if (!(defaultUserMessageArg instanceof Throwable)) { + filteredDefaultUserMessageArgs.add(defaultUserMessageArg); + } + } + return filteredDefaultUserMessageArgs.toArray(); + } + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java index b6174ce11..3c1ecce3a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java @@ -18,9 +18,6 @@ */ package org.apache.fineract.infrastructure.core.exception; -import java.util.ArrayList; -import java.util.List; - /** * A {@link RuntimeException} thrown when resources that are queried for are not found. */ @@ -32,29 +29,10 @@ public abstract class AbstractPlatformResourceNotFoundException extends RuntimeE protected AbstractPlatformResourceNotFoundException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { - super(findThrowableCause(defaultUserMessageArgs)); + super(AbstractPlatformException.findThrowableCause(defaultUserMessageArgs)); this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = filterThrowableCause(defaultUserMessageArgs); - } - - private static Throwable findThrowableCause(Object[] defaultUserMessageArgs) { - for (Object defaultUserMessageArg : defaultUserMessageArgs) { - if (defaultUserMessageArg instanceof Throwable) { - return (Throwable) defaultUserMessageArg; - } - } - return null; - } - - private static Object[] filterThrowableCause(Object[] defaultUserMessageArgs) { - List filteredDefaultUserMessageArgs = new ArrayList<>(defaultUserMessageArgs.length); - for (Object defaultUserMessageArg : defaultUserMessageArgs) { - if (!(defaultUserMessageArg instanceof Throwable)) { - filteredDefaultUserMessageArgs.add(defaultUserMessageArg); - } - } - return filteredDefaultUserMessageArgs.toArray(); + this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); } public String getGlobalisationMessageCode() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java index 6e389e295..14e1baa7b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java @@ -43,6 +43,21 @@ public class PlatformApiDataValidationException extends RuntimeException { this.errors = errors; } + public PlatformApiDataValidationException(final String globalisationMessageCode, final String defaultUserMessage, + final List errors, Throwable cause) { + super(cause); + this.globalisationMessageCode = globalisationMessageCode; + this.defaultUserMessage = defaultUserMessage; + this.errors = errors; + } + + public PlatformApiDataValidationException(final List errors, Throwable cause) { + super(cause); + this.globalisationMessageCode = "validation.msg.validation.errors.exist"; + this.defaultUserMessage = "Validation errors exist."; + this.errors = errors; + } + public String getGlobalisationMessageCode() { return this.globalisationMessageCode; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java index d2a0c4a09..1ec8f015f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java @@ -30,18 +30,20 @@ public class PlatformDataIntegrityException extends RuntimeException { public PlatformDataIntegrityException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { + super(AbstractPlatformException.findThrowableCause(defaultUserMessageArgs)); this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; this.parameterName = null; - this.defaultUserMessageArgs = defaultUserMessageArgs; + this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); } public PlatformDataIntegrityException(final String globalisationMessageCode, final String defaultUserMessage, final String parameterName, final Object... defaultUserMessageArgs) { + super(AbstractPlatformException.findThrowableCause(defaultUserMessageArgs)); this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; this.parameterName = parameterName; - this.defaultUserMessageArgs = defaultUserMessageArgs; + this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); } public String getGlobalisationMessageCode() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java index b990439a3..86a9c1f4c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java @@ -124,6 +124,7 @@ public class FromJsonHelper { * @param object * @param supportedParams */ + @SuppressWarnings("AvoidHidingCauseException") public void checkForUnsupportedNestedParameters(final String parentPropertyName, final JsonObject object, final Set supportedParams) { try { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java index a1f827880..a89039dac 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java @@ -347,7 +347,7 @@ public class JsonParserHelper { dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } @@ -420,7 +420,7 @@ public class JsonParserHelper { parameterName); dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } @@ -474,7 +474,7 @@ public class JsonParserHelper { dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } @@ -568,7 +568,7 @@ public class JsonParserHelper { dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } @@ -592,7 +592,7 @@ public class JsonParserHelper { dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } @@ -648,7 +648,7 @@ public class JsonParserHelper { dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/DateUtils.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/DateUtils.java index 9360771bc..0f4c39577 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/DateUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/DateUtils.java @@ -95,7 +95,7 @@ public class DateUtils { "The parameter date (" + stringDate + ") is invalid w.r.t. pattern " + pattern, "date", stringDate, pattern); dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java index c6a0aa63b..b59e80bd5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TenantDatabaseUpgradeService.java @@ -86,7 +86,7 @@ public class TenantDatabaseUpgradeService { } catch (FlywayException e) { String betterMessage = e.getMessage() + "; for Tenant DB URL: " + connectionProtocol + ", username: " + connection.getSchemaUsername(); - throw new FlywayException(betterMessage, e.getCause()); + throw new FlywayException(betterMessage, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java index 824fe444b..f2acc5153 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java @@ -86,7 +86,7 @@ public class GenericDataServiceImpl implements GenericDataService { return new GenericResultsetData(columnHeaders, resultsetDataRows); } catch (DataAccessException e) { - throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue", e.getClass().getName()); + throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue", e.getClass().getName(), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java index b0e72b130..67a39ea60 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java @@ -116,7 +116,7 @@ public class ReadReportingServiceImpl implements ReadReportingService { // out.flush(); // out.close(); } catch (final Exception e) { - throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage()); + throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage(), e); } } }; @@ -313,7 +313,7 @@ public class ReadReportingServiceImpl implements ReadReportingService { return genaratePdf; } catch (final Exception e) { LOG.error("error.msg.reporting.error:", e); - throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage()); + throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage(), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java index 69a18f97c..f708f8209 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java @@ -273,21 +273,21 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ if (realCause.getMessage().contains("Duplicate entry") || cause.getMessage().contains("Duplicate entry")) { throw new PlatformDataIntegrityException("error.msg.datatable.registered", "Datatable `" + dataTableName + "` is already registered against an application table.", "dataTableName", - dataTableName); + dataTableName, dve); } logAsErrorUnexpectedDataIntegrityException(dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } catch (final PersistenceException dve) { final Throwable cause = dve.getCause(); if (cause.getMessage().contains("Duplicate entry")) { throw new PlatformDataIntegrityException("error.msg.datatable.registered", "Datatable `" + dataTableName + "` is already registered against an application table.", "dataTableName", - dataTableName); + dataTableName, dve); } logAsErrorUnexpectedDataIntegrityException(dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } } @@ -394,35 +394,35 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ throw new PlatformDataIntegrityException( "error.msg.datatable.entry.duplicate", "An entry already exists for datatable `" + dataTableName + "` and application table with identifier `" + appTableId + "`.", - "dataTableName", dataTableName, appTableId); + "dataTableName", dataTableName, appTableId, dve); } else if (realCause.getMessage().contains("doesn't have a default value") || cause.getMessage().contains("doesn't have a default value")) { throw new PlatformDataIntegrityException( "error.msg.datatable.no.value.provided.for.required.fields", "No values provided for the datatable `" + dataTableName + "` and application table with identifier `" + appTableId + "`.", - "dataTableName", dataTableName, appTableId); + "dataTableName", dataTableName, appTableId, dve); } logAsErrorUnexpectedDataIntegrityException(dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } catch (final PersistenceException e) { final Throwable cause = e.getCause(); if (cause.getMessage().contains("Duplicate entry")) { throw new PlatformDataIntegrityException( "error.msg.datatable.entry.duplicate", "An entry already exists for datatable `" + dataTableName + "` and application table with identifier `" + appTableId + "`.", - "dataTableName", dataTableName, appTableId); + "dataTableName", dataTableName, appTableId, e); } else if (cause.getMessage().contains("doesn't have a default value")) { throw new PlatformDataIntegrityException( "error.msg.datatable.no.value.provided.for.required.fields", "No values provided for the datatable `" + dataTableName + "` and application table with identifier `" + appTableId + "`.", - "dataTableName", dataTableName, appTableId); + "dataTableName", dataTableName, appTableId, e); } logAsErrorUnexpectedDataIntegrityException(e); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", e); } } @@ -452,24 +452,24 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ throw new PlatformDataIntegrityException( "error.msg.datatable.entry.duplicate", "An entry already exists for datatable `" + dataTableName + "` and application table with identifier `" + appTableId + "`.", - "dataTableName", dataTableName, appTableId); + "dataTableName", dataTableName, appTableId, dve); } logAsErrorUnexpectedDataIntegrityException(dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } catch (final PersistenceException dve) { final Throwable cause = dve.getCause(); if (cause.getMessage().contains("Duplicate entry")) { throw new PlatformDataIntegrityException( "error.msg.datatable.entry.duplicate", "An entry already exists for datatable `" + dataTableName + "` and application table with identifier `" + appTableId + "`.", - "dataTableName", dataTableName, appTableId); + "dataTableName", dataTableName, appTableId, dve); } logAsErrorUnexpectedDataIntegrityException(dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } } @@ -1008,7 +1008,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ } catch (final Exception e) { if (e.getMessage().contains("Error on rename")) { throw new PlatformServiceUnavailableException("error.msg.datatable.column.update.not.allowed", - "One of the column name modification not allowed"); + "One of the column name modification not allowed", e); } // handle all other exceptions in here @@ -1018,7 +1018,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ // PlatformServiceUnavailableException if (e.getMessage().toLowerCase().contains("invalid use of null value")) { throw new PlatformServiceUnavailableException("error.msg.datatable.column.update.not.allowed", - "One of the data table columns contains null values"); + "One of the data table columns contains null values", e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java index 592ad5c1a..a4dab8e34 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java @@ -84,7 +84,7 @@ public class FileSystemContentRepository implements ContentRepository { out.flush(); out.close(); } catch (final IOException ioe) { - throw new ContentManagementException(imageName, ioe.getMessage()); + throw new ContentManagementException(imageName, ioe.getMessage(), ioe); } catch (IllegalArgumentException iae) { LOG.error("IllegalArgumentException due to invalid Base64 encoding: {}", base64EncodedImageString, iae); throw iae; @@ -173,7 +173,7 @@ public class FileSystemContentRepository implements ContentRepository { } catch (final IOException ioException) { LOG.warn("writeFileToFileSystem() IOException (logged because cause is not propagated in ContentManagementException)", ioException); - throw new ContentManagementException(fileName, ioException.getMessage()); + throw new ContentManagementException(fileName, ioException.getMessage(), ioException); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java index c5c98d39d..19a42ea46 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java @@ -76,7 +76,7 @@ public class S3ContentRepository implements ContentRepository { try { deleteObjectFromS3(documentPath); } catch (final AmazonClientException ace) { - throw new ContentManagementException(documentName, ace.getMessage()); + throw new ContentManagementException(documentName, ace.getMessage(), ace); } } @@ -129,7 +129,8 @@ public class S3ContentRepository implements ContentRepository { fileData = new FileData(s3object.getObjectContent(), fileName, documentData.contentType()); } catch (final AmazonClientException ace) { LOG.error("Error occured.", ace); - throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId()); + throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId(), + ace); } return fileData; } @@ -177,7 +178,7 @@ public class S3ContentRepository implements ContentRepository { this.s3Client.putObject(new PutObjectRequest(this.s3BucketName, s3UploadLocation, inputStream, new ObjectMetadata())); } catch (final AmazonClientException ace) { final String message = ace.getMessage(); - throw new ContentManagementException(filename, message); + throw new ContentManagementException(filename, message, ace); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java index 9677d9bc2..8136f1547 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/ContentManagementException.java @@ -18,6 +18,8 @@ */ package org.apache.fineract.infrastructure.documentmanagement.exception; +import com.amazonaws.AmazonClientException; +import java.io.IOException; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; public class ContentManagementException extends AbstractPlatformDomainRuleException { @@ -32,4 +34,19 @@ public class ContentManagementException extends AbstractPlatformDomainRuleExcept + fileSize / (1024 * 1024) + " MB exceeds the max permissable file size of " + maxFileSize + " MB", name, fileSize); } + public ContentManagementException(String filename, String message, IOException ioException) { + super("error.msg.document.save", "Error while manipulating file " + filename + " due to a File system / Amazon S3 issue " + message, + filename, message, ioException); + } + + public ContentManagementException(String filename, String message, AmazonClientException ace) { + super("error.msg.document.save", "Error while manipulating file " + filename + " due to a File system / Amazon S3 issue " + message, + filename, message, ace); + } + + public ContentManagementException(String filename, String message, ContentManagementException cme) { + super("error.msg.document.save", "Error while manipulating file " + filename + " due to a File system / Amazon S3 issue " + message, + filename, message, cme); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java index f1243e713..6e02ecce9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/exception/DocumentNotFoundException.java @@ -18,7 +18,9 @@ */ package org.apache.fineract.infrastructure.documentmanagement.exception; +import com.amazonaws.AmazonClientException; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class DocumentNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -26,4 +28,14 @@ public class DocumentNotFoundException extends AbstractPlatformResourceNotFoundE super("error.msg.document.id.invalid", "Document with identifier " + id + " does not exist for the " + entityType + " with Identifier " + entityId, id); } + + public DocumentNotFoundException(String entityType, Long entityId, Long id, EmptyResultDataAccessException e) { + super("error.msg.document.id.invalid", + "Document with identifier " + id + " does not exist for the " + entityType + " with Identifier " + entityId, id, e); + } + + public DocumentNotFoundException(String entityType, Long entityId, Long id, AmazonClientException ace) { + super("error.msg.document.id.invalid", + "Document with identifier " + id + " does not exist for the " + entityType + " with Identifier " + entityId, id, ace); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java index b8facf8a1..4e0c47734 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentReadPlatformServiceImpl.java @@ -71,7 +71,7 @@ public class DocumentReadPlatformServiceImpl implements DocumentReadPlatformServ final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(documentData.storageType()); return contentRepository.fetchFile(documentData); } catch (final EmptyResultDataAccessException e) { - throw new DocumentNotFoundException(entityType, entityId, documentId); + throw new DocumentNotFoundException(entityType, entityId, documentId, e); } } @@ -81,7 +81,7 @@ public class DocumentReadPlatformServiceImpl implements DocumentReadPlatformServ final DocumentMapper mapper = new DocumentMapper(true, true); return fetchDocumentDetails(entityType, entityId, documentId, mapper); } catch (final EmptyResultDataAccessException e) { - throw new DocumentNotFoundException(entityType, entityId, documentId); + throw new DocumentNotFoundException(entityType, entityId, documentId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java index dd1f56078..cf4ebc812 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java @@ -82,7 +82,7 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr } catch (final DataIntegrityViolationException dve) { LOG.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } } @@ -136,10 +136,10 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr } catch (final DataIntegrityViolationException dve) { LOG.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } catch (final ContentManagementException cme) { LOG.error("Error occured.", cme); - throw new ContentManagementException(documentCommand.getName(), cme.getMessage()); + throw new ContentManagementException(documentCommand.getName(), cme.getMessage(), cme); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java index 0da188b72..707588cd7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java @@ -113,7 +113,7 @@ public class ImageReadPlatformServiceImpl implements ImageReadPlatformService { return result; } catch (final EmptyResultDataAccessException e) { - throw new ImageNotFoundException("clients", entityId); + throw new ImageNotFoundException("clients", entityId, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/exception/DeviceRegistrationNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/exception/DeviceRegistrationNotFoundException.java index f2a130bbd..a5f8aa0e2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/exception/DeviceRegistrationNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/exception/DeviceRegistrationNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.gcm.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class DeviceRegistrationNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -31,4 +32,13 @@ public class DeviceRegistrationNotFoundException extends AbstractPlatformResourc "Device registration with " + value + " identifier " + clientId + " does not exist", clientId); } + public DeviceRegistrationNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.device.registration.id.invalid", "Device registration with identifier " + id + " does not exist", id, e); + } + + public DeviceRegistrationNotFoundException(Long clientId, String value, EmptyResultDataAccessException e) { + super("error.msg.device.registration." + value + ".invalid", + "Device registration with " + value + " identifier " + clientId + " does not exist", clientId, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/DeviceRegistrationReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/DeviceRegistrationReadPlatformServiceImpl.java index d3a23109a..1b3f7dee7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/DeviceRegistrationReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/DeviceRegistrationReadPlatformServiceImpl.java @@ -92,7 +92,7 @@ public class DeviceRegistrationReadPlatformServiceImpl implements DeviceRegistra String sql = "select " + drm.schema() + " where cdr.id = ? "; return this.jdbcTemplate.queryForObject(sql, drm, new Object[] { id }); } catch (final EmptyResultDataAccessException e) { - throw new DeviceRegistrationNotFoundException(id); + throw new DeviceRegistrationNotFoundException(id, e); } } @@ -104,7 +104,7 @@ public class DeviceRegistrationReadPlatformServiceImpl implements DeviceRegistra String sql = "select " + drm.schema() + " where c.id = ? "; return this.jdbcTemplate.queryForObject(sql, drm, new Object[] { clientId }); } catch (final EmptyResultDataAccessException e) { - throw new DeviceRegistrationNotFoundException(clientId, "client"); + throw new DeviceRegistrationNotFoundException(clientId, "client", e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/exception/HookNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/exception/HookNotFoundException.java index a6ead8425..7d01e12f3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/exception/HookNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/exception/HookNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.hooks.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class HookNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -29,4 +30,8 @@ public class HookNotFoundException extends AbstractPlatformResourceNotFoundExcep public HookNotFoundException(final Long hookId) { super("error.msg.hook.identifier.not.found", "Hook with identifier `" + hookId + "` does not exist", hookId); } + + public HookNotFoundException(Long hookId, EmptyResultDataAccessException e) { + super("error.msg.hook.identifier.not.found", "Hook with identifier `" + hookId + "` does not exist", hookId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookReadPlatformServiceImpl.java index 9ecd93f3a..0ddc08899 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookReadPlatformServiceImpl.java @@ -75,7 +75,7 @@ public class HookReadPlatformServiceImpl implements HookReadPlatformService { return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { hookId }); } catch (final EmptyResultDataAccessException e) { - throw new HookNotFoundException(hookId); + throw new HookNotFoundException(hookId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookWritePlatformServiceJpaRepositoryImpl.java index ddeb49389..fb03fa80b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/service/HookWritePlatformServiceJpaRepositoryImpl.java @@ -200,7 +200,7 @@ public class HookWritePlatformServiceJpaRepositoryImpl implements HookWritePlatf this.hookRepository.delete(hook); } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } return new CommandProcessingResultBuilder().withEntityId(hookId).build(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobNotFoundException.java index c9a58c46a..b4bd7e589 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.jobs.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when Job resources are not found. @@ -28,4 +29,8 @@ public class JobNotFoundException extends AbstractPlatformResourceNotFoundExcept public JobNotFoundException(final String identifier) { super("error.msg.sheduler.job.id.invalid", "Job with identifier " + identifier + " does not exist", identifier); } + + public JobNotFoundException(String identifier, EmptyResultDataAccessException e) { + super("error.msg.sheduler.job.id.invalid", "Job with identifier " + identifier + " does not exist", identifier, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java index bbbab50d2..3d073442d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java @@ -164,7 +164,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi } catch (final Exception e) { final String msg = "Job execution failed for job with id:" + scheduledJobDetail.getId(); LOG.error("{}", msg, e); - throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", msg, scheduledJobDetail.getId()); + throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", msg, scheduledJobDetail.getId(), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java index 15ce35822..a00f38af3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerJobRunnerReadServiceImpl.java @@ -67,7 +67,7 @@ public class SchedulerJobRunnerReadServiceImpl implements SchedulerJobRunnerRead final String sql = detailMapper.schema() + " where job.id=?"; return this.jdbcTemplate.queryForObject(sql, detailMapper, new Object[] { jobId }); } catch (final EmptyResultDataAccessException e) { - throw new JobNotFoundException(String.valueOf(jobId)); + throw new JobNotFoundException(String.valueOf(jobId), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java index a1e27e1f6..ae0652d73 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobConfigurationNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.reportmailingjob.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when report mailing job configuration resources are not found. @@ -30,4 +31,9 @@ public class ReportMailingJobConfigurationNotFoundException extends AbstractPlat super("error.msg.report.mailing.job.configuration.name.invalid", "Report mailing job configuration with name " + name + " does not exist", name); } + + public ReportMailingJobConfigurationNotFoundException(String name, EmptyResultDataAccessException ex) { + super("error.msg.report.mailing.job.configuration.name.invalid", + "Report mailing job configuration with name " + name + " does not exist", name, ex); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java index bdd86bc24..03da097c9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/exception/ReportMailingJobNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.reportmailingjob.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when report mailing job resources are not found. @@ -30,4 +31,9 @@ public class ReportMailingJobNotFoundException extends AbstractPlatformResourceN super("error.msg.report.mailing.job.id.invalid", "Report mailing job with identifier " + reportMailingJobId + " does not exist", reportMailingJobId); } + + public ReportMailingJobNotFoundException(Long reportMailingJobId, EmptyResultDataAccessException ex) { + super("error.msg.report.mailing.job.id.invalid", "Report mailing job with identifier " + reportMailingJobId + " does not exist", + reportMailingJobId, ex); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobConfigurationReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobConfigurationReadPlatformServiceImpl.java index f916d8194..39ac75b94 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobConfigurationReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobConfigurationReadPlatformServiceImpl.java @@ -62,7 +62,7 @@ public class ReportMailingJobConfigurationReadPlatformServiceImpl implements Rep } catch (final EmptyResultDataAccessException ex) { - throw new ReportMailingJobConfigurationNotFoundException(name); + throw new ReportMailingJobConfigurationNotFoundException(name, ex); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformServiceImpl.java index efcc1b923..26c0714bc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobReadPlatformServiceImpl.java @@ -109,7 +109,7 @@ public class ReportMailingJobReadPlatformServiceImpl implements ReportMailingJob } catch (final EmptyResultDataAccessException ex) { - throw new ReportMailingJobNotFoundException(reportMailingJobId); + throw new ReportMailingJobNotFoundException(reportMailingJobId, ex); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java index 5cc1901ab..8facd0514 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/exception/InvalidTenantIdentiferException.java @@ -18,6 +18,8 @@ */ package org.apache.fineract.infrastructure.security.exception; +import org.springframework.dao.EmptyResultDataAccessException; + /** * {@link RuntimeException} thrown when an invalid tenant identifier is used in request to platform. * @@ -28,4 +30,8 @@ public class InvalidTenantIdentiferException extends RuntimeException { public InvalidTenantIdentiferException(final String message) { super(message); } + + public InvalidTenantIdentiferException(String message, EmptyResultDataAccessException e) { + super(message, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java index 2269c5b6c..e6c85034c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/BasicAuthTenantDetailsServiceJdbc.java @@ -140,7 +140,7 @@ public class BasicAuthTenantDetailsServiceJdbc implements BasicAuthTenantDetails return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { tenantIdentifier }); } catch (final EmptyResultDataAccessException e) { - throw new InvalidTenantIdentiferException("The tenant identifier: " + tenantIdentifier + " is not valid."); + throw new InvalidTenantIdentiferException("The tenant identifier: " + tenantIdentifier + " is not valid.", e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java index 701abdc0d..f2987696b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/JdbcTenantDetailsService.java @@ -133,7 +133,7 @@ public class JdbcTenantDetailsService implements TenantDetailsService { return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { tenantIdentifier }); } catch (final EmptyResultDataAccessException e) { - throw new InvalidTenantIdentiferException("The tenant identifier: " + tenantIdentifier + " is not valid."); + throw new InvalidTenantIdentiferException("The tenant identifier: " + tenantIdentifier + " is not valid.", e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java index c3236fb01..18a563b47 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java @@ -68,7 +68,7 @@ public class ColumnValidator { } } } catch (SQLException e) { - throw new SQLInjectionException(); + throw new SQLInjectionException(e); } finally { if (connection != null) { DataSourceUtils.releaseConnection(connection, jdbcTemplate.getDataSource()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionException.java index 571b20e59..3170bf8d8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionException.java @@ -18,6 +18,7 @@ */ package org.apache.fineract.infrastructure.security.utils; +import java.sql.SQLException; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; public class SQLInjectionException extends PlatformApiDataValidationException { @@ -26,4 +27,8 @@ public class SQLInjectionException extends PlatformApiDataValidationException { super("error.msg.found.sql.injection", "Unexpected SQL Commands found", null); } + public SQLInjectionException(SQLException e) { + super("error.msg.found.sql.injection", "Unexpected SQL Commands found", null, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/exception/SmsNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/exception/SmsNotFoundException.java index 73a7cf936..c51b764c7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/exception/SmsNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/exception/SmsNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.infrastructure.sms.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when a code is not found. @@ -28,4 +29,8 @@ public class SmsNotFoundException extends AbstractPlatformResourceNotFoundExcept public SmsNotFoundException(final Long resourceId) { super("error.msg.sms.identifier.not.found", "SMS with identifier `" + resourceId + "` does not exist", resourceId); } + + public SmsNotFoundException(Long resourceId, EmptyResultDataAccessException e) { + super("error.msg.sms.identifier.not.found", "SMS with identifier `" + resourceId + "` does not exist", resourceId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java index b15f3f02b..339e8196e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java @@ -140,7 +140,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob // apiQueueResourceDatas).start(); } } catch (Exception e) { - throw new ConnectionFailureException(SmsCampaignConstants.SMS); + throw new ConnectionFailureException(SmsCampaignConstants.SMS, e); } page++; totalRecords = pendingMessages.getTotalPages(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsReadPlatformServiceImpl.java index 6f8bd50b5..921eff4c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsReadPlatformServiceImpl.java @@ -124,7 +124,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService { return this.jdbcTemplate.queryForObject(sql, this.smsRowMapper, new Object[] { resourceId }); } catch (final EmptyResultDataAccessException e) { - throw new SmsNotFoundException(resourceId); + throw new SmsNotFoundException(resourceId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLResultServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLResultServiceImpl.java index b75645410..cb8f1a140 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLResultServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/mix/service/XBRLResultServiceImpl.java @@ -166,7 +166,7 @@ public class XBRLResultServiceImpl implements XBRLResultService { } } catch (final ScriptException e) { LOG.error("Problem occurred in processMappingString function", e); - throw new IllegalArgumentException(e.getMessage()); + throw new IllegalArgumentException(e.getMessage(), e); } return new BigDecimal(eval); diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/exception/TopicNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/notification/exception/TopicNotFoundException.java index 4c9b48168..4d02d0327 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/exception/TopicNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/exception/TopicNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.notification.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when topic resources are not found. @@ -29,4 +30,8 @@ public class TopicNotFoundException extends AbstractPlatformResourceNotFoundExce super("error.msg.topic.id.invalid", "Topic with identifier " + id + " does not exist", id); } + public TopicNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.topic.id.invalid", "Topic with identifier " + id + " does not exist", id, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/service/TopicReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/notification/service/TopicReadPlatformServiceImpl.java index e16fc5f93..97705d8c7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/service/TopicReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/service/TopicReadPlatformServiceImpl.java @@ -91,7 +91,7 @@ public class TopicReadPlatformServiceImpl implements TopicReadPlatformService { final String sql = "select " + tm.schema() + " where t.id = ?"; return this.jdbcTemplate.queryForObject(sql, tm, new Object[] { topicId }); } catch (final EmptyResultDataAccessException e) { - throw new TopicNotFoundException(topicId); + throw new TopicNotFoundException(topicId, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/exception/HolidayNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/exception/HolidayNotFoundException.java index 88fc0cf45..f13b02218 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/exception/HolidayNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/exception/HolidayNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.organisation.holiday.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when holiday resources are not found. @@ -28,4 +29,8 @@ public class HolidayNotFoundException extends AbstractPlatformResourceNotFoundEx public HolidayNotFoundException(final Long id) { super("error.msg.holiday.id.invalid", "Holiday with identifier " + id + " does not exist", id); } + + public HolidayNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.holiday.id.invalid", "Holiday with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayReadPlatformServiceImpl.java index 70c3636c6..f6a1ec4c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayReadPlatformServiceImpl.java @@ -133,7 +133,7 @@ public class HolidayReadPlatformServiceImpl implements HolidayReadPlatformServic return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { holidayId }); } catch (final EmptyResultDataAccessException e) { - throw new HolidayNotFoundException(holidayId); + throw new HolidayNotFoundException(holidayId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeNotFoundException.java index 798f3bc7b..c9a712d55 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/exception/OfficeNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.organisation.office.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when office resources are not found. @@ -28,4 +29,8 @@ public class OfficeNotFoundException extends AbstractPlatformResourceNotFoundExc public OfficeNotFoundException(final Long id) { super("error.msg.office.id.invalid", "Office with identifier " + id + " does not exist", id); } + + public OfficeNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.office.id.invalid", "Office with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java index ea65bd193..8cc7932ff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java @@ -200,7 +200,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService return selectedOffice; } catch (final EmptyResultDataAccessException e) { - throw new OfficeNotFoundException(officeId); + throw new OfficeNotFoundException(officeId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/exception/ProvisioningCriteriaNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/exception/ProvisioningCriteriaNotFoundException.java index 415c82790..855655178 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/exception/ProvisioningCriteriaNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/exception/ProvisioningCriteriaNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.organisation.provisioning.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class ProvisioningCriteriaNotFoundException extends AbstractPlatformResourceNotFoundException { public ProvisioningCriteriaNotFoundException(final Long id) { super("error.msg.provisioning.criteria.id.invalid", "Provisioning Criteria with identifier " + id + " does not exist", id); } + + public ProvisioningCriteriaNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.provisioning.criteria.id.invalid", "Provisioning Criteria with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaReadPlatformServiceImpl.java index fc805c05f..aae16f899 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaReadPlatformServiceImpl.java @@ -123,7 +123,7 @@ public class ProvisioningCriteriaReadPlatformServiceImpl implements Provisioning List definitions = retrieveProvisioningDefinitions(criteriaId); return ProvisioningCriteriaData.toLookup(criteriaId, criteriaName, loanProducts, definitions); } catch (EmptyResultDataAccessException e) { - throw new ProvisioningCriteriaNotFoundException(criteriaId); + throw new ProvisioningCriteriaNotFoundException(criteriaId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffNotFoundException.java index cee4520e1..da64f3651 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.organisation.staff.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when staff resources are not found. @@ -28,4 +29,8 @@ public class StaffNotFoundException extends AbstractPlatformResourceNotFoundExce public StaffNotFoundException(final Long id) { super("error.msg.staff.id.invalid", "Staff with identifier " + id + " does not exist", id); } + + public StaffNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.staff.id.invalid", "Staff with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java index d93718e9f..7eb3457a0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformServiceImpl.java @@ -199,7 +199,7 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService { return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { staffId, hierarchy }); } catch (final EmptyResultDataAccessException e) { - throw new StaffNotFoundException(staffId); + throw new StaffNotFoundException(staffId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java index 0af1db247..e78db736e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java @@ -219,7 +219,7 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement return this.jdbcTemplate.queryForObject(sql, tm, new Object[] { tellerId }); } catch (final EmptyResultDataAccessException e) { - throw new StaffNotFoundException(tellerId); + throw new StaffNotFoundException(tellerId, e); } } @@ -332,7 +332,7 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement return this.jdbcTemplate.queryForObject(sql, cm, new Object[] { cashierId }); } catch (final EmptyResultDataAccessException e) { - throw new StaffNotFoundException(cashierId); + throw new StaffNotFoundException(cashierId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/exception/WorkingDaysNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/exception/WorkingDaysNotFoundException.java index 8305cb574..8fe92c6c4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/exception/WorkingDaysNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/exception/WorkingDaysNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.organisation.workingdays.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when Calendar resources are not found. @@ -29,4 +30,8 @@ public class WorkingDaysNotFoundException extends AbstractPlatformResourceNotFou super("error.msg.working.days.not.configured", "Must configure the Working days for the organisation."); } + public WorkingDaysNotFoundException(EmptyResultDataAccessException e) { + super("error.msg.working.days.not.configured", "Must configure the Working days for the organisation.", e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysReadPlatformServiceImpl.java index a2ba37670..21756f84b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysReadPlatformServiceImpl.java @@ -86,7 +86,7 @@ public class WorkingDaysReadPlatformServiceImpl implements WorkingDaysReadPlatfo Collection repaymentRescheduleOptions = repaymentRescheduleTypeOptions(); return new WorkingDaysData(data, repaymentRescheduleOptions); } catch (final EmptyResultDataAccessException e) { - throw new WorkingDaysNotFoundException(); + throw new WorkingDaysNotFoundException(e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysWritePlatformServiceJpaRepositoryImpl.java index a50fac2fe..57700c7e3 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/service/WorkingDaysWritePlatformServiceJpaRepositoryImpl.java @@ -66,10 +66,10 @@ public class WorkingDaysWritePlatformServiceJpaRepositoryImpl implements Working .build(); } catch (final ValidationException e) { throw new PlatformDataIntegrityException("error.msg.invalid.recurring.rule", - "The Recurring Rule value: " + recurrence + " is not valid.", "recurrence", recurrence); + "The Recurring Rule value: " + recurrence + " is not valid.", "recurrence", recurrence, e); } catch (final IllegalArgumentException | ParseException e) { throw new PlatformDataIntegrityException("error.msg.recurring.rule.parsing.error", - "Error in passing the Recurring Rule value: " + recurrence, "recurrence", e.getMessage()); + "Error in passing the Recurring Rule value: " + recurrence, "recurrence", e.getMessage(), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/exception/AccountTransferNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/exception/AccountTransferNotFoundException.java index f405fb814..f4428f3ce 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/exception/AccountTransferNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/exception/AccountTransferNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.account.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class AccountTransferNotFoundException extends AbstractPlatformResourceNotFoundException { public AccountTransferNotFoundException(final Long id) { super("error.msg.accounttransfer.id.invalid", "Account transfer with identifier " + id + " does not exist", id); } + + public AccountTransferNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.accounttransfer.id.invalid", "Account transfer with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java index 76f676e3d..b71ba0409 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java @@ -252,7 +252,7 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers return this.jdbcTemplate.queryForObject(sql, this.accountTransfersMapper, new Object[] { transferId }); } catch (final EmptyResultDataAccessException e) { - throw new AccountTransferNotFoundException(transferId); + throw new AccountTransferNotFoundException(transferId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java index 5e41306b2..c6904e86c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java @@ -92,7 +92,7 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount break; } } catch (final EmptyResultDataAccessException e) { - throw new AccountTransferNotFoundException(accountId); + throw new AccountTransferNotFoundException(accountId, e); } return accountData; @@ -389,7 +389,7 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount accountData = this.jdbcTemplate.queryForObject(sql, this.accountRefundByTransferMapper, sqlParams); } catch (final EmptyResultDataAccessException e) { - throw new AccountTransferNotFoundException(accountId); + throw new AccountTransferNotFoundException(accountId, e); } return accountData; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java index 1fec51f66..5daea9531 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionReadPlatformServiceImpl.java @@ -347,7 +347,7 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr return this.jdbcTemplate.queryForObject(sql, this.standingInstructionMapper, new Object[] { instructionId }); } catch (final EmptyResultDataAccessException e) { - throw new AccountTransferNotFoundException(instructionId); + throw new AccountTransferNotFoundException(instructionId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java index 46b0077ac..3bdeb995a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java @@ -112,7 +112,7 @@ public class AccountsApiResource { final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); return this.toApiJsonSerializer.serialize(settings, accountData, service.getResponseDataParams()); } catch (BeansException e) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(e); } } @@ -133,7 +133,7 @@ public class AccountsApiResource { AccountData data = service.retrieveOne(accountId, settings.isTemplate()); return this.toApiJsonSerializer.serialize(settings, data, service.getResponseDataParams()); } catch (BeansException e) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(e); } } @@ -154,7 +154,7 @@ public class AccountsApiResource { final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); return this.toApiJsonSerializer.serialize(settings, data, service.getResponseDataParams()); } catch (BeansException e) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/exceptions/ShareAccountNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/exceptions/ShareAccountNotFoundException.java index a35418498..6c32d9c23 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/exceptions/ShareAccountNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/exceptions/ShareAccountNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.accounts.exceptions; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class ShareAccountNotFoundException extends AbstractPlatformResourceNotFoundException { public ShareAccountNotFoundException(final Long id) { super("error.msg.shareaccount.id.invalid", " Account with identifier " + id + " does not exist", id); } + + public ShareAccountNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.shareaccount.id.invalid", " Account with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarNotFoundException.java index f0fd3bb12..6597de15b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/exception/CalendarNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.calendar.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when Calendar resources are not found. @@ -28,4 +29,8 @@ public class CalendarNotFoundException extends AbstractPlatformResourceNotFoundE public CalendarNotFoundException(final Long id) { super("error.msg.calendar.id.invalid", "Calendar with identifier " + id + " does not exist", id); } + + public CalendarNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.calendar.id.invalid", "Calendar with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java index 004896428..d83cd237a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java @@ -128,7 +128,7 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { calendarId, entityId, entityTypeId }); } catch (final EmptyResultDataAccessException e) { - throw new CalendarNotFoundException(calendarId); + throw new CalendarNotFoundException(calendarId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java index 98df42287..4e16eefbb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java @@ -243,10 +243,10 @@ public class CalendarUtils { recur = rrule.getRecur(); } catch (final ValidationException e) { throw new PlatformDataIntegrityException("error.msg.invalid.recurring.rule", - "The Recurring Rule value: " + recurringRule + " is not valid.", "recurrence", recurringRule); + "The Recurring Rule value: " + recurringRule + " is not valid.", "recurrence", recurringRule, e); } catch (final ParseException e) { throw new PlatformDataIntegrityException("error.msg.recurring.rule.parsing.error", - "Error in pasring the Recurring Rule value: " + recurringRule, "recurrence", recurringRule); + "Error in pasring the Recurring Rule value: " + recurringRule, "recurrence", recurringRule, e); } if (recur == null) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeNotFoundException.java index 0af425f77..663f3159e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class ChargeNotFoundException extends AbstractPlatformResourceNotFoundException { public ChargeNotFoundException(final Long id) { super("error.msg.charge.id.invalid", "Charge with identifier " + id + " does not exist", id); } + + public ChargeNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.charge.id.invalid", "Charge with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java index 4f28d7c54..e7fc5b46d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeNotFoundException.java @@ -20,6 +20,7 @@ package org.apache.fineract.portfolio.charge.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * {@link AbstractPlatformDomainRuleException} thrown when savings account charge does not exist. @@ -35,4 +36,8 @@ public class SavingsAccountChargeNotFoundException extends AbstractPlatformResou "Savings Account charge with identifier " + id + " does not exist for Savings Account " + savingsAccountId, id, savingsAccountId); } + + public SavingsAccountChargeNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.savings.account.charge.id.invalid", "Savings Account charge with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java index 1d5de63d9..5469da3ec 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java @@ -122,7 +122,7 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService sql = sql + " ;"; return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { chargeId }); } catch (final EmptyResultDataAccessException e) { - throw new ChargeNotFoundException(chargeId); + throw new ChargeNotFoundException(chargeId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientChargeNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientChargeNotFoundException.java index 6c2af033b..5d920db25 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientChargeNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientChargeNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class ClientChargeNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -31,4 +32,9 @@ public class ClientChargeNotFoundException extends AbstractPlatformResourceNotFo "Client charge with identifier " + id + " does not exist for client with id " + clientId, id, clientId); } + public ClientChargeNotFoundException(Long id, Long clientId, EmptyResultDataAccessException e) { + super("error.msg.client.charge.id.invalid.for.given.client", + "Client charge with identifier " + id + " does not exist for client with id " + clientId, id, clientId, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java index 061fdbe93..e752c0876 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientIdentifierNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when client Identifier resources are not found. @@ -28,4 +29,8 @@ public class ClientIdentifierNotFoundException extends AbstractPlatformResourceN public ClientIdentifierNotFoundException(final Long id) { super("error.msg.clientIdentifier.id.invalid", "Client Identifier with the primary key " + id + " does not exist", id); } + + public ClientIdentifierNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.clientIdentifier.id.invalid", "Client Identifier with the primary key " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNotFoundException.java index 197567d9d..88627f7da 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when client resources are not found. @@ -36,4 +37,8 @@ public class ClientNotFoundException extends AbstractPlatformResourceNotFoundExc public ClientNotFoundException(String accountNumber) { super("error.msg.client.not.found.with.account.number", "Client not found with account number " + accountNumber + "."); } + + public ClientNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.client.id.invalid", "Client with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientTransactionNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientTransactionNotFoundException.java index 1feeee9cc..0f866d0e5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientTransactionNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ClientTransactionNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; +import org.springframework.dao.EmptyResultDataAccessException; public class ClientTransactionNotFoundException extends AbstractPlatformDomainRuleException { @@ -28,4 +29,10 @@ public class ClientTransactionNotFoundException extends AbstractPlatformDomainRu clientId); } + public ClientTransactionNotFoundException(Long clientId, Long transactionId, EmptyResultDataAccessException e) { + super("error.msg.client.transaction.not.found.exception", + "The Transaction with id `" + transactionId + "` does not exist for a Client with id `" + clientId, transactionId, clientId, + e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ImageNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ImageNotFoundException.java index 3cfbe7bc1..6f51e6b71 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ImageNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/exception/ImageNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.client.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class ImageNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -26,4 +27,9 @@ public class ImageNotFoundException extends AbstractPlatformResourceNotFoundExce super("error.msg.entity.image.invalid", "Image for resource " + resource + " with Identifier " + resourceId + " does not exist", resource, resourceId); } + + public ImageNotFoundException(String resource, Long resourceId, EmptyResultDataAccessException e) { + super("error.msg.entity.image.invalid", "Image for resource " + resource + " with Identifier " + resourceId + " does not exist", + resource, resourceId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeReadPlatformServiceImpl.java index 5790a8ecd..d92139c9e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeReadPlatformServiceImpl.java @@ -126,7 +126,7 @@ public class ClientChargeReadPlatformServiceImpl implements ClientChargeReadPlat return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { clientId, clientChargeId }); } catch (final EmptyResultDataAccessException e) { - throw new ClientChargeNotFoundException(clientChargeId, clientId); + throw new ClientChargeNotFoundException(clientChargeId, clientId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierReadPlatformServiceImpl.java index 2dd7de92a..c096718b7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierReadPlatformServiceImpl.java @@ -81,7 +81,7 @@ public class ClientIdentifierReadPlatformServiceImpl implements ClientIdentifier return clientIdentifierData; } catch (final EmptyResultDataAccessException e) { - throw new ClientIdentifierNotFoundException(clientIdentifierId); + throw new ClientIdentifierNotFoundException(clientIdentifierId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java index 1bb5332a5..2d877cf0f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java @@ -302,7 +302,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService return ClientData.setParentGroups(clientData, parentGroups); } catch (final EmptyResultDataAccessException e) { - throw new ClientNotFoundException(clientId); + throw new ClientNotFoundException(clientId, e); } } @@ -842,7 +842,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService final String sql = "SELECT cl.id FROM m_client cl WHERE cl.id =? "; this.jdbcTemplate.queryForObject(sql, Long.class, clientId); } catch (final EmptyResultDataAccessException e) { - throw new ClientNotFoundException(clientId); + throw new ClientNotFoundException(clientId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientTransactionReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientTransactionReadPlatformServiceImpl.java index 1fac79027..1d5e7b25a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientTransactionReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientTransactionReadPlatformServiceImpl.java @@ -174,7 +174,7 @@ public class ClientTransactionReadPlatformServiceImpl implements ClientTransacti final String sql = "select " + this.clientTransactionMapper.schema() + " where c.id = ? and tr.id= ?"; return this.jdbcTemplate.queryForObject(sql, this.clientTransactionMapper, new Object[] { clientId, transactionId }); } catch (final EmptyResultDataAccessException e) { - throw new ClientTransactionNotFoundException(clientId, transactionId); + throw new ClientTransactionNotFoundException(clientId, transactionId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index 603d67d06..8b3e14454 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -191,7 +191,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); LOG.error("Error occured.", throwable); throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralNotFoundException.java index 3c134bfc6..6df363f54 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.collateral.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when guarantor resources are not found. @@ -33,4 +34,9 @@ public class CollateralNotFoundException extends AbstractPlatformResourceNotFoun public CollateralNotFoundException(final Long id) { super("error.msg.loan.collateral.id.invalid", "Loan collateral with identifier " + id + " does not exist", id); } + + public CollateralNotFoundException(Long loanId, Long collateralId, EmptyResultDataAccessException e) { + super("error.msg.loan.collateral.", "Collateral with Id " + collateralId + " does not exist for loan with Id " + loanId, loanId, + collateralId, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralReadPlatformServiceImpl.java index 618148f1b..cf98a6ce5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralReadPlatformServiceImpl.java @@ -109,7 +109,7 @@ public class CollateralReadPlatformServiceImpl implements CollateralReadPlatform sql += " where lc.loan_id=? and lc.id = ?"; return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanId, collateralId }); } catch (final EmptyResultDataAccessException e) { - throw new CollateralNotFoundException(loanId, collateralId); + throw new CollateralNotFoundException(loanId, collateralId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/exception/FloatingRateNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/exception/FloatingRateNotFoundException.java index 525448804..8088546fd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/exception/FloatingRateNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/exception/FloatingRateNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.floatingrates.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class FloatingRateNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -29,4 +30,12 @@ public class FloatingRateNotFoundException extends AbstractPlatformResourceNotFo public FloatingRateNotFoundException(final String globalisationMessageCode) { super(globalisationMessageCode, "Floating Rate does not exist"); } + + public FloatingRateNotFoundException(String globalisationMessageCode, EmptyResultDataAccessException e) { + super(globalisationMessageCode, "Floating Rate does not exist", e); + } + + public FloatingRateNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.floatingrate.id.invalid", "Floating Rate with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRatesReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRatesReadPlatformServiceImpl.java index 76749c2e2..5cecb9a15 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRatesReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRatesReadPlatformServiceImpl.java @@ -74,7 +74,7 @@ public class FloatingRatesReadPlatformServiceImpl implements FloatingRatesReadPl final String sql = "select " + rateMapper.schema() + " where rate.id = ?"; return this.jdbcTemplate.queryForObject(sql, rateMapper, new Object[] { floatingRateId }); } catch (final EmptyResultDataAccessException e) { - throw new FloatingRateNotFoundException(floatingRateId); + throw new FloatingRateNotFoundException(floatingRateId, e); } } @@ -84,7 +84,7 @@ public class FloatingRatesReadPlatformServiceImpl implements FloatingRatesReadPl FloatingInterestRatePeriodRowMapper mapper = new FloatingInterestRatePeriodRowMapper(); return this.jdbcTemplate.query(mapper.schema(), mapper, new Object[] { productId }); } catch (final EmptyResultDataAccessException e) { - throw new FloatingRateNotFoundException("error.msg.floatingrate.not.found.for.product"); + throw new FloatingRateNotFoundException("error.msg.floatingrate.not.found.for.product", e); } } @@ -95,7 +95,7 @@ public class FloatingRatesReadPlatformServiceImpl implements FloatingRatesReadPl final String sql = "select " + rateMapper.schema() + " where rate.is_base_lending_rate = 1 and rate.is_active = 1"; return this.jdbcTemplate.queryForObject(sql, rateMapper); } catch (final EmptyResultDataAccessException e) { - throw new FloatingRateNotFoundException("error.msg.floatingrate.base.lending.rate.not.found"); + throw new FloatingRateNotFoundException("error.msg.floatingrate.base.lending.rate.not.found", e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/exception/FundNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/exception/FundNotFoundException.java index a2c27f746..ef5343ed6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/exception/FundNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/exception/FundNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.fund.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when fund resources are not found. @@ -28,4 +29,8 @@ public class FundNotFoundException extends AbstractPlatformResourceNotFoundExcep public FundNotFoundException(final Long id) { super("error.msg.fund.id.invalid", "Fund with identifier " + id + " does not exist", id); } + + public FundNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.fund.id.invalid", "Fund with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundReadPlatformServiceImpl.java index 1dd6bfd37..44251bb50 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundReadPlatformServiceImpl.java @@ -86,7 +86,7 @@ public class FundReadPlatformServiceImpl implements FundReadPlatformService { return selectedFund; } catch (final EmptyResultDataAccessException e) { - throw new FundNotFoundException(fundId); + throw new FundNotFoundException(fundId, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/CenterNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/CenterNotFoundException.java index 31a23bc5a..594974671 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/CenterNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/CenterNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.group.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when group resources are not found. @@ -29,4 +30,8 @@ public class CenterNotFoundException extends AbstractPlatformResourceNotFoundExc super("error.msg.center.id.invalid", "Center with identifier " + id + " does not exist", id); } + public CenterNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.center.id.invalid", "Center with identifier " + id + " does not exist", id, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupNotFoundException.java index a72d5d5d9..e86d0fe40 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.group.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when group resources are not found. @@ -29,4 +30,8 @@ public class GroupNotFoundException extends AbstractPlatformResourceNotFoundExce super("error.msg.group.id.invalid", "Group with identifier " + id + " does not exist", id); } + public GroupNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.group.id.invalid", "Group with identifier " + id + " does not exist", id, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupRoleNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupRoleNotFoundException.java index 06a097553..8541155b4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupRoleNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/exception/GroupRoleNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.group.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class GroupRoleNotFoundException extends AbstractPlatformResourceNotFoundException { public GroupRoleNotFoundException(final Long id) { super("error.msg.group.role.id.invalid", "Group Role with identifier " + id + " does not exist", id); } + + public GroupRoleNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.group.role.id.invalid", "Group Role with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java index ac5494098..0a0912a16 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java @@ -509,7 +509,7 @@ public class CenterReadPlatformServiceImpl implements CenterReadPlatformService return this.jdbcTemplate.queryForObject(sql, this.centerMapper, new Object[] { centerId, hierarchySearchString }); } catch (final EmptyResultDataAccessException e) { - throw new CenterNotFoundException(centerId); + throw new CenterNotFoundException(centerId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java index a50f0dcda..1ab747b47 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java @@ -278,7 +278,7 @@ public class GroupReadPlatformServiceImpl implements GroupReadPlatformService { final String sql = "select " + this.allGroupTypesDataMapper.schema() + " where g.id = ? and o.hierarchy like ?"; return this.jdbcTemplate.queryForObject(sql, this.allGroupTypesDataMapper, new Object[] { groupId, hierarchySearchString }); } catch (final EmptyResultDataAccessException e) { - throw new GroupNotFoundException(groupId); + throw new GroupNotFoundException(groupId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesReadPlatformServiceImpl.java index d9c2a4281..72e338f1c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesReadPlatformServiceImpl.java @@ -61,7 +61,7 @@ public class GroupRolesReadPlatformServiceImpl implements GroupRolesReadPlatform final String sql = "Select " + mapper.schema() + " where role.group_id=? and role.id=?"; return this.jdbcTemplate.queryForObject(sql, mapper, new Object[] { groupId, roleId }); } catch (final EmptyResultDataAccessException e) { - throw new GroupRoleNotFoundException(roleId); + throw new GroupRoleNotFoundException(roleId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java index 3d221d24c..8134e5c4a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java @@ -604,7 +604,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); LOG.error("Error occured.", throwable); throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/exception/InterestRateChartNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/exception/InterestRateChartNotFoundException.java index 16f8950be..24684ab00 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/exception/InterestRateChartNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/exception/InterestRateChartNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.interestratechart.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class InterestRateChartNotFoundException extends AbstractPlatformResourceNotFoundException { public InterestRateChartNotFoundException(final Long id) { super("error.msg.interest.rate.chart.id.invalid", "Interest rate chart with identifier " + id + " does not exist", id); } + + public InterestRateChartNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.interest.rate.chart.id.invalid", "Interest rate chart with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java index 1bc04dbe0..0e01bbf76 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java @@ -78,7 +78,7 @@ public class InterestRateChartReadPlatformServiceImpl implements InterestRateCha final String sql = "select " + this.chartRowMapper.schema() + " where irc.id = ?"; return this.jdbcTemplate.queryForObject(sql, this.chartRowMapper, new Object[] { chartId }); } catch (final EmptyResultDataAccessException e) { - throw new InterestRateChartNotFoundException(chartId); + throw new InterestRateChartNotFoundException(chartId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java index 41d244fdc..8eaa64c51 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java @@ -242,7 +242,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } @@ -265,7 +265,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } @@ -289,7 +289,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } @@ -517,7 +517,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService { this.loanAccrualPlatformService.addPeriodicAccruals(accruedTill, loanScheduleAccrualDatas); } catch (MultiException e) { String globalisationMessageCode = "error.msg.accrual.exception"; - throw new GeneralPlatformDomainRuleException(globalisationMessageCode, e.getMessage()); + throw new GeneralPlatformDomainRuleException(globalisationMessageCode, e.getMessage(), e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanNotFoundException.java index 85607958a..f9b0f01d5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when loan resources are not found. @@ -28,4 +29,8 @@ public class LoanNotFoundException extends AbstractPlatformResourceNotFoundExcep public LoanNotFoundException(final Long id) { super("error.msg.loan.id.invalid", "Loan with identifier " + id + " does not exist", id); } + + public LoanNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.loan.id.invalid", "Loan with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java index eb373fd9c..c0a3b1855 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.loanaccount.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when loan resources are not found. @@ -33,4 +34,8 @@ public class LoanTransactionNotFoundException extends AbstractPlatformResourceNo super("error.msg.loan.id.invalid", "Transaction with identifier " + id + " does not exist for loan with identifier " + loanId + ".", id, loanId); } + + public LoanTransactionNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.loan.id.invalid", "Transaction with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java index e758072e7..8d0232089 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java @@ -283,7 +283,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService { baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(GuarantorConstants.GUARANTOR_INSUFFICIENT_BALANCE_ERROR, accountTransferDTO.getFromAccountId(), accountTransferDTO.getToAccountId()); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleHistoryReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleHistoryReadPlatformServiceImpl.java index 8c6694575..8598fce6e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleHistoryReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleHistoryReadPlatformServiceImpl.java @@ -81,7 +81,7 @@ public class LoanScheduleHistoryReadPlatformServiceImpl implements LoanScheduleH return this.jdbcTemplate.query(sql, fullResultsetExtractor, new Object[] { loanId, versionNumber }); } catch (final EmptyResultDataAccessException e) { - throw new LoanNotFoundException(loanId); + throw new LoanNotFoundException(loanId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java index a9c0e4dba..bba3f3589 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java @@ -516,7 +516,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java index 962e16b36..e3fa01dce 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -1694,7 +1694,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index ee937c4d2..325e69b4a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -214,7 +214,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { return this.jdbcTemplate.queryForObject(sqlBuilder.toString(), rm, new Object[] { loanId, hierarchySearchString, hierarchySearchString }); } catch (final EmptyResultDataAccessException e) { - throw new LoanNotFoundException(loanId); + throw new LoanNotFoundException(loanId, e); } } @@ -260,7 +260,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { return this.jdbcTemplate.query(sql, fullResultsetExtractor, new Object[] { loanId }); } catch (final EmptyResultDataAccessException e) { - throw new LoanNotFoundException(loanId); + throw new LoanNotFoundException(loanId, e); } } @@ -549,7 +549,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { final String sql = "select " + rm.loanPaymentsSchema() + " where l.id = ? and tr.id = ? "; return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanId, transactionId }); } catch (final EmptyResultDataAccessException e) { - throw new LoanTransactionNotFoundException(transactionId); + throw new LoanTransactionNotFoundException(transactionId, e); } } @@ -2246,7 +2246,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { final String sql = "select loan.account_no from m_loan loan where loan.id = ?"; return this.jdbcTemplate.queryForObject(sql, new Object[] { accountId }, String.class); } catch (final EmptyResultDataAccessException e) { - throw new LoanNotFoundException(accountId); + throw new LoanNotFoundException(accountId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index b856926a5..f394ee9c4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -602,7 +602,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } @@ -625,7 +625,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/LoanProductNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/LoanProductNotFoundException.java index aa004c128..13b6ff69e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/LoanProductNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/exception/LoanProductNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.loanproduct.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when loan product resources are not found. @@ -28,4 +29,8 @@ public class LoanProductNotFoundException extends AbstractPlatformResourceNotFou public LoanProductNotFoundException(final Long id) { super("error.msg.loanproduct.id.invalid", "Loan product with identifier " + id + " does not exist", id); } + + public LoanProductNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.loanproduct.id.invalid", "Loan product with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java index 26610606f..2fc2bd47a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/exception/ProductMixNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.loanproduct.productmix.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when no product mixes found with the productId. @@ -29,4 +30,8 @@ public class ProductMixNotFoundException extends AbstractPlatformResourceNotFoun super("error.msg.no.product.mixes.exists", "No product mixes are defined with the productId `" + productId + "`.", productId); } + public ProductMixNotFoundException(Long productId, EmptyResultDataAccessException e) { + super("error.msg.no.product.mixes.exists", "No product mixes are defined with the productId `" + productId + "`.", productId, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java index b34da0959..5ea0c0009 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java @@ -66,7 +66,7 @@ public class ProductMixReadPlatformServiceImpl implements ProductMixReadPlatform return productMixData.get(productId); } catch (final EmptyResultDataAccessException e) { - throw new ProductMixNotFoundException(productId); + throw new ProductMixNotFoundException(productId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java index f4acbe60c..d646cabdb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java @@ -85,7 +85,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanProductId }); } catch (final EmptyResultDataAccessException e) { - throw new LoanProductNotFoundException(loanProductId); + throw new LoanProductNotFoundException(loanProductId, e); } } @@ -638,7 +638,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanProductId }); } catch (final EmptyResultDataAccessException e) { - throw new LoanProductNotFoundException(loanProductId); + throw new LoanProductNotFoundException(loanProductId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index a4c1a5e87..fcbae8ff4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -345,26 +345,25 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro final String externalId = command.stringValueOfParameterNamed("externalId"); throw new PlatformDataIntegrityException("error.msg.product.loan.duplicate.externalId", - "Loan Product with externalId `" + externalId + "` already exists", "externalId", externalId); + "Loan Product with externalId `" + externalId + "` already exists", "externalId", externalId, realCause); } else if (realCause.getMessage().contains("'unq_name'")) { final String name = command.stringValueOfParameterNamed("name"); throw new PlatformDataIntegrityException("error.msg.product.loan.duplicate.name", - "Loan product with name `" + name + "` already exists", "name", name); + "Loan product with name `" + name + "` already exists", "name", name, realCause); } else if (realCause.getMessage().contains("'unq_short_name'")) { final String shortName = command.stringValueOfParameterNamed("shortName"); throw new PlatformDataIntegrityException("error.msg.product.loan.duplicate.short.name", - "Loan product with short name `" + shortName + "` already exists", "shortName", shortName); + "Loan product with short name `" + shortName + "` already exists", "shortName", shortName, realCause); } else if (realCause.getMessage().contains("Duplicate entry")) { - final Object[] args = null; throw new PlatformDataIntegrityException("error.msg.product.loan.duplicate.charge", - "Loan product may only have one charge of each type.`", "charges", args); + "Loan product may only have one charge of each type.`", "charges", realCause); } logAsErrorUnexpectedDataIntegrityException(dve); throw new PlatformDataIntegrityException("error.msg.product.loan.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", realCause); } private void validateInputDates(final JsonCommand command) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotFoundException.java index 3609795b5..9f0ca4d0a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/exception/MeetingNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.meeting.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when Meeting resources are not found. @@ -28,4 +29,8 @@ public class MeetingNotFoundException extends AbstractPlatformResourceNotFoundEx public MeetingNotFoundException(final Long id) { super("error.msg.meeting.id.invalid", "Meeting with identifier " + id + " does not exist", id); } + + public MeetingNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.meeting.id.invalid", "Meeting with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingReadPlatformServiceImpl.java index 630bc1efd..abd257cd5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/service/MeetingReadPlatformServiceImpl.java @@ -72,7 +72,7 @@ public class MeetingReadPlatformServiceImpl implements MeetingReadPlatformServic return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { meetingId, entityId, entityTypeId }); } catch (final EmptyResultDataAccessException e) { - throw new MeetingNotFoundException(meetingId); + throw new MeetingNotFoundException(meetingId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/exception/NoteNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/exception/NoteNotFoundException.java index c6e1f83c3..36a3a6a7c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/exception/NoteNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/exception/NoteNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.note.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when note resources are not found. @@ -34,4 +35,9 @@ public class NoteNotFoundException extends AbstractPlatformResourceNotFoundExcep "Note with identifier " + id + " does not exist for " + resource + " with identifier " + resourceId, id, resourceId); } + public NoteNotFoundException(Long id, Long resourceId, String resource, EmptyResultDataAccessException e) { + super("error.msg." + resource + ".note.id.invalid", + "Note with identifier " + id + " does not exist for " + resource + " with identifier " + resourceId, id, resourceId, e); + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteReadPlatformServiceImpl.java index 0fd2b010d..3fc382ca5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteReadPlatformServiceImpl.java @@ -98,7 +98,7 @@ public class NoteReadPlatformServiceImpl implements NoteReadPlatformService { return this.jdbcTemplate.queryForObject(sql, rm, paramList.toArray()); } catch (final EmptyResultDataAccessException e) { - throw new NoteNotFoundException(noteId, resourceId, noteType.name().toLowerCase()); + throw new NoteNotFoundException(noteId, resourceId, noteType.name().toLowerCase(), e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java index 64ec8fb52..175186c80 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/api/ProductsApiResource.java @@ -91,7 +91,7 @@ public class ProductsApiResource { final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); return this.toApiJsonSerializer.serialize(settings, data, service.getResponseDataParams()); } catch (BeansException e) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(e); } } @@ -112,7 +112,7 @@ public class ProductsApiResource { ProductData data = service.retrieveOne(productId, settings.isTemplate()); return this.toApiJsonSerializer.serialize(settings, data, service.getResponseDataParams()); } catch (BeansException e) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(e); } } @@ -133,7 +133,7 @@ public class ProductsApiResource { final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); return this.toApiJsonSerializer.serialize(settings, data, service.getResponseDataParams()); } catch (BeansException e) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ProductNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ProductNotFoundException.java index 233be65bc..0bfaf634e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ProductNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ProductNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.products.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when loan product resources are not found. @@ -28,4 +29,8 @@ public class ProductNotFoundException extends AbstractPlatformResourceNotFoundEx public ProductNotFoundException(final Long id, String type) { super("error.msg.product.id.invalid", type + " product with identifier " + id + " does not exist", id); } + + public ProductNotFoundException(Long id, String type, EmptyResultDataAccessException e) { + super("error.msg.product.id.invalid", type + " product with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ResourceNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ResourceNotFoundException.java index 4dfce9d00..1c7577229 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ResourceNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/products/exception/ResourceNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.products.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.beans.BeansException; public class ResourceNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -29,4 +30,8 @@ public class ResourceNotFoundException extends AbstractPlatformResourceNotFoundE public ResourceNotFoundException() { super("", "", ""); } + + public ResourceNotFoundException(BeansException e) { + super("", "", "", e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java index 9912bfa1c..625e0d1be 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java @@ -20,6 +20,7 @@ package org.apache.fineract.portfolio.rate.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class RateNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -31,4 +32,11 @@ public class RateNotFoundException extends AbstractPlatformResourceNotFoundExcep super("error.msg.rate.id.invalid", "Rate with name " + name + " does not exist", name); } + public RateNotFoundException(String name, EmptyResultDataAccessException e) { + super("error.msg.rate.id.invalid", "Rate with name " + name + " does not exist", name, e); + } + + public RateNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.rate.id.invalid", "Rate with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java index 38c8c39a9..916bfa986 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java @@ -70,7 +70,7 @@ public class RateReadServiceImpl implements RateReadService { return selectedRate; } catch (final EmptyResultDataAccessException e) { - throw new RateNotFoundException(rateId); + throw new RateNotFoundException(rateId, e); } } @@ -84,7 +84,7 @@ public class RateReadServiceImpl implements RateReadService { return selectedRate; } catch (final EmptyResultDataAccessException e) { - throw new RateNotFoundException(name); + throw new RateNotFoundException(name, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountTransactionsApiResource.java index 133abea77..87211b0d9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountTransactionsApiResource.java @@ -160,10 +160,11 @@ public class SavingsAccountTransactionsApiResource { return this.toApiJsonSerializer.serialize(result); } catch (ObjectOptimisticLockingFailureException lockingFailureException) { throw new PlatformDataIntegrityException("error.msg.savings.concurrent.operations", - "Concurrent Transactions being made on this savings account: " + lockingFailureException.getMessage()); + "Concurrent Transactions being made on this savings account: " + lockingFailureException.getMessage(), + lockingFailureException); } catch (CannotAcquireLockException cannotAcquireLockException) { throw new PlatformDataIntegrityException("error.msg.savings.concurrent.operations.unable.to.acquire.lock", - "Unable to acquir lock for this transaction: " + cannotAcquireLockException.getMessage()); + "Unable to acquir lock for this transaction: " + cannotAcquireLockException.getMessage(), cannotAcquireLockException); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountInterestRateChartNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountInterestRateChartNotFoundException.java index c6a67404e..80b8fbe57 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountInterestRateChartNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountInterestRateChartNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class DepositAccountInterestRateChartNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -26,4 +27,9 @@ public class DepositAccountInterestRateChartNotFoundException extends AbstractPl super("error.msg.deposit.account.interest.rate.chart.id.invalid", "Deposit Account Interest rate chart with identifier " + id + " does not exist", id); } + + public DepositAccountInterestRateChartNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.deposit.account.interest.rate.chart.id.invalid", + "Deposit Account Interest rate chart with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountNotFoundException.java index 786af8cc2..4ce0ad800 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/DepositAccountNotFoundException.java @@ -21,6 +21,7 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.commons.lang3.StringUtils; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; import org.apache.fineract.portfolio.savings.DepositAccountType; +import org.springframework.dao.EmptyResultDataAccessException; public class DepositAccountNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -28,4 +29,9 @@ public class DepositAccountNotFoundException extends AbstractPlatformResourceNot super("error.msg." + accountType.getCode().toLowerCase() + ".id.invalid", StringUtils.capitalize(accountType.toString().toLowerCase()) + " account with identifier " + id + " does not exist", id); } + + public DepositAccountNotFoundException(DepositAccountType accountType, Long id, EmptyResultDataAccessException e) { + super("error.msg." + accountType.getCode().toLowerCase() + ".id.invalid", + StringUtils.capitalize(accountType.toString().toLowerCase()) + " account with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/FixedDepositProductNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/FixedDepositProductNotFoundException.java index 4381e3ef5..a81cdd4ec 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/FixedDepositProductNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/FixedDepositProductNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class FixedDepositProductNotFoundException extends AbstractPlatformResourceNotFoundException { public FixedDepositProductNotFoundException(final Long id) { super("error.msg.fixeddepositproduct.id.invalid", "Fixed deposit product with identifier " + id + " does not exist", id); } + + public FixedDepositProductNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.fixeddepositproduct.id.invalid", "Fixed deposit product with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountNotFoundException.java index 6f12b08c0..268f14dcd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class SavingsAccountNotFoundException extends AbstractPlatformResourceNotFoundException { @@ -30,4 +31,8 @@ public class SavingsAccountNotFoundException extends AbstractPlatformResourceNot super("error.msg.saving.account.id.invalid", "Savings account with external identifier " + externalId + " does not exist", externalId); } + + public SavingsAccountNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.saving.account.id.invalid", "Savings account with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsProductNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsProductNotFoundException.java index 0a2658a91..2d86227d4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsProductNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsProductNotFoundException.java @@ -19,10 +19,15 @@ package org.apache.fineract.portfolio.savings.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; public class SavingsProductNotFoundException extends AbstractPlatformResourceNotFoundException { public SavingsProductNotFoundException(final Long id) { super("error.msg.savingproduct.id.invalid", "Saving product with identifier " + id + " does not exist", id); } + + public SavingsProductNotFoundException(Long id, EmptyResultDataAccessException e) { + super("error.msg.savingproduct.id.invalid", "Saving product with identifier " + id + " does not exist", id, e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java index 56b5b3ca6..03442cc8a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountInterestRateChartReadPlatformServiceImpl.java @@ -82,7 +82,7 @@ public class DepositAccountInterestRateChartReadPlatformServiceImpl implements D final String sql = "select " + this.chartRowMapper.schema() + " where irc.id = ? "; return this.jdbcTemplate.queryForObject(sql, this.chartRowMapper, new Object[] { chartId }); } catch (final EmptyResultDataAccessException e) { - throw new DepositAccountInterestRateChartNotFoundException(chartId); + throw new DepositAccountInterestRateChartNotFoundException(chartId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java index 69b5864be..c2b0aacf2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java @@ -249,7 +249,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead new Object[] { accountId, depositAccountType.getValue() }); } catch (final EmptyResultDataAccessException e) { - throw new DepositAccountNotFoundException(depositAccountType, accountId); + throw new DepositAccountNotFoundException(depositAccountType, accountId, e); } } @@ -286,7 +286,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead return account; } catch (final EmptyResultDataAccessException e) { - throw new DepositAccountNotFoundException(depositAccountType, accountId); + throw new DepositAccountNotFoundException(depositAccountType, accountId, e); } } @@ -498,7 +498,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead return this.jdbcTemplate.queryForObject(sql, this.rdTransactionTemplateMapper, new Object[] { accountId, accountId, DepositAccountType.RECURRING_DEPOSIT.getValue() }); } catch (final EmptyResultDataAccessException e) { - throw new DepositAccountNotFoundException(DepositAccountType.RECURRING_DEPOSIT, accountId); + throw new DepositAccountNotFoundException(DepositAccountType.RECURRING_DEPOSIT, accountId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java index f44046308..e6822a47a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositProductReadPlatformServiceImpl.java @@ -108,7 +108,7 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead new Object[] { fixedDepositProductId, depositAccountType.getValue() }); } catch (final EmptyResultDataAccessException e) { - throw new FixedDepositProductNotFoundException(fixedDepositProductId); + throw new FixedDepositProductNotFoundException(fixedDepositProductId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountChargeReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountChargeReadPlatformServiceImpl.java index 2f6a2c486..cf4bd2bb7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountChargeReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountChargeReadPlatformServiceImpl.java @@ -180,7 +180,7 @@ public class SavingsAccountChargeReadPlatformServiceImpl implements SavingsAccou return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { id, savingsAccountId }); } catch (final EmptyResultDataAccessException e) { - throw new SavingsAccountChargeNotFoundException(savingsAccountId); + throw new SavingsAccountChargeNotFoundException(savingsAccountId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java index 941a48196..018246aaa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java @@ -227,7 +227,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead return this.jdbcTemplate.queryForObject(sql, this.savingAccountMapper, new Object[] { accountId }); } catch (final EmptyResultDataAccessException e) { - throw new SavingsAccountNotFoundException(accountId); + throw new SavingsAccountNotFoundException(accountId, e); } } @@ -738,7 +738,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead return this.jdbcTemplate.queryForObject(sql, this.transactionTemplateMapper, new Object[] { savingsId, depositAccountType.getValue() }); } catch (final EmptyResultDataAccessException e) { - throw new SavingsAccountNotFoundException(savingsId); + throw new SavingsAccountNotFoundException(savingsId, e); } } @@ -1203,7 +1203,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead return this.jdbcTemplate.queryForObject(buff.toString(), new Object[] { accountId, clientId, depositAccountType.getValue(), currencyCode }, Integer.class) > 0; } catch (final EmptyResultDataAccessException e) { - throw new SavingsAccountNotFoundException(accountId); + throw new SavingsAccountNotFoundException(accountId, e); } } /* @@ -1235,7 +1235,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead final String sql = "select s.account_no from m_savings_account s where s.id = ?"; return this.jdbcTemplate.queryForObject(sql, new Object[] { accountId }, String.class); } catch (final EmptyResultDataAccessException e) { - throw new SavingsAccountNotFoundException(accountId); + throw new SavingsAccountNotFoundException(accountId, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java index caf8b0d9b..1ad34a1df 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java @@ -100,7 +100,7 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead return this.jdbcTemplate.queryForObject(sql, this.savingsProductRowMapper, new Object[] { savingProductId, DepositAccountType.SAVINGS_DEPOSIT.getValue() }); } catch (final EmptyResultDataAccessException e) { - throw new SavingsProductNotFoundException(savingProductId); + throw new SavingsProductNotFoundException(savingProductId, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountReadPlatformServiceImpl.java index ca2b14b1c..75a9daa4e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountReadPlatformServiceImpl.java @@ -511,7 +511,7 @@ public class ShareAccountReadPlatformServiceImpl implements ShareAccountReadPlat final String sql = "select s.account_no from m_share_account s where s.id = ?"; return this.jdbcTemplate.queryForObject(sql, new Object[] { accountId }, String.class); } catch (final EmptyResultDataAccessException e) { - throw new ShareAccountNotFoundException(accountId); + throw new ShareAccountNotFoundException(accountId, e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java index 72da3936c..b02780578 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java @@ -137,7 +137,7 @@ public class ShareProductReadPlatformServiceImpl implements ProductReadPlatformS } return data; } catch (final EmptyResultDataAccessException e) { - throw new ProductNotFoundException(productId, "share"); + throw new ProductNotFoundException(productId, "share", e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PasswordValidationPolicyNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PasswordValidationPolicyNotFoundException.java index 77f52493e..a2e608753 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PasswordValidationPolicyNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/PasswordValidationPolicyNotFoundException.java @@ -19,6 +19,7 @@ package org.apache.fineract.useradministration.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; +import org.springframework.dao.EmptyResultDataAccessException; /** * A {@link RuntimeException} thrown when role resources are not found. @@ -33,4 +34,8 @@ public class PasswordValidationPolicyNotFoundException extends AbstractPlatformR public PasswordValidationPolicyNotFoundException() { super("error.msg.password.validation.policy.not.found", "An active password validation policy was not found"); } + + public PasswordValidationPolicyNotFoundException(EmptyResultDataAccessException e) { + super("error.msg.password.validation.policy.not.found", "An active password validation policy was not found", e); + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java index f360dbdc8..368b55fe5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java @@ -177,7 +177,7 @@ public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWrit dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", - dataValidationErrors); + dataValidationErrors, e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java index 280da8a33..fdc270022 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java @@ -92,7 +92,7 @@ public class PasswordPreferencesWritePlatformServiceJpaRepositoryImpl implements } catch (final DataIntegrityViolationException dve) { LOG.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.password.validation.policy.unknown.data.integrity.issue", - "Unknown data integrity issue with resource."); + "Unknown data integrity issue with resource.", dve); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordValidationPolicyReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordValidationPolicyReadPlatformServiceImpl.java index a8f540572..ee30fc55d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordValidationPolicyReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordValidationPolicyReadPlatformServiceImpl.java @@ -56,7 +56,7 @@ public class PasswordValidationPolicyReadPlatformServiceImpl implements Password final String sql = "select " + this.passwordValidationPolicyMapper.schema() + " where pvp.active = true"; return this.jdbcTemplate.queryForObject(sql, this.passwordValidationPolicyMapper); } catch (final EmptyResultDataAccessException e) { - throw new PasswordValidationPolicyNotFoundException(); + throw new PasswordValidationPolicyNotFoundException(e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java index 10086e34f..3a637f691 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java @@ -235,7 +235,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf return new CommandProcessingResultBuilder().withEntityId(roleId).build(); } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } } @@ -269,7 +269,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } } @@ -292,7 +292,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf } catch (final DataIntegrityViolationException e) { throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + e.getMostSpecificCause()); + "Unknown data integrity issue with resource: " + e.getMostSpecificCause(), e); } } } From da978a37aa82ea0af1bef634368b032875d33f6a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 29 Jun 2020 20:24:31 +0000 Subject: [PATCH 030/131] Update dependency com.puppycrawl.tools:checkstyle to v8.34 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 10da8eeaf..08fa5dc73 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -701,7 +701,7 @@ configurations { } dependencies { driver 'org.drizzle.jdbc:drizzle-jdbc:1.4' - checkstyle 'com.puppycrawl.tools:checkstyle:8.33' + checkstyle 'com.puppycrawl.tools:checkstyle:8.34' checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.37.1' } From 7d2c3ec417565a42c2d6c8465c92e35bcd2bf7ce Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Fri, 26 Jun 2020 14:28:26 +0300 Subject: [PATCH 031/131] FINERACT-1022: Fixing ehcache 3 --- fineract-provider/dependencies.gradle | 7 ++- .../basicauth/application.properties | 1 - .../twofactor/application.properties | 1 - .../RuntimeDelegatingCacheManager.java | 8 +++ .../domain/ClientAddressRepository.java | 4 +- .../main/resources/META-INF/spring/cache.xml | 2 +- .../resources/META-INF/spring/ehcache.xml | 53 +++++++++---------- 7 files changed, 41 insertions(+), 35 deletions(-) diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 3fa3e44ab..85829ed63 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -72,6 +72,7 @@ dependencies { // JAX-B dependencies for JDK 9+ 'jakarta.xml.bind:jakarta.xml.bind-api', + 'org.dom4j:dom4j', 'javax.cache:cache-api', @@ -98,8 +99,9 @@ dependencies { implementation ('org.mnode.ical4j:ical4j') { exclude group: 'commons-logging' } - implementation ('org.ehcache:ehcache') { - exclude group: 'org.glassfish.jaxb', module: 'jaxb-runtime' + + runtimeOnly('org.ehcache:ehcache') { + exclude group: 'com.sun.activation' } // runtimeOnly dependencies are things that Fineract code has no direct compile time dependency on, but which must be present at run-time @@ -129,6 +131,7 @@ dependencies { testImplementation ('io.rest-assured:rest-assured') { exclude group: 'commons-logging' exclude group: 'org.apache.sling' + exclude group: 'com.sun.xml.bind' } testImplementation ('org.springframework.boot:spring-boot-starter-test') { exclude group: 'com.jayway.jsonpath', module: 'json-path' diff --git a/fineract-provider/properties/basicauth/application.properties b/fineract-provider/properties/basicauth/application.properties index 406e6b70d..64e5421f6 100644 --- a/fineract-provider/properties/basicauth/application.properties +++ b/fineract-provider/properties/basicauth/application.properties @@ -25,4 +25,3 @@ management.info.git.mode=FULL # FINERACT-914 server.forward-headers-strategy=framework -spring.cache.jcache.config=classpath:/META-INF/spring/ehcache.xml diff --git a/fineract-provider/properties/basicauth/twofactor/application.properties b/fineract-provider/properties/basicauth/twofactor/application.properties index 43cb20bba..a9b13cc5e 100644 --- a/fineract-provider/properties/basicauth/twofactor/application.properties +++ b/fineract-provider/properties/basicauth/twofactor/application.properties @@ -26,4 +26,3 @@ management.info.git.mode=FULL # FINERACT-914 server.forward-headers-strategy=framework -spring.cache.jcache.config=classpath:/META-INF/spring/ehcache.xml diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java index 5ab511d5d..af9e412d1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java @@ -27,6 +27,8 @@ import org.apache.fineract.infrastructure.cache.CacheEnumerations; import org.apache.fineract.infrastructure.cache.data.CacheData; import org.apache.fineract.infrastructure.cache.domain.CacheType; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -43,6 +45,8 @@ import org.springframework.stereotype.Component; @Component(value = "runtimeDelegatingCacheManager") public class RuntimeDelegatingCacheManager implements CacheManager { + private static final Logger LOG = LoggerFactory.getLogger(RuntimeDelegatingCacheManager.class); + private final JCacheCacheManager jcacheCacheManager; private final CacheManager noOpCacheManager = new NoOpCacheManager(); private CacheManager currentCacheManager; @@ -106,6 +110,10 @@ public class RuntimeDelegatingCacheManager implements CacheManager { clearEhCache(); } this.currentCacheManager = this.jcacheCacheManager; + + if (this.currentCacheManager.getCacheNames().size() == 0) { + LOG.error("No caches configured for activated CacheManager {}", this.currentCacheManager); + } break; case MULTI_NODE: if (!distributedCacheEnabled) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java index 478d8ed92..1efc1e9ad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java @@ -27,8 +27,8 @@ import org.springframework.data.repository.query.Param; public interface ClientAddressRepository extends JpaRepository, JpaSpecificationExecutor { @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id = :clientId AND clientAddress.addressType = :addressType AND clientAddress.isActive = :isActive ") - ClientAddress findByClientIdAndAddressTypeAndIsActive(@Param("clientId") final long clientId, final CodeValue addressType, - @Param("isActive") final boolean isActive); + ClientAddress findByClientIdAndAddressTypeAndIsActive(@Param("clientId") final long clientId, + @Param("addressType") final CodeValue addressType, @Param("isActive") final boolean isActive); @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id = :clientId AND clientAddress.address.id = :addressId ") ClientAddress findByClientIdAndAddressId(@Param("clientId") final long clientId, @Param("addressId") final long addressId); diff --git a/fineract-provider/src/main/resources/META-INF/spring/cache.xml b/fineract-provider/src/main/resources/META-INF/spring/cache.xml index 6cc2361ae..9a2cf89bc 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/cache.xml +++ b/fineract-provider/src/main/resources/META-INF/spring/cache.xml @@ -34,6 +34,6 @@ p:cacheManager-ref="ehcacheInstance" /> + class="org.springframework.cache.jcache.JCacheManagerFactoryBean" p:cacheManagerUri="classpath:/META-INF/spring/ehcache.xml"/> diff --git a/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml b/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml index e9fae206c..9c5effda3 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml +++ b/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml @@ -24,33 +24,30 @@ - + + + + + + 10000 + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + 7200 + + From 7a88f14eec0409b339844c5580f3439a6357e035 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Tue, 30 Jun 2020 10:01:51 +0300 Subject: [PATCH 032/131] FINERACT-885: Fixing dates in ClientLoanIntegrationTest to avoid failures end of month --- .../ClientLoanIntegrationTest.java | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) 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 aeb528065..fb103583d 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 @@ -4365,6 +4365,14 @@ public class ClientLoanIntegrationTest { Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant()); fourMonthsfromNowCalendar.add(Calendar.MONTH, -4); + // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that + // many days, then loan payment will get reset to a day of month less than today's day + // and 4th payment will be in the past. In such case, start the loan a few days later, + // so that 4th payment is guaranteed to be in the future. + if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) { + fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4); + } + String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); @@ -4477,7 +4485,9 @@ public class ClientLoanIntegrationTest { // refund 20 means paid: principal 1980, interest 240, fees 50, penalty // 0 - fourMonthsfromNowCalendar.add(Calendar.MONTH, 1); + // FINERACT-885: As loan may not have started exactly four months ago, + // make final payment today and not four months from start (as that may be in the future) + fourMonthsfromNowCalendar.setTime(Utils.getLocalDateOfTenant().toDate()); final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); this.loanTransactionHelper.makeRefundByCash(now, Float.valueOf("20"), loanID); @@ -4526,6 +4536,14 @@ public class ClientLoanIntegrationTest { Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant()); fourMonthsfromNowCalendar.add(Calendar.MONTH, -4); + // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that + // many days, then loan payment will get reset to a day of month less than today's day + // and 4th payment will be in the past. In such case, start the loan a few days later, + // so that 4th payment is guaranteed to be in the future. + if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) { + fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4); + } + String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); @@ -4636,7 +4654,9 @@ public class ClientLoanIntegrationTest { // refund 20 means paid: principal 1980, interest 240, fees 50, penalty // 0 - fourMonthsfromNowCalendar.add(Calendar.MONTH, 1); + // FINERACT-885: As loan may not have started exactly four months ago, + // make final payment today and not four months from start (as that may be in the future) + fourMonthsfromNowCalendar.setTime(Utils.getLocalDateOfTenant().toDate()); final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); this.loanTransactionHelper.makeRefundByCash(now, Float.valueOf("20"), loanID); @@ -4684,6 +4704,14 @@ public class ClientLoanIntegrationTest { Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant()); fourMonthsfromNowCalendar.add(Calendar.MONTH, -4); + // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that + // many days, then loan payment will get reset to a day of month less than today's day + // and 4th payment will be in the past. In such case, start the loan a few days later, + // so that 4th payment is guaranteed to be in the future. + if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) { + fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4); + } + String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec); @@ -4817,7 +4845,9 @@ public class ClientLoanIntegrationTest { Float TRANSFER_AMOUNT = 20f; - fourMonthsfromNowCalendar.add(Calendar.MONTH, 1); + // FINERACT-885: As loan may not have started exactly four months ago, + // make final payment today and not four months from start (as that may be in the future) + fourMonthsfromNowCalendar.setTime(Utils.getLocalDateOfTenant().toDate()); final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); final String FROM_LOAN_ACCOUNT_TYPE = "1"; From 56cad56848446e677a93c3a837043880dbd7e321 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 29 Jun 2020 23:57:25 +0200 Subject: [PATCH 033/131] use AbstractPlatformException as superclass for various exceptions related to FINERACT-942 and as per code review discussion in PR #1079. --- .../AbstractPlatformDomainRuleException.java | 28 ++--------- .../exception/AbstractPlatformException.java | 46 +++++++++++++++++-- ...ractPlatformResourceNotFoundException.java | 23 +--------- ...ctPlatformServiceUnavailableException.java | 28 ++--------- .../GeneralPlatformDomainRuleException.java | 4 +- .../core/exception/InvalidJsonException.java | 6 +-- .../PlatformApiDataValidationException.java | 39 +++++----------- .../PlatformDataIntegrityException.java | 27 ++--------- .../PlatformInternalServerException.java | 25 ++-------- .../PlatformServiceUnavailableException.java | 5 +- 10 files changed, 78 insertions(+), 153 deletions(-) mode change 100755 => 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformServiceUnavailableException.java diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java index 0499488f3..a5510b61c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformDomainRuleException.java @@ -19,30 +19,12 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when valid api request end up violating some domain rule. + * A {@link RuntimeException} thrown when a valid API request ends up violating some domain rule. */ -public abstract class AbstractPlatformDomainRuleException extends RuntimeException { +public abstract class AbstractPlatformDomainRuleException extends AbstractPlatformException { - private final String globalisationMessageCode; - private final String defaultUserMessage; - private final Object[] defaultUserMessageArgs; - - protected AbstractPlatformDomainRuleException(final String globalisationMessageCode, final String defaultUserMessage, - final Object... defaultUserMessageArgs) { - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = defaultUserMessageArgs; - } - - public String getGlobalisationMessageCode() { - return this.globalisationMessageCode; - } - - public String getDefaultUserMessage() { - return this.defaultUserMessage; - } - - public Object[] getDefaultUserMessageArgs() { - return this.defaultUserMessageArgs; + protected AbstractPlatformDomainRuleException(String globalisationMessageCode, String defaultUserMessage, + Object... defaultUserMessageArgs) { + super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java index 8eeb8b53c..9f0420348 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java @@ -21,9 +21,38 @@ package org.apache.fineract.infrastructure.core.exception; import java.util.ArrayList; import java.util.List; -public abstract class AbstractPlatformException { +/** + * Exception with internationalization support (it's message can be translated). + */ +public abstract class AbstractPlatformException extends RuntimeException { - protected static Throwable findThrowableCause(Object[] defaultUserMessageArgs) { + private static final Object[] NO_ARGS = new Object[0]; + + private final String globalisationMessageCode; + private final String defaultUserMessage; + private final Object[] defaultUserMessageArgs; + + protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage, Object[] defaultUserMessageArgs) { + super(findThrowableCause(defaultUserMessageArgs)); + this.globalisationMessageCode = globalisationMessageCode; + this.defaultUserMessage = defaultUserMessage; + this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); + } + + protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage) { + this.globalisationMessageCode = globalisationMessageCode; + this.defaultUserMessage = defaultUserMessage; + this.defaultUserMessageArgs = NO_ARGS; + } + + protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage, Throwable cause) { + super(cause); + this.globalisationMessageCode = globalisationMessageCode; + this.defaultUserMessage = defaultUserMessage; + this.defaultUserMessageArgs = NO_ARGS; + } + + private static Throwable findThrowableCause(Object[] defaultUserMessageArgs) { for (Object defaultUserMessageArg : defaultUserMessageArgs) { if (defaultUserMessageArg instanceof Throwable) { return (Throwable) defaultUserMessageArg; @@ -32,7 +61,7 @@ public abstract class AbstractPlatformException { return null; } - protected static Object[] filterThrowableCause(Object[] defaultUserMessageArgs) { + private static Object[] filterThrowableCause(Object[] defaultUserMessageArgs) { List filteredDefaultUserMessageArgs = new ArrayList<>(defaultUserMessageArgs.length); for (Object defaultUserMessageArg : defaultUserMessageArgs) { if (!(defaultUserMessageArg instanceof Throwable)) { @@ -42,4 +71,15 @@ public abstract class AbstractPlatformException { return filteredDefaultUserMessageArgs.toArray(); } + public final String getGlobalisationMessageCode() { + return this.globalisationMessageCode; + } + + public final String getDefaultUserMessage() { + return this.defaultUserMessage; + } + + public final Object[] getDefaultUserMessageArgs() { + return this.defaultUserMessageArgs; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java index 3c1ecce3a..51d3d57bc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformResourceNotFoundException.java @@ -21,29 +21,10 @@ package org.apache.fineract.infrastructure.core.exception; /** * A {@link RuntimeException} thrown when resources that are queried for are not found. */ -public abstract class AbstractPlatformResourceNotFoundException extends RuntimeException { - - private final String globalisationMessageCode; - private final String defaultUserMessage; - private final Object[] defaultUserMessageArgs; +public abstract class AbstractPlatformResourceNotFoundException extends AbstractPlatformException { protected AbstractPlatformResourceNotFoundException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { - super(AbstractPlatformException.findThrowableCause(defaultUserMessageArgs)); - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); - } - - public String getGlobalisationMessageCode() { - return this.globalisationMessageCode; - } - - public String getDefaultUserMessage() { - return this.defaultUserMessage; - } - - public Object[] getDefaultUserMessageArgs() { - return this.defaultUserMessageArgs; + super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java index bfdba2cfb..0a8e45c45 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformServiceUnavailableException.java @@ -19,30 +19,12 @@ package org.apache.fineract.infrastructure.core.exception; /** - * A {@link RuntimeException} thrown when resources that are queried for are not found. + * A {@link RuntimeException} thrown for cases such as 3rd-party external services that are not available. */ -public abstract class AbstractPlatformServiceUnavailableException extends RuntimeException { +public abstract class AbstractPlatformServiceUnavailableException extends AbstractPlatformException { - private final String globalisationMessageCode; - private final String defaultUserMessage; - private final Object[] defaultUserMessageArgs; - - protected AbstractPlatformServiceUnavailableException(final String globalisationMessageCode, final String defaultUserMessage, - final Object... defaultUserMessageArgs) { - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = defaultUserMessageArgs; - } - - public String getGlobalisationMessageCode() { - return this.globalisationMessageCode; - } - - public String getDefaultUserMessage() { - return this.defaultUserMessage; - } - - public Object[] getDefaultUserMessageArgs() { - return this.defaultUserMessageArgs; + protected AbstractPlatformServiceUnavailableException(String globalisationMessageCode, String defaultUserMessage, + Object... defaultUserMessageArgs) { + super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java index be6574eae..f927cf1ba 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/GeneralPlatformDomainRuleException.java @@ -23,8 +23,8 @@ package org.apache.fineract.infrastructure.core.exception; */ public final class GeneralPlatformDomainRuleException extends AbstractPlatformDomainRuleException { - public GeneralPlatformDomainRuleException(final String globalisationMessageCode, final String defaultUserMessage, - final Object... defaultUserMessageArgs) { + public GeneralPlatformDomainRuleException(String globalisationMessageCode, String defaultUserMessage, + Object... defaultUserMessageArgs) { super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java index 56cc5defb..79eb4fd05 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/InvalidJsonException.java @@ -20,8 +20,6 @@ package org.apache.fineract.infrastructure.core.exception; /** * A {@link RuntimeException} that is thrown in the case where invalid JSON is sent in the body of the request to the - * platform api. + * platform API. */ -public class InvalidJsonException extends RuntimeException { - // -} +public class InvalidJsonException extends RuntimeException {} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java index 14e1baa7b..a0d0fbd5c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformApiDataValidationException.java @@ -24,46 +24,29 @@ import org.apache.fineract.infrastructure.core.data.ApiParameterError; /** * Exception thrown when problem with an API request to the platform. */ -public class PlatformApiDataValidationException extends RuntimeException { +public class PlatformApiDataValidationException extends AbstractPlatformException { - private final String globalisationMessageCode; - private final String defaultUserMessage; private final List errors; - public PlatformApiDataValidationException(final List errors) { - this.globalisationMessageCode = "validation.msg.validation.errors.exist"; - this.defaultUserMessage = "Validation errors exist."; - this.errors = errors; - } - - public PlatformApiDataValidationException(final String globalisationMessageCode, final String defaultUserMessage, - final List errors) { - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; - this.errors = errors; - } - - public PlatformApiDataValidationException(final String globalisationMessageCode, final String defaultUserMessage, - final List errors, Throwable cause) { - super(cause); - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; + public PlatformApiDataValidationException(List errors) { + super("validation.msg.validation.errors.exist", "Validation errors exist."); this.errors = errors; } public PlatformApiDataValidationException(final List errors, Throwable cause) { - super(cause); - this.globalisationMessageCode = "validation.msg.validation.errors.exist"; - this.defaultUserMessage = "Validation errors exist."; + super("validation.msg.validation.errors.exist", "Validation errors exist.", cause); this.errors = errors; } - public String getGlobalisationMessageCode() { - return this.globalisationMessageCode; + public PlatformApiDataValidationException(String globalisationMessageCode, String defaultUserMessage, List errors) { + super(globalisationMessageCode, defaultUserMessage); + this.errors = errors; } - public String getDefaultUserMessage() { - return this.defaultUserMessage; + public PlatformApiDataValidationException(String globalisationMessageCode, String defaultUserMessage, List errors, + Throwable cause) { + super(globalisationMessageCode, defaultUserMessage, cause); + this.errors = errors; } public List getErrors() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java index 1ec8f015f..c18c345f7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformDataIntegrityException.java @@ -21,41 +21,20 @@ package org.apache.fineract.infrastructure.core.exception; /** * A {@link RuntimeException} thrown when data integrity problems happen due to state modifying actions. */ -public class PlatformDataIntegrityException extends RuntimeException { +public class PlatformDataIntegrityException extends AbstractPlatformException { - private final String globalisationMessageCode; - private final String defaultUserMessage; private final String parameterName; - private final Object[] defaultUserMessageArgs; public PlatformDataIntegrityException(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { - super(AbstractPlatformException.findThrowableCause(defaultUserMessageArgs)); - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; + super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); this.parameterName = null; - this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); } public PlatformDataIntegrityException(final String globalisationMessageCode, final String defaultUserMessage, final String parameterName, final Object... defaultUserMessageArgs) { - super(AbstractPlatformException.findThrowableCause(defaultUserMessageArgs)); - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; + super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); this.parameterName = parameterName; - this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); - } - - public String getGlobalisationMessageCode() { - return this.globalisationMessageCode; - } - - public String getDefaultUserMessage() { - return this.defaultUserMessage; - } - - public Object[] getDefaultUserMessageArgs() { - return this.defaultUserMessageArgs; } public String getParameterName() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformInternalServerException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformInternalServerException.java index fcf24aaab..e387a1c97 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformInternalServerException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformInternalServerException.java @@ -21,28 +21,9 @@ package org.apache.fineract.infrastructure.core.exception; /** * A {@link RuntimeException} thrown when unexpected server side errors happen. */ -public class PlatformInternalServerException extends RuntimeException { +public class PlatformInternalServerException extends AbstractPlatformException { - private final String globalisationMessageCode; - private final String defaultUserMessage; - private final Object[] defaultUserMessageArgs; - - public PlatformInternalServerException(final String globalisationMessageCode, final String defaultUserMessage, - final Object... defaultUserMessageArgs) { - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = defaultUserMessageArgs; - } - - public String getGlobalisationMessageCode() { - return this.globalisationMessageCode; - } - - public String getDefaultUserMessage() { - return this.defaultUserMessage; - } - - public Object[] getDefaultUserMessageArgs() { - return this.defaultUserMessageArgs; + public PlatformInternalServerException(String globalisationMessageCode, String defaultUserMessage, Object... defaultUserMessageArgs) { + super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformServiceUnavailableException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformServiceUnavailableException.java old mode 100755 new mode 100644 index bc8c6e5d8..d1f9c0435 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformServiceUnavailableException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/PlatformServiceUnavailableException.java @@ -20,9 +20,8 @@ package org.apache.fineract.infrastructure.core.exception; public class PlatformServiceUnavailableException extends AbstractPlatformServiceUnavailableException { - public PlatformServiceUnavailableException(final String globalisationMessageCode, final String defaultUserMessage, - final Object... defaultUserMessageArgs) { + public PlatformServiceUnavailableException(String globalisationMessageCode, String defaultUserMessage, + Object... defaultUserMessageArgs) { super(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); } - } From bcfbe65d568e584e139500af8e95a7fa6c6485bb Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 30 Jun 2020 00:00:08 +0200 Subject: [PATCH 034/131] use new AbstractPlatformException in AbstractPlatformException only indirectly related to FINERACT-942, but makes sense to do so now --- .../importhandler/ImportHandlerUtils.java | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java index 5cfd05d5d..c8cd9da8e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java @@ -23,11 +23,7 @@ import com.google.common.collect.Iterables; import java.util.List; import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants; import org.apache.fineract.infrastructure.core.data.ApiParameterError; -import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; -import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; -import org.apache.fineract.infrastructure.core.exception.AbstractPlatformServiceUnavailableException; -import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; -import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException; +import org.apache.fineract.infrastructure.core.exception.AbstractPlatformException; import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -278,21 +274,9 @@ public class ImportHandlerUtils { } public static String getErrorMessage(RuntimeException re) { - if (re instanceof AbstractPlatformDomainRuleException) { - AbstractPlatformDomainRuleException abstractPlatformDomainRuleException = (AbstractPlatformDomainRuleException) re; - return abstractPlatformDomainRuleException.getDefaultUserMessage(); - } else if (re instanceof AbstractPlatformResourceNotFoundException) { - AbstractPlatformResourceNotFoundException abstractPlatformResourceNotFoundException = (AbstractPlatformResourceNotFoundException) re; - return abstractPlatformResourceNotFoundException.getDefaultUserMessage(); - } else if (re instanceof AbstractPlatformServiceUnavailableException) { - AbstractPlatformServiceUnavailableException abstractPlatformServiceUnavailableException = (AbstractPlatformServiceUnavailableException) re; - return abstractPlatformServiceUnavailableException.getDefaultUserMessage(); - } else if (re instanceof PlatformDataIntegrityException) { - PlatformDataIntegrityException platformDataIntegrityException = (PlatformDataIntegrityException) re; - return platformDataIntegrityException.getDefaultUserMessage(); - } else if (re instanceof PlatformApiDataValidationException) { - PlatformApiDataValidationException platformApiDataValidationException = (PlatformApiDataValidationException) re; - return getDefaultUserMessages(platformApiDataValidationException.getErrors()); + if (re instanceof AbstractPlatformException) { + AbstractPlatformException abstractPlatformException = (AbstractPlatformException) re; + return abstractPlatformException.getDefaultUserMessage(); } else if (re instanceof UnsupportedParameterException) { UnsupportedParameterException unsupportedParameterException = (UnsupportedParameterException) re; return getErrorList(unsupportedParameterException.getUnsupportedParameters()); From 9ed9153cba83144c33c61c3024267eb264a1451e Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 30 Jun 2020 00:35:42 +0200 Subject: [PATCH 035/131] use AbstractPlatformException's defaultUserMessage as RuntimeException's message [FINERACT-1062] --- ...esWritePlatformServiceJpaRepositoryImpl.java | 2 +- .../exception/AbstractPlatformException.java | 17 +++++++++-------- .../exception/UserNotFoundException.java | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java index 2ddbf4a58..d1e7f3fc5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java @@ -167,7 +167,7 @@ public class ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl implements } createProvsioningEntry(currentDate, addJournalEntries); } catch (ProvisioningEntryAlreadyCreatedException peace) { - LOG.error("{}", peace.getDefaultUserMessage()); + LOG.error("Provisioning Entry already created", peace); } catch (DataIntegrityViolationException dive) { LOG.error("Problem occurred in generateLoanLossProvisioningAmount function", dive); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java index 9f0420348..1439e5b1b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/AbstractPlatformException.java @@ -32,26 +32,27 @@ public abstract class AbstractPlatformException extends RuntimeException { private final String defaultUserMessage; private final Object[] defaultUserMessageArgs; - protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage, Object[] defaultUserMessageArgs) { - super(findThrowableCause(defaultUserMessageArgs)); - this.globalisationMessageCode = globalisationMessageCode; - this.defaultUserMessage = defaultUserMessage; - this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); - } - protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage) { + super(defaultUserMessage); this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; this.defaultUserMessageArgs = NO_ARGS; } protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage, Throwable cause) { - super(cause); + super(defaultUserMessage, cause); this.globalisationMessageCode = globalisationMessageCode; this.defaultUserMessage = defaultUserMessage; this.defaultUserMessageArgs = NO_ARGS; } + protected AbstractPlatformException(String globalisationMessageCode, String defaultUserMessage, Object[] defaultUserMessageArgs) { + super(defaultUserMessage, findThrowableCause(defaultUserMessageArgs)); + this.globalisationMessageCode = globalisationMessageCode; + this.defaultUserMessage = defaultUserMessage; + this.defaultUserMessageArgs = AbstractPlatformException.filterThrowableCause(defaultUserMessageArgs); + } + private static Throwable findThrowableCause(Object[] defaultUserMessageArgs) { for (Object defaultUserMessageArg : defaultUserMessageArgs) { if (defaultUserMessageArg instanceof Throwable) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UserNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UserNotFoundException.java index 926f7a904..12ba82f11 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UserNotFoundException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/exception/UserNotFoundException.java @@ -26,10 +26,10 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourc public class UserNotFoundException extends AbstractPlatformResourceNotFoundException { public UserNotFoundException(final Long id) { - super("error.msg.user.id.invalid", "User with identifier " + id + " does not exist", id); + super("error.msg.user.id.invalid", "User with ID " + id + " does not exist", id); } public UserNotFoundException(final String userName) { - super("error.msg.user.name.not.found", "User with identifier " + userName + " does not exist"); + super("error.msg.user.name.not.found", "User with name '" + userName + "' does not exist"); } } From 6e279619a5a7c7af62c043e151411ffb1afbc757 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Tue, 30 Jun 2020 06:08:18 +0300 Subject: [PATCH 036/131] FINERACT-1061: Removing call to rs.beforeFirst() --- .../service/ProductMixReadPlatformServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java index 5ea0c0009..ba38224cb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixReadPlatformServiceImpl.java @@ -111,9 +111,7 @@ public class ProductMixReadPlatformServiceImpl implements ProductMixReadPlatform extractedData.put(this.productId, productMixData); return extractedData; } - /* move the cursor to starting of resultset */ - rs.beforeFirst(); - while (rs.next()) { + do { final Long productId = rs.getLong("productId"); final String name = rs.getString("name"); final Collection restrictedProducts = this.loanProductReadPlatformService @@ -122,7 +120,7 @@ public class ProductMixReadPlatformServiceImpl implements ProductMixReadPlatform .retrieveAllowedProductsForMix(productId); final ProductMixData productMixData = ProductMixData.withDetails(productId, name, restrictedProducts, allowedProducts); extractedData.put(productId, productMixData); - } + } while (rs.next()); return extractedData; } } From 9c3f1addd74dca01c5feeb538adfd9ad80d6c7fc Mon Sep 17 00:00:00 2001 From: Nikhil Pawar <16708052+nikpawar89@users.noreply.github.com> Date: Sat, 27 Jun 2020 18:18:33 -0400 Subject: [PATCH 037/131] Fineract-1043 Removed street field from address --- ...AddressCommandFromApiJsonDeserializer.java | 17 +--------------- .../AddressWritePlatformServiceImpl.java | 7 ------- .../V359__remove_fied_from_address.sql | 20 +++++++++++++++++++ 3 files changed, 21 insertions(+), 23 deletions(-) create mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java index 2adbaa74e..4d5e12780 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java @@ -96,7 +96,6 @@ public class AddressCommandFromApiJsonDeserializer { enabledFieldList.add("locale"); enabledFieldList.add("dateFormat"); supportedParameters = new HashSet<>(enabledFieldList); - // enabledFieldList.add("address"); madatoryFieldsMap.put("addressTypeId", true); @@ -108,23 +107,9 @@ public class AddressCommandFromApiJsonDeserializer { madatoryFieldsMap.put("addressId", true); supportedParameters = new HashSet<>(enabledFieldList); } - // final Set supportedParameters = new - // HashSet<>(enabledFieldList); + this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, supportedParameters); - final String street = this.fromApiJsonHelper.extractStringNamed("street", element); - - if (enabledFieldsMap.get("street")) { - if (madatoryFieldsMap.get("street") && fromNewClient) { - - baseDataValidator.reset().parameter("street").value(street).notBlank(); - - } - if (!regexFieldsMap.get("street").isEmpty()) { - baseDataValidator.reset().parameter("street").value(street).matchesRegularExpression(regexFieldsMap.get("street")); - } - - } final String addressLine1 = this.fromApiJsonHelper.extractStringNamed("addressLine1", element); if (enabledFieldsMap.get("addressLine1")) { if (madatoryFieldsMap.get("addressLine1") && fromNewClient) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java index a523aaf74..153c60f94 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java @@ -185,13 +185,6 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ final Address addobj = this.addressRepository.getOne(addressId); - if (!command.stringValueOfParameterNamed("street").isEmpty()) { - - is_address_update = true; - final String street = command.stringValueOfParameterNamed("street"); - addobj.setStreet(street); - } - if (!command.stringValueOfParameterNamed("addressLine1").isEmpty()) { is_address_update = true; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql new file mode 100644 index 000000000..60836047f --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql @@ -0,0 +1,20 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- + +DELETE FROM `m_field_configuration` WHERE field = 'street'; From 0a01419cd30bedafcf538083df5b38fcb1d336b5 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Thu, 2 Jul 2020 06:13:58 +0300 Subject: [PATCH 038/131] FINERACT-1016: Fixing rounding issues in integration tests --- .../integrationtests/FixedDepositTest.java | 77 ++++++------- .../RecurringDepositTest.java | 103 ++++++++---------- 2 files changed, 82 insertions(+), 98 deletions(-) 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 7fc0aaf84..1f8fb6976 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 @@ -104,10 +104,11 @@ public class FixedDepositTest { // 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 + // we only compare that the result is within THRESHOLD of the expected amount. + // A proper solution would be to implement the exact interest // calculation in this test, // and then to compare the exact results + public static final Float THRESHOLD = 1.0f; @BeforeEach public void setup() { @@ -1224,10 +1225,8 @@ public class FixedDepositTest { principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Fixed Deposit Account"); } @Test @@ -1296,10 +1295,8 @@ public class FixedDepositTest { principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Fixed Deposit Account"); } @Test @@ -1396,10 +1393,9 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - principal = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float maturityAmount = (float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -1482,7 +1478,7 @@ public class FixedDepositTest { principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); LOG.info("{}", monthDayFormat.format(todaysDate.getTime())); - + currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); LOG.info("IPM = {}", interestPerMonth); principal += interestPerMonth; @@ -1501,10 +1497,9 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - principal = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float maturityAmount = (float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -1611,10 +1606,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -1725,10 +1720,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Float expectedPrematureAmount = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -1799,10 +1794,8 @@ public class FixedDepositTest { principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Fixed Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Fixed Deposit Account"); } @@ -1957,10 +1950,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Maturity amount"); } @@ -2040,10 +2033,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Maturity amount"); } @@ -2121,10 +2114,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2202,10 +2195,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2283,10 +2276,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @Test @@ -2363,10 +2356,10 @@ public class FixedDepositTest { fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec, fixedDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) fixedDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } /*** diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java index 7474bf90f..b6b4181a3 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java @@ -105,10 +105,11 @@ public class RecurringDepositTest { // 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 + // we only compare that the result is within THRESHOLD of the expected amount. + // A proper solution would be to implement the exact interest // calculation in this test, // and then to compare the exact results + public static final Float THRESHOLD = 1.0f; @BeforeEach public void setup() { @@ -467,10 +468,11 @@ public class RecurringDepositTest { HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId); - Double balanceAfter = Math.floor((Float) savingsSummaryAfter.get("accountBalance")); - Double expectedSavingsBalance = Math.floor(balanceBefore + prematurityAmount); + Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance"); + Float expectedSavingsBalance = balanceBefore + prematurityAmount; - Assertions.assertEquals(expectedSavingsBalance, balanceAfter, "Verifying Savings Account Balance after Premature Closure"); + Assertions.assertTrue(Math.abs(expectedSavingsBalance - balanceAfter) < THRESHOLD, + "Verifying Savings Account Balance after Premature Closure"); } @@ -675,10 +677,11 @@ public class RecurringDepositTest { HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId); - Double balanceAfter = Math.floor((Float) savingsSummaryAfter.get("accountBalance")); - Double expectedSavingsBalance = Math.floor(balanceBefore + prematurityAmount); + Float balanceAfter = (Float) savingsSummaryAfter.get("accountBalance"); + Float expectedSavingsBalance = balanceBefore + prematurityAmount; - Assertions.assertEquals(expectedSavingsBalance, balanceAfter, "Verifying Savings Account Balance after Premature Closure"); + Assertions.assertTrue(Math.abs(expectedSavingsBalance - balanceAfter) < THRESHOLD, + "Verifying Savings Account Balance after Premature Closure"); } @@ -1410,10 +1413,8 @@ public class RecurringDepositTest { principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositAmount, depositPeriod, interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Recurring Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Recurring Deposit Account"); } /*** @@ -1492,10 +1493,8 @@ public class RecurringDepositTest { principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositAmount, depositPeriod, interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Recurring Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Recurring Deposit Account"); } /*** @@ -1574,7 +1573,7 @@ public class RecurringDepositTest { Float interestToBePosted = (float) (interestPerDay * principal * daysInMonth); principal += interestToBePosted; - Float expectedBalanceAfter = (float) Math.floor(principal); + Float expectedBalanceAfter = principal; LOG.info("{}", expectedBalanceAfter.toString()); Integer transactionIdForPostInterest = this.recurringDepositAccountHelper @@ -1582,13 +1581,13 @@ public class RecurringDepositTest { Assertions.assertNotNull(transactionIdForPostInterest); HashMap recurringDepositAccountSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); - Float interestAmountPosted = (float) Math.floor((Float) recurringDepositAccountSummary.get("totalInterestPosted")); - Float principalAfter = (float) Math.floor((Float) recurringDepositAccountSummary.get("accountBalance")); - interestToBePosted = (float) Math.floor(interestToBePosted); + Float interestAmountPosted = (Float) recurringDepositAccountSummary.get("totalInterestPosted"); + Float principalAfter = (Float) recurringDepositAccountSummary.get("accountBalance"); - Assertions.assertEquals(interestToBePosted, interestAmountPosted, + Assertions.assertTrue(Math.abs(interestToBePosted - interestAmountPosted) < THRESHOLD, "Verifying Amount of Interest Posted to Recurring Deposit Account"); - Assertions.assertEquals(expectedBalanceAfter, principalAfter, "Verifying Principal Amount after Interest Posting"); + Assertions.assertTrue(Math.abs(expectedBalanceAfter - principalAfter) < THRESHOLD, + "Verifying Principal Amount after Interest Posting"); } @@ -1710,10 +1709,9 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - principal = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -1840,10 +1838,9 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - principal = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -1977,10 +1974,9 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - principal = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2119,10 +2115,9 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - principal = (float) Math.floor(principal); - Float maturityAmount = (float) Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(principal, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2200,10 +2195,8 @@ public class RecurringDepositTest { principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Recurring Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Recurring Deposit Account"); } @@ -2282,10 +2275,8 @@ public class RecurringDepositTest { principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount, depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL); - principal = (float) Math.floor(principal); - maturityAmount = (float) Math.floor(maturityAmount); LOG.info("{}", principal.toString()); - Assertions.assertEquals(principal, maturityAmount, "Verifying Maturity amount for Recurring Deposit Account"); + Assertions.assertTrue(Math.abs(principal - maturityAmount) < THRESHOLD, "Verifying Maturity amount for Recurring Deposit Account"); } @@ -2372,10 +2363,10 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2462,10 +2453,10 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2552,10 +2543,10 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Maturity amount"); } @@ -2642,10 +2633,10 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Maturity amount"); } @@ -2732,10 +2723,10 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } @@ -2822,10 +2813,10 @@ public class RecurringDepositTest { recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Double expectedPrematureAmount = Math.floor(principal); - Double maturityAmount = Math.floor((Float) recurringDepositAccountData.get("maturityAmount")); + Float expectedPrematureAmount = principal; + Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); - Assertions.assertEquals(expectedPrematureAmount, maturityAmount, "Verifying Pre-Closure maturity amount"); + Assertions.assertTrue(Math.abs(expectedPrematureAmount - maturityAmount) < THRESHOLD, "Verifying Pre-Closure maturity amount"); } From 2e3216607905b6d881b7ec4448e090691badb6b5 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Wed, 1 Jul 2020 22:24:19 +0200 Subject: [PATCH 039/131] Make Google's Guava library an explicit dependency Instead of only transitively inheriting it through activemq-broker, so that the upcoming next major upgrade of activemq-broker doesn't break the build. Note that Fineract code already extensively uses Guava, this just makes it explicit. --- fineract-provider/build.gradle | 8 +++++--- fineract-provider/dependencies.gradle | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 08fa5dc73..33be5c66c 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -80,14 +80,16 @@ dependencyManagement { } dependencies { - // As much as possible, we avoid fixed versions, and prefer inheriting them from the Spring BOM, thus NOT listing versions here. - // (The :+ seems to mean latest available version available on Maven Central, which we should also avoid, as it's not isolated?) + // We use fixed versions, instead of inheriting them from the Spring BOM, to be able to be on more recent ones. + // We do not use :+ to get the latest available version available on Maven Central, as that could suddenly break things. + // We use the Renovate Bot to automatically propose Pull Requests (PRs) when upgrades for all of these versions are available. dependency 'org.springframework.security.oauth:spring-security-oauth2:2.5.0.RELEASE' - dependency "org.apache.openjpa:openjpa:3.1.1" // when upgrading, also change OpenJPA version repeated above in buildscript! + dependency 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated above in buildscript! dependency 'com.squareup.retrofit:retrofit:1.9.0' dependency 'com.squareup.okhttp:okhttp:2.7.5' dependency 'com.squareup.okhttp:okhttp-urlconnection:2.7.5' + dependency 'com.google.guava:guava:28.2-jre' dependency 'com.google.code.gson:gson:2.8.6' dependency 'org.apache.commons:commons-email:1.5' dependency 'commons-io:commons-io:2.7' diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 85829ed63..c8b8d0c36 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -46,6 +46,7 @@ dependencies { 'com.sun.jersey.contribs:jersey-multipart', 'joda-time:joda-time', + 'com.google.guava:guava', 'com.google.code.gson:gson', 'com.sun.jersey:jersey-core', 'com.squareup.retrofit:retrofit', From 10536c0f915a98c05af14d5fbc0e6349170eaa87 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 30 Jun 2020 00:48:51 +0200 Subject: [PATCH 040/131] make SimpleDateFormat use in ApiParameterError thread-safe [FINERACT-1063] --- .../fineract/infrastructure/core/data/ApiParameterError.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java index b34217e6d..15fb23f36 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java @@ -56,8 +56,6 @@ public class ApiParameterError { */ private List args = new ArrayList<>(); - private final transient SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); - public static ApiParameterError generalError(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); @@ -89,6 +87,7 @@ public class ApiParameterError { if (defaultUserMessageArgs != null) { for (final Object object : defaultUserMessageArgs) { if (object instanceof Date) { + final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); final String formattedDate = dateFormatter.format(object); messageArgs.add(ApiErrorMessageArg.from(formattedDate)); } else { From 1623e80a7f276214f5e7428ef1f1f5d585c3e438 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 30 Jun 2020 00:52:06 +0200 Subject: [PATCH 041/131] make ApiParameterError (almost) immutable by making (most of) its fields final, because Immutable is Good Only "almost" / "most" because of the of the remaining use of setParameterName() in EntityDatatableChecksWritePlatformServiceImpl.saveDatatables() which unfortunately looks a lot less trivial to get rid of, so that's for another time/someone else, later (or never). --- .../AccountNumberFormatDataValidator.java | 5 +- .../core/data/ApiErrorMessageArg.java | 4 -- .../core/data/ApiParameterError.java | 55 +++++++------------ .../core/serialization/JsonParserHelper.java | 17 +++--- ...tatableChecksWritePlatformServiceImpl.java | 3 +- 5 files changed, 28 insertions(+), 56 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java index 6be6da94b..080635a6a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java @@ -44,6 +44,7 @@ import org.springframework.stereotype.Component; public class AccountNumberFormatDataValidator { private final FromJsonHelper fromApiJsonHelper; + private static final Set ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>( Arrays.asList(AccountNumberFormatConstants.accountTypeParamName, AccountNumberFormatConstants.prefixTypeParamName)); @@ -56,7 +57,6 @@ public class AccountNumberFormatDataValidator { } public void validateForCreate(final String json) { - if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } @@ -136,7 +136,6 @@ public class AccountNumberFormatDataValidator { } public void validateForUpdate(final String json, EntityAccountType entityAccountType) { - if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } @@ -166,12 +165,10 @@ public class AccountNumberFormatDataValidator { } throwExceptionIfValidationWarningsExist(dataValidationErrors); - } private void throwExceptionIfValidationWarningsExist(final List dataValidationErrors) { if (!dataValidationErrors.isEmpty()) { - // throw new PlatformApiDataValidationException(dataValidationErrors); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiErrorMessageArg.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiErrorMessageArg.java index a4fd77b7a..1ced5ad8f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiErrorMessageArg.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiErrorMessageArg.java @@ -29,10 +29,6 @@ public class ApiErrorMessageArg { return new ApiErrorMessageArg(object); } - protected ApiErrorMessageArg() { - // - } - public ApiErrorMessageArg(final Object object) { this.value = object; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java index 15fb23f36..67daff4e1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/ApiParameterError.java @@ -23,23 +23,23 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -public class ApiParameterError { +public final class ApiParameterError { /** * A developer friendly plain English description of why the HTTP error response was returned from the API. */ - private String developerMessage; + private final String developerMessage; /** * A user friendly plain English description of why the HTTP error response was returned from the API that can be * presented to end users. */ - private String defaultUserMessage; + private final String defaultUserMessage; /** * A code that can be used for globalisation support by client applications of the API. */ - private String userMessageGlobalisationCode; + private final String userMessageGlobalisationCode; /** * The name of the field or parameter passed to the API that this error relates to. @@ -49,39 +49,44 @@ public class ApiParameterError { /** * The actual value of the parameter (if any) as passed to API. */ - private Object value; + private final Object value; /** * Arguments related to the user error message. */ - private List args = new ArrayList<>(); + private final List args; public static ApiParameterError generalError(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { - return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); + return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs, "id", null); } public static ApiParameterError resourceIdentifierNotFound(final String globalisationMessageCode, final String defaultUserMessage, final Object... defaultUserMessageArgs) { - return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); + return new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs, "id", null); } public static ApiParameterError parameterError(final String globalisationMessageCode, final String defaultUserMessage, final String parameterName, final Object... defaultUserMessageArgs) { - final ApiParameterError error = new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs); - error.setParameterName(parameterName); + final ApiParameterError error = new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs, + parameterName, null); return error; } - protected ApiParameterError() { - // + public static ApiParameterError parameterErrorWithValue(final String globalisationMessageCode, final String defaultUserMessage, + final String parameterName, final String value, final Object... defaultUserMessageArgs) { + final ApiParameterError error = new ApiParameterError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs, + parameterName, value); + return error; } - private ApiParameterError(final String globalisationMessageCode, final String defaultUserMessage, - final Object[] defaultUserMessageArgs) { + private ApiParameterError(final String globalisationMessageCode, final String defaultUserMessage, final Object[] defaultUserMessageArgs, + String parameterName, String value) { this.userMessageGlobalisationCode = globalisationMessageCode; this.developerMessage = defaultUserMessage; this.defaultUserMessage = defaultUserMessage; + this.parameterName = parameterName; + this.value = value; final List messageArgs = new ArrayList<>(); if (defaultUserMessageArgs != null) { @@ -96,34 +101,20 @@ public class ApiParameterError { } } this.args = messageArgs; - - this.parameterName = "id"; } public String getDeveloperMessage() { return this.developerMessage; } - public void setDeveloperMessage(final String developerMessage) { - this.developerMessage = developerMessage; - } - public String getDefaultUserMessage() { return this.defaultUserMessage; } - public void setDefaultUserMessage(final String defaultUserMessage) { - this.defaultUserMessage = defaultUserMessage; - } - public String getUserMessageGlobalisationCode() { return this.userMessageGlobalisationCode; } - public void setUserMessageGlobalisationCode(final String userMessageGlobalisationCode) { - this.userMessageGlobalisationCode = userMessageGlobalisationCode; - } - public String getParameterName() { return this.parameterName; } @@ -136,15 +127,7 @@ public class ApiParameterError { return this.value; } - public void setValue(final Object value) { - this.value = value; - } - public List getArgs() { return this.args; } - - public void setArgs(final List args) { - this.args = args; - } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java index a89039dac..83a35f15e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/JsonParserHelper.java @@ -560,11 +560,10 @@ public class JsonParserHelper { } catch (final ParseException e) { final List dataValidationErrors = new ArrayList<>(); - final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.integer.format", + final ApiParameterError error = ApiParameterError.parameterErrorWithValue("validation.msg.invalid.integer.format", "The parameter " + parameterName + " has value: " + numericalValueFormatted + " which is invalid integer value for provided locale of [" + clientApplicationLocale.toString() + "].", - parameterName, numericalValueFormatted, clientApplicationLocale); - error.setValue(numericalValueFormatted); + parameterName, numericalValueFormatted, numericalValueFormatted, clientApplicationLocale); dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", @@ -585,10 +584,9 @@ public class JsonParserHelper { } catch (final NumberFormatException e) { final List dataValidationErrors = new ArrayList<>(); - final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.integer", + final ApiParameterError error = ApiParameterError.parameterErrorWithValue("validation.msg.invalid.integer", "The parameter " + parameterName + " has value: " + numericalValueFormatted + " which is invalid integer.", - parameterName, numericalValueFormatted); - error.setValue(numericalValueFormatted); + parameterName, numericalValueFormatted, numericalValueFormatted); dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", @@ -632,7 +630,7 @@ public class JsonParserHelper { if (parsedNumber instanceof BigDecimal) { number = (BigDecimal) parsedNumber; } else { - number = BigDecimal.valueOf(Double.valueOf(parsedNumber.doubleValue())); + number = BigDecimal.valueOf(parsedNumber.doubleValue()); } } @@ -640,11 +638,10 @@ public class JsonParserHelper { } catch (final ParseException e) { final List dataValidationErrors = new ArrayList<>(); - final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.decimal.format", + final ApiParameterError error = ApiParameterError.parameterErrorWithValue("validation.msg.invalid.decimal.format", "The parameter " + parameterName + " has value: " + numericalValueFormatted + " which is invalid decimal value for provided locale of [" + clientApplicationLocale.toString() + "].", - parameterName, numericalValueFormatted, clientApplicationLocale); - error.setValue(numericalValueFormatted); + parameterName, numericalValueFormatted, numericalValueFormatted, clientApplicationLocale); dataValidationErrors.add(error); throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java index 6fdebe74a..4e4320842 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java @@ -107,7 +107,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData final String foreignKeyColumnName = EntityTables.getForeignKeyColumnNameOnDatatable(entity); final boolean columnExist = datatableData.hasColumn(foreignKeyColumnName); - LOG.info("{} has column {} ? {}", new Object[] { datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist }); + LOG.info("{} has column {} ? {}", datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist); if (!columnExist) { throw new EntityDatatableCheckNotSupportedException(datatableData.getRegisteredTableName(), entity); @@ -237,7 +237,6 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData try { this.readWriteNonCoreDataService.createNewDatatableEntry(datatableName, entityId, datatableData.toString()); } catch (PlatformApiDataValidationException e) { - List errors = e.getErrors(); for (ApiParameterError error : e.getErrors()) { error.setParameterName("datatables." + datatableName + "." + error.getParameterName()); } From ce9a8c90aad3b6593f94316931b0f259cf12bd78 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 2 Jul 2020 09:43:47 +0000 Subject: [PATCH 042/131] Update dependency org.webjars.npm:swagger-ui-dist to v3.28.0 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 33be5c66c..cc0677beb 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -119,7 +119,7 @@ dependencyManagement { dependency 'org.mock-server:mockserver-junit-jupiter:5.10.0' // If this is upgraded, you need to change path in WebFrontEndConfiguration - dependency 'org.webjars.npm:swagger-ui-dist:3.27.0' + dependency 'org.webjars.npm:swagger-ui-dist:3.28.0' dependency ('org.dom4j:dom4j:2.1.3') { exclude 'relaxngDatatype:relaxngDatatype' // already in com.sun.xml.bind:jaxb-osgi:2.3.0.1 From c7c76f3ffa0944e29f34f96f32f1384973f4a365 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Fri, 3 Jul 2020 06:15:17 +0300 Subject: [PATCH 043/131] FINERACT-1016: Removing partial fix to 1st month issue --- .../org/apache/fineract/integrationtests/FixedDepositTest.java | 1 - 1 file changed, 1 deletion(-) 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 1f8fb6976..70ee31936 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 @@ -1478,7 +1478,6 @@ public class FixedDepositTest { principal += interestPerMonth; todaysDate.add(Calendar.DATE, daysInMonth); LOG.info("{}", monthDayFormat.format(todaysDate.getTime())); - currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); interestPerMonth = (float) (interestPerDay * principal * currentDate); LOG.info("IPM = {}", interestPerMonth); principal += interestPerMonth; From f3b4a66ff88b6bf187996a2860386fe5edf87ede Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Jul 2020 13:45:01 +0200 Subject: [PATCH 044/131] Update dependency com.diffplug.spotless:spotless-plugin-gradle to v4.5.0 (#1137) --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index cc0677beb..b2dbeb3ae 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -48,7 +48,7 @@ buildscript { classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" - classpath "com.diffplug.spotless:spotless-plugin-gradle:4.4.0" + classpath "com.diffplug.spotless:spotless-plugin-gradle:4.5.0" classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.3" } } From 82d100ec542bd3d03680331b06ab21f7dcbd3e1c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Jul 2020 13:52:13 +0200 Subject: [PATCH 045/131] Update dependency com.amazonaws:aws-java-sdk-s3 to v1.11.816 (#1133) --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index b2dbeb3ae..762a61cca 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -98,7 +98,7 @@ dependencyManagement { dependency 'org.mnode.ical4j:ical4j:3.0.19' dependency 'org.flywaydb:flyway-core:6.5.0' dependency 'org.quartz-scheduler:quartz:2.3.2' - dependency 'com.amazonaws:aws-java-sdk-s3:1.11.804' + dependency 'com.amazonaws:aws-java-sdk-s3:1.11.816' dependency 'org.ehcache:ehcache:3.8.1' dependency 'com.github.spullara.mustache.java:compiler:0.9.6' dependency 'com.jayway.jsonpath:json-path:2.4.0' From fdf9e2c6f03be3e032576c0170adb07ee5af004e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Jul 2020 14:05:58 +0200 Subject: [PATCH 046/131] Update dependency gradle to v6.5.1 (#1130) --- fineract-provider/gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/gradle/wrapper/gradle-wrapper.properties b/fineract-provider/gradle/wrapper/gradle-wrapper.properties index 622ab64a3..bb8b2fc26 100644 --- a/fineract-provider/gradle/wrapper/gradle-wrapper.properties +++ b/fineract-provider/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From c92e926d6c4fbc7ef358ad7f4ff5539fb24344c8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Jul 2020 15:29:46 +0200 Subject: [PATCH 047/131] Update dependency com.google.guava:guava to v29 (#1142) --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 762a61cca..826feb5dd 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -89,7 +89,7 @@ dependencyManagement { dependency 'com.squareup.retrofit:retrofit:1.9.0' dependency 'com.squareup.okhttp:okhttp:2.7.5' dependency 'com.squareup.okhttp:okhttp-urlconnection:2.7.5' - dependency 'com.google.guava:guava:28.2-jre' + dependency 'com.google.guava:guava:29.0-jre' dependency 'com.google.code.gson:gson:2.8.6' dependency 'org.apache.commons:commons-email:1.5' dependency 'commons-io:commons-io:2.7' From 551819ee184f33a9d045c9f4ae66672f41a07122 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Tue, 30 Jun 2020 08:58:34 +0300 Subject: [PATCH 048/131] FINERACT-1060: Stop delete / update of system user --- .../UserAdministrationTest.java | 16 ++++++++++++++++ .../useradministration/users/UserHelper.java | 18 ++++++++++++++++++ .../useradministration/domain/AppUser.java | 19 +++++++++++++++++++ .../domain/AppUserRepositoryWrapper.java | 6 +++--- .../service/AppUserConstants.java | 2 ++ 5 files changed, 58 insertions(+), 3 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java index 3fa9c3d83..00fad579e 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java @@ -32,6 +32,7 @@ import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper; import org.apache.fineract.integrationtests.useradministration.users.UserHelper; +import org.apache.fineract.useradministration.service.AppUserConstants; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -155,4 +156,19 @@ public class UserAdministrationTest { reason.get("defaultUserMessage")); } + @Test + public void testDeleteSystemUser() { + final Integer userId = UserHelper.getUserId(requestSpec, responseSpec, AppUserConstants.SYSTEM_USER_NAME); + Assertions.assertNotNull(userId); + + UserHelper.deleteUser(requestSpec, expectStatusCode(403), userId.intValue()); + } + + @Test + public void testModifySystemUser() { + final Integer userId = UserHelper.getUserId(requestSpec, responseSpec, AppUserConstants.SYSTEM_USER_NAME); + Assertions.assertNotNull(userId); + + final List errors = (List) UserHelper.updateUser(this.requestSpec, expectStatusCode(403), userId, "systemtest", "errors"); + } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java index 6300d4f7d..ae0b1c0bf 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java @@ -18,9 +18,13 @@ */ package org.apache.fineract.integrationtests.useradministration.users; +import io.restassured.path.json.JsonPath; import io.restassured.specification.RequestSpecification; import io.restassured.specification.ResponseSpecification; +import java.util.HashMap; +import java.util.List; import org.apache.fineract.integrationtests.common.Utils; +import org.junit.jupiter.api.Assertions; public class UserHelper { @@ -44,6 +48,20 @@ public class UserHelper { getTestCreateUserAsJSONForSelfService(roleId, staffId, clientId), attribute); } + public static Integer getUserId(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, String userName) { + String json = Utils.performServerGet(requestSpec, responseSpec, CREATE_USER_URL, null); + Assertions.assertNotNull(json); + List> userList = JsonPath.from(json).getList("$"); + + for (HashMap user : userList) { + if (user.get("username").equals(userName)) { + return (Integer) user.get("id"); + } + } + + return null; + } + public static String getTestCreateUserAsJSON(int roleId, int staffId) { return "{ \"username\": \"" + Utils.randomNameGenerator("User_Name_", 3) + "\", \"firstname\": \"Test\", \"lastname\": \"User\", \"email\": \"whatever@mifos.org\"," diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java index 4119f750a..b2ab5098b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java @@ -264,6 +264,12 @@ public class AppUser extends AbstractPersistableCustom implements PlatformUser { final String usernameParamName = "username"; if (command.isChangeInStringParameterNamed(usernameParamName, this.username)) { + + // TODO Remove this check once we are identifying system user based on user ID + if (isSystemUser()) { + throw new NoAuthorizationException("User name of current system user may not be modified"); + } + final String newValue = command.stringValueOfParameterNamed(usernameParamName); actualChanges.put(usernameParamName, newValue); this.username = newValue; @@ -343,6 +349,10 @@ public class AppUser extends AbstractPersistableCustom implements PlatformUser { * Any fields with unique constraints and prepended with id of record. */ public void delete() { + if (isSystemUser()) { + throw new NoAuthorizationException("User configured as the system user cannot be deleted"); + } + this.deleted = true; this.enabled = false; this.accountNonExpired = false; @@ -355,6 +365,15 @@ public class AppUser extends AbstractPersistableCustom implements PlatformUser { return this.deleted; } + public boolean isSystemUser() { + // TODO Determine system user by ID not by user name + if (this.username.equals(AppUserConstants.SYSTEM_USER_NAME)) { + return true; + } + + return false; + } + @Override public Collection getAuthorities() { return populateGrantedAuthorities(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserRepositoryWrapper.java index 70e88b3bd..ca5676e87 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserRepositoryWrapper.java @@ -19,6 +19,7 @@ package org.apache.fineract.useradministration.domain; import org.apache.fineract.useradministration.exception.UserNotFoundException; +import org.apache.fineract.useradministration.service.AppUserConstants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -33,10 +34,9 @@ public class AppUserRepositoryWrapper { } public AppUser fetchSystemUser() { - String userName = "system"; - AppUser user = this.appUserRepository.findAppUserByName(userName); + AppUser user = this.appUserRepository.findAppUserByName(AppUserConstants.SYSTEM_USER_NAME); if (user == null) { - throw new UserNotFoundException(userName); + throw new UserNotFoundException(AppUserConstants.SYSTEM_USER_NAME); } return user; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserConstants.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserConstants.java index 512e42005..f54e6f712 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserConstants.java @@ -24,4 +24,6 @@ public class AppUserConstants { public static final String IS_SELF_SERVICE_USER = "isSelfServiceUser"; public static final String CLIENTS = "clients"; + // TODO: Remove hard coding of system user name and make this a configurable parameter + public static final String SYSTEM_USER_NAME = "system"; } From 1da8060805c3d60cbaea64c548c09156c4f51cf2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Jul 2020 15:52:07 +0200 Subject: [PATCH 049/131] Update dependency org.apache.activemq:activemq-broker to v5.16.0 (#1134) --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 826feb5dd..a829ddf02 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -108,7 +108,7 @@ dependencyManagement { dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4' dependency 'jakarta.jms:jakarta.jms-api:2.0.3' dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' - dependency 'org.apache.activemq:activemq-broker:5.15.13' + dependency 'org.apache.activemq:activemq-broker:5.16.0' dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' dependency 'org.mockito:mockito-core:3.3.3' dependency 'org.mockito:mockito-junit-jupiter:3.3.3' From b61957acb20ede94bedd05edc95a505bc59ba513 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Thu, 2 Jul 2020 08:42:26 +0300 Subject: [PATCH 050/131] FINERACT-1065: Fixing integration test issues --- .../integrationtests/HookIntegrationTest.java | 6 +++++- .../AdHocScheduledJobRunnerServiceImpl.java | 5 +++-- .../service/LoanArrearsAgingServiceImpl.java | 2 +- .../SavingsAccountTransactionRepository.java | 4 +++- .../service/ScheduledJobRunnerServiceImpl.java | 17 ++++++++++------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java index 36cc3b2aa..1a45b4fbf 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/HookIntegrationTest.java @@ -65,8 +65,10 @@ public class HookIntegrationTest { // http://www.jamesward.com/2014/06/11/testing-webhooks-was-a-pain-so-i-fixed-the-glitch final String uniqueId = UUID.randomUUID().toString(); final String payloadURL = "http://echo-webhook.herokuapp.com:80/" + uniqueId + "?"; - this.hookHelper.createHook(payloadURL); + final Integer hookId = this.hookHelper.createHook(payloadURL); + Assertions.assertNotNull(hookId); final Integer createdOfficeID = this.officeHelper.createOffice("01 January 2012"); + Assertions.assertNotNull(createdOfficeID); try { /** @@ -93,6 +95,8 @@ public class HookIntegrationTest { fail("Failed to connect to https://echo-webhook.herokuapp.com platform"); } throw new RuntimeException(e); + } finally { + this.hookHelper.deleteHook(hookId.longValue()); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java index 10bfb70ea..8ddecf686 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java @@ -101,7 +101,8 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn .append(adhoc.getQuery()); if (insertSqlBuilder.length() > 0) { final int result = this.jdbcTemplate.update(insertSqlBuilder.toString()); - LOG.info("{}: Results affected by inserted: {}", ThreadLocalContextUtil.getTenant().getName(), result); + LOG.info("{}: Records affected by generateClientSchedule: {}", ThreadLocalContextUtil.getTenant().getName(), + result); this.jdbcTemplate.update("UPDATE m_adhoc SET last_run=? WHERE id=?", new Date(), adhoc.getId()); } @@ -111,7 +112,7 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn } }); } else { - LOG.info("{} Nothing to update", ThreadLocalContextUtil.getTenant().getName()); + LOG.info("{}: Nothing to update by generateClientSchedule", ThreadLocalContextUtil.getTenant().getName()); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java index 895ac44f6..5fd76746c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java @@ -126,7 +126,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus result += i; } - LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); + LOG.info("{}: Records affected by updateLoanArrearsAgeingDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java index ec343da2f..b2fb567fc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java @@ -21,11 +21,13 @@ package org.apache.fineract.portfolio.savings.domain; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; public interface SavingsAccountTransactionRepository extends JpaRepository, JpaSpecificationExecutor { @Query("select sat from SavingsAccountTransaction sat where sat.id = :transactionId and sat.savingsAccount.id = :savingsId") - SavingsAccountTransaction findOneByIdAndSavingsAccountId(Long transactionId, Long savingsId); + SavingsAccountTransaction findOneByIdAndSavingsAccountId(@Param("transactionId") Long transactionId, + @Param("savingsId") Long savingsId); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java index 50c31826b..36d27ba5b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java @@ -175,7 +175,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService final int result = jdbcTemplate.update(updateSqlBuilder.toString()); - LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); + LOG.info("{}: Records affected by updateLoanSummaryDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Transactional @@ -210,7 +210,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService final int result = jdbcTemplate.update(updateSqlBuilder.toString()); - LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); + LOG.info("{}: Records affected by updateLoanPaidInAdvance: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Override @@ -234,7 +234,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService } } - LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), annualFeeData.size()); + LOG.info("{}: Records affected by applyAnnualFeeForSavings: {}", ThreadLocalContextUtil.getTenant().getName(), + annualFeeData.size()); } @Override @@ -259,7 +260,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService LOG.error("Apply Charges due for savings failed for account: {}", savingsAccountReference.getAccountNo(), ex); } } - LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), chargesDueData.size()); + LOG.info("{}: Records affected by applyDueChargesForSavings: {}", ThreadLocalContextUtil.getTenant().getName(), + chargesDueData.size()); if (!exceptions.isEmpty()) { throw new JobExecutionException(exceptions); } @@ -297,7 +299,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService final int result = jdbcTemplate.update(updateSqlBuilder.toString()); - LOG.info("{} : Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); + LOG.info("{}: Records affected by updateNPA: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Override @@ -321,7 +323,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService } } - LOG.info("{}: Deposit accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), depositAccounts.size()); + LOG.info("{}: Records affected by updateMaturityDetailsOfDepositAccounts: {}", ThreadLocalContextUtil.getTenant().getName(), + depositAccounts.size()); } @Override @@ -442,7 +445,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService .append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)"); final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate); - LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); + LOG.info("{}: Records affected by updateTrialBalanceDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result); } // Updating closing balance From 3f1673ea97db8609ac0f635d4479ac9e86d38553 Mon Sep 17 00:00:00 2001 From: percyashu Date: Tue, 30 Jun 2020 05:40:43 +0100 Subject: [PATCH 051/131] FINERACT-822 Enforce StaticAssignmentInConstructor check --- fineract-provider/build.gradle | 2 +- .../org/apache/fineract/common/RestAssuredFixture.java | 7 ++----- .../core/boot/tests/SpringBootServerLoginTest.java | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index a829ddf02..4e4b4d8df 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -396,7 +396,6 @@ tasks.withType(JavaCompile) { "ReturnFromVoid", "AlmostJavadoc", "ProtectedMembersInFinalClass", - "StaticAssignmentInConstructor", "InvalidBlockTag", ) //TODO gradually enable these checks @@ -458,6 +457,7 @@ tasks.withType(JavaCompile) { "NonCanonicalType", "InvalidInlineTag", "MutablePublicArray", + "StaticAssignmentInConstructor", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java index 91662eda2..3dd522910 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java @@ -19,7 +19,6 @@ package org.apache.fineract.common; import com.google.common.base.Preconditions; -import io.restassured.RestAssured; import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.ContentType; @@ -33,16 +32,14 @@ import io.restassured.specification.ResponseSpecification; */ public class RestAssuredFixture { - private final int httpPort; + private final int httpPort = 8443; private ResponseSpecification responseSpec; private RequestSpecification requestSpec; - public RestAssuredFixture(int httpPort) { + public RestAssuredFixture() { super(); - this.httpPort = httpPort; Utils.initializeRESTAssured(); - RestAssured.port = httpPort; this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java index e5b69b01b..f17ab7c4f 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java @@ -41,9 +41,9 @@ public class SpringBootServerLoginTest extends AbstractSpringBootWithMariaDB4jIn @Test @Disabled("Failing on Cloubees") public void hasPlatformStarted() { - util = new RestAssuredFixture(8443); + util = new RestAssuredFixture(); List> response = util.httpGet("/users"); assertThat(response.get(0).get("username"), is("mifos")); } -} \ No newline at end of file +} From 5a16d19564a6754e8787fd4bfe40bc9f54eb04ef Mon Sep 17 00:00:00 2001 From: percyashu Date: Tue, 30 Jun 2020 09:20:13 +0100 Subject: [PATCH 052/131] FINERACT-822 Enable ProtectedMembersInFinalClass check --- fineract-provider/build.gradle | 2 +- ...isioningEntriesReadPlatformServiceImpl.java | 2 +- .../dataqueries/domain/Report.java | 2 +- .../domain/ReportParameterUsage.java | 2 +- .../documentmanagement/domain/Image.java | 2 +- .../portfolio/client/domain/Client.java | 2 +- .../fineract/portfolio/group/domain/Group.java | 2 +- .../LoanRepaymentScheduleInstallment.java | 2 +- .../loanaccount/domain/LoanSummary.java | 2 +- .../paymentdetail/domain/PaymentDetail.java | 2 +- .../savings/data/FixedDepositProductData.java | 18 +++++++++--------- .../savings/domain/SavingsAccountSummary.java | 2 +- .../domain/SavingsAccountTransaction.java | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 4e4b4d8df..9c5dfaa89 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -395,7 +395,6 @@ tasks.withType(JavaCompile) { "InvalidParam", "ReturnFromVoid", "AlmostJavadoc", - "ProtectedMembersInFinalClass", "InvalidBlockTag", ) //TODO gradually enable these checks @@ -458,6 +457,7 @@ tasks.withType(JavaCompile) { "InvalidInlineTag", "MutablePublicArray", "StaticAssignmentInConstructor", + "ProtectedMembersInFinalClass", "OperatorPrecedence", "EqualsGetClass", "EqualsUnsafeCast", diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java index 915971d1c..69ec72865 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java @@ -67,7 +67,7 @@ public class ProvisioningEntriesReadPlatformServiceImpl implements ProvisioningE private final StringBuilder sqlQuery; - protected LoanProductProvisioningEntryMapper(String formattedDate) { + private LoanProductProvisioningEntryMapper(String formattedDate) { sqlQuery = new StringBuilder().append( "select if(loan.loan_type_enum=1, mclient.office_id, mgroup.office_id) as office_id, loan.loan_type_enum, pcd.criteria_id as criteriaid, loan.product_id,loan.currency_code,") .append("GREATEST(datediff(").append(formattedDate) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java index 8dbd633ec..b885361b2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java @@ -111,7 +111,7 @@ public final class Report extends AbstractPersistableCustom { return new Report(reportName, reportType, reportSubType, reportCategory, description, useReport, reportSql, reportTypes); } - protected Report() { + Report() { // } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java index 2cdc460a9..d7d2f3aef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java @@ -40,7 +40,7 @@ public final class ReportParameterUsage extends AbstractPersistableCustom { @Column(name = "report_parameter_name") private String reportParameterName; - protected ReportParameterUsage() { + ReportParameterUsage() { // } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java index b82b49b71..373900f87 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java @@ -38,7 +38,7 @@ public final class Image extends AbstractPersistableCustom { this.storageType = storageType.getValue(); } - protected Image() { + Image() { } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java index cd218e28a..097a537f0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java @@ -279,7 +279,7 @@ public final class Client extends AbstractPersistableCustom { savingsAccountId, dataOfBirth, gender, clientType, clientClassification, legalForm, isStaff); } - protected Client() { + Client() { this.setLegalForm(null); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java index 746b311a0..e318d4cea 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java @@ -148,7 +148,7 @@ public final class Group extends AbstractPersistableCustom { private List glimLoan; // JPA default constructor for entity - protected Group() { + Group() { this.name = null; this.externalId = null; this.clientMembers = new HashSet<>(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java index 7172f58b2..b81757121 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java @@ -132,7 +132,7 @@ public final class LoanRepaymentScheduleInstallment extends AbstractAuditableCus @JoinColumn(name = "loan_repayment_schedule_id", referencedColumnName = "id", nullable = false) private Set loanCompoundingDetails = new HashSet<>(); - protected LoanRepaymentScheduleInstallment() { + LoanRepaymentScheduleInstallment() { this.installmentNumber = null; this.fromDate = null; this.dueDate = null; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java index 0eb7da607..bf5ca2f21 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java @@ -121,7 +121,7 @@ public final class LoanSummary { return new LoanSummary(totalFeeChargesDueAtDisbursement); } - protected LoanSummary() { + LoanSummary() { // } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java index 0eaadb30d..8c0cbaecf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java @@ -55,7 +55,7 @@ public final class PaymentDetail extends AbstractPersistableCustom { @Column(name = "bank_number", length = 50) private String bankNumber; - protected PaymentDetail() { + PaymentDetail() { } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java index 7b580ebfa..2c61643e1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/FixedDepositProductData.java @@ -39,17 +39,17 @@ public final class FixedDepositProductData extends DepositProductData { // additional fields private boolean preClosurePenalApplicable; - protected BigDecimal preClosurePenalInterest; - protected EnumOptionData preClosurePenalInterestOnType; - protected Integer minDepositTerm; - protected Integer maxDepositTerm; + private BigDecimal preClosurePenalInterest; + private EnumOptionData preClosurePenalInterestOnType; + private Integer minDepositTerm; + private Integer maxDepositTerm; private EnumOptionData minDepositTermType; private EnumOptionData maxDepositTermType; - protected Integer inMultiplesOfDepositTerm; - protected EnumOptionData inMultiplesOfDepositTermType; - protected BigDecimal minDepositAmount; - protected BigDecimal depositAmount; - protected BigDecimal maxDepositAmount; + private Integer inMultiplesOfDepositTerm; + private EnumOptionData inMultiplesOfDepositTermType; + private BigDecimal minDepositAmount; + private BigDecimal depositAmount; + private BigDecimal maxDepositAmount; private Collection preClosurePenalInterestOnTypeOptions; private Collection periodFrequencyTypeOptions; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java index a15debd19..9bc437bff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountSummary.java @@ -82,7 +82,7 @@ public final class SavingsAccountSummary { @Column(name = "last_interest_calculation_date") private Date lastInterestCalculationDate; - protected SavingsAccountSummary() { + SavingsAccountSummary() { // } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java index bee444f50..bb7269d96 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java @@ -130,7 +130,7 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom { @JoinColumn(name = "savings_account_transaction_id", referencedColumnName = "id") private List notes = new ArrayList<>(); - protected SavingsAccountTransaction() { + SavingsAccountTransaction() { this.dateOf = null; this.typeOf = null; this.createdDate = null; From 1102d5b58af185db393482e3f4b74f3bb0470f39 Mon Sep 17 00:00:00 2001 From: percyashu Date: Thu, 2 Jul 2020 01:32:59 +0100 Subject: [PATCH 053/131] FINERACT-822 Enable StaticAssignmentInConstructor check --- .../java/org/apache/fineract/common/RestAssuredFixture.java | 6 ++++-- .../src/test/java/org/apache/fineract/common/Utils.java | 4 ++++ .../core/boot/tests/SpringBootServerLoginTest.java | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java index 3dd522910..e10b3febb 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java @@ -32,14 +32,16 @@ import io.restassured.specification.ResponseSpecification; */ public class RestAssuredFixture { - private final int httpPort = 8443; + private final int httpPort; private ResponseSpecification responseSpec; private RequestSpecification requestSpec; - public RestAssuredFixture() { + public RestAssuredFixture(int http) { super(); + this.httpPort = http; Utils.initializeRESTAssured(); + Utils.initializeRESTAssuredPort(http); this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java index f1cf5c260..22c2d4157 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java @@ -53,6 +53,10 @@ public class Utils { RestAssured.useRelaxedHTTPSValidation(); } + public static void initializeRESTAssuredPort(int http) { + RestAssured.port = http; + } + public static String loginIntoServerAndGetBase64EncodedAuthenticationKey() { try { LOG.info("-----------------------------------LOGIN-----------------------------------------"); diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java index f17ab7c4f..922bc5f54 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java @@ -41,7 +41,7 @@ public class SpringBootServerLoginTest extends AbstractSpringBootWithMariaDB4jIn @Test @Disabled("Failing on Cloubees") public void hasPlatformStarted() { - util = new RestAssuredFixture(); + util = new RestAssuredFixture(8443); List> response = util.httpGet("/users"); assertThat(response.get(0).get("username"), is("mifos")); } From 3f444e2710c7fbdacf71c7f3dd5273602ed866ca Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Sat, 4 Jul 2020 07:25:51 +0300 Subject: [PATCH 054/131] FINERACT-1072: Implementing Spotless for Gradle files --- fineract-provider/build.gradle | 229 +++++++++++++++----------- fineract-provider/dependencies.gradle | 18 +- 2 files changed, 144 insertions(+), 103 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 9c5dfaa89..e21ae8126 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -37,9 +37,9 @@ buildscript { dependencies { classpath 'io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE' classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1', - 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0', - 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10', - 'org.springframework.boot:spring-boot-gradle-plugin:2.2.7.RELEASE' + 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0', + 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10', + 'org.springframework.boot:spring-boot-gradle-plugin:2.2.7.RELEASE' // below classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' @@ -184,7 +184,10 @@ eclipse System.setProperty("openjpa.Log", "commons") openjpa { - includes = ['**/AbstractPersistableCustom.class', '**/domain/*.class'] + includes = [ + '**/AbstractPersistableCustom.class', + '**/domain/*.class' + ] enhance { enforcePropertyRestrictions true } @@ -218,24 +221,32 @@ jacocoTestReport{ } spotless { - format 'misc', { - target '**/*.md', '**/*.properties', '**/*.gradle', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql' - targetExclude '**/build/**', '**/bin/**', '**/.settings/**','**/.idea/**' - indentWithSpaces(4) - endWithNewline() - trimTrailingWhitespace() - } + format 'misc', { + target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql' + targetExclude '**/build/**', '**/bin/**', '**/.settings/**','**/.idea/**' + indentWithSpaces(4) + endWithNewline() + trimTrailingWhitespace() + } - java { - importOrder() //sort imports alphabetically - removeUnusedImports() - eclipse().configFile '../config/fineractdev-formatter.xml' - endWithNewline() - trimTrailingWhitespace() + groovyGradle { + target '*.gradle', '**/*.gradle' + greclipse() + indentWithSpaces(4) + endWithNewline() + trimTrailingWhitespace() + } - // Enforce style modifier order - custom 'Modifier ordering', { - def modifierRanking = [ + java { + importOrder() //sort imports alphabetically + removeUnusedImports() + eclipse().configFile '../config/fineractdev-formatter.xml' + endWithNewline() + trimTrailingWhitespace() + + // Enforce style modifier order + custom 'Modifier ordering', { + def modifierRanking = [ public : 1, protected : 2, private : 3, @@ -248,20 +259,20 @@ spotless { synchronized: 10, native : 11, strictfp : 12] - // Find any instance of multiple modifiers. Lead with a non-word character to avoid - // accidental matching against for instance, "an alternative default value" - it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { - // Do not replace the leading non-word character. Identify the modifiers - it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { - // Sort the modifiers according to the ranking above - it.split().sort({ modifierRanking[it] }).join(' ') + ' ' - } - ) + // Find any instance of multiple modifiers. Lead with a non-word character to avoid + // accidental matching against for instance, "an alternative default value" + it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { + // Do not replace the leading non-word character. Identify the modifiers + it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { + // Sort the modifiers according to the ranking above + it.split().sort({ modifierRanking[it] }).join(' ') + ' ' + } + ) + } + ) } - ) - } - } + } lineEndings 'UNIX' } @@ -309,7 +320,6 @@ rat { '**/native/**', '**/wrapper/**', '**/build/**', - //Api Docs '**/api-docs/*.*', '**/docs/system-architecture/.htaccess', @@ -318,14 +328,11 @@ rat { '**/docs/system-architecture/**/*.xml', '**/bootstrap-3.0.0/assets/application.js', '**/system-architecture/js/plugins.js', - //Apache License '**/bootstrap-3.0.0/assets/less.js', '**/css/bootstrap-3.0.0/**/*.*', - //Public Domain See http://www.JSON.org/js.html '**/bootstrap-3.0.0/assets/json2.js.htm', - // MIT License '**/modernizr-2.6.2.min.js', '**/css/normalize.css', @@ -340,12 +347,10 @@ rat { '**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js', '**/assets/respond.min.js', '**/assets/html5shiv.js', - //BSD License '**/assets/uglify.js', //Ignore out folder '**/out/**', - // Git build info "**/git.properties", ] @@ -374,13 +379,34 @@ configurations { } tasks.withType(JavaCompile) { - options.compilerArgs += ["-Xlint:unchecked","-Xlint:cast","-Xlint:auxiliaryclass","-Xlint:deprecation", - "-Xlint:dep-ann","-Xlint:divzero","-Xlint:empty","-Xlint:exports","-Xlint:fallthrough", - "-Xlint:finally","-Xlint:module","-Xlint:opens","-Xlint:options","-Xlint:overloads", - "-Xlint:overrides","-Xlint:path","-Xlint:processing","-Xlint:removal", - "-Xlint:requires-automatic","-Xlint:requires-transitive-automatic","-Xlint:try", - "-Xlint:varargs","-Xlint:preview","-Xlint:static","-Werror"] - // TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X") + options.compilerArgs += [ + "-Xlint:unchecked", + "-Xlint:cast", + "-Xlint:auxiliaryclass", + "-Xlint:deprecation", + "-Xlint:dep-ann", + "-Xlint:divzero", + "-Xlint:empty", + "-Xlint:exports", + "-Xlint:fallthrough", + "-Xlint:finally", + "-Xlint:module", + "-Xlint:opens", + "-Xlint:options", + "-Xlint:overloads", + "-Xlint:overrides", + "-Xlint:path", + "-Xlint:processing", + "-Xlint:removal", + "-Xlint:requires-automatic", + "-Xlint:requires-transitive-automatic", + "-Xlint:try", + "-Xlint:varargs", + "-Xlint:preview", + "-Xlint:static", + "-Werror" + ] + // TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X") options.deprecation = true options.errorprone { @@ -396,7 +422,7 @@ tasks.withType(JavaCompile) { "ReturnFromVoid", "AlmostJavadoc", "InvalidBlockTag", - ) + ) //TODO gradually enable these checks error( "DefaultCharset", @@ -468,28 +494,33 @@ tasks.withType(JavaCompile) { "ModifiedButNotUsed", "InconsistentCapitalization", "MissingOverride", -// "InvalidBlockTag", -// "InconsistentOverloads", -// "MethodCanBeStatic", -// "Var", -// "ConstantField", -// "UnnecessaryDefaultInEnumSwitch", -// "FieldCanBeFinal" - ) + // "InvalidBlockTag", + // "InconsistentOverloads", + // "MethodCanBeStatic", + // "Var", + // "ConstantField", + // "UnnecessaryDefaultInEnumSwitch", + // "FieldCanBeFinal" + ) } - options.compilerArgs +=["-Xmaxwarns",1500,"-Xmaxerrs",1500] + options.compilerArgs +=[ + "-Xmaxwarns", + 1500, + "-Xmaxerrs", + 1500 + ] } apply from: 'dependencies.gradle' /* TODO https://issues.apache.org/jira/browse/FINERACT-939 (dev-dependencies.gradle has been removed, as totally broken) -// Pick up dependencies based on the environment, defaults to production -if (project.hasProperty('env') && project.getProperty('env') == 'dev') { - apply from: 'dev-dependencies.gradle' -} else { - apply from: 'dependencies.gradle' -} -*/ + // Pick up dependencies based on the environment, defaults to production + if (project.hasProperty('env') && project.getProperty('env') == 'dev') { + apply from: 'dev-dependencies.gradle' + } else { + apply from: 'dependencies.gradle' + } + */ /* Enable Oauth2 authentication based on environment, default to HTTP basic auth */ if (project.hasProperty('security') && project.getProperty('security') == 'oauth') { @@ -539,7 +570,7 @@ modernizer { exclusions = [] exclusionPatterns = [ - // To be removed when https://issues.apache.org/jira/browse/FINERACT-826 is fixed + // To be removed when https://issues.apache.org/jira/browse/FINERACT-826 is fixed 'org/joda/time/.*' ] } @@ -550,25 +581,29 @@ compileJava{ finalizedBy resolve } /* -pmd { - sourceSets = [sourceSets.main] -} -*/ + pmd { + sourceSets = [sourceSets.main] + } + */ war { - from('../licenses/binary/') { // notice the parens + from('../licenses/binary/') { + // notice the parens into "WEB-INF/licenses/binary/" // no leading slash } - from('../LICENSE_RELEASE') { // notice the parens + from('../LICENSE_RELEASE') { + // notice the parens into "WEB-INF/" // no leading slash } - from('../NOTICE_RELEASE') { // notice the parens + 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 + from('../DISCLAIMER') { + // notice the parens into "WEB-INF/" // no leading slash } war.finalizedBy(bootWar) @@ -589,42 +624,46 @@ license { } task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License) { - source = fileTree(dir: '../', includes: ['**/*.bat', '**/*.sh', '**/*.sql']) + source = fileTree(dir: '../', includes: [ + '**/*.bat', + '**/*.sh', + '**/*.sql' + ]) } licenseFormat.dependsOn licenseFormatBuildScripts configurations { - tomcat + tomcat } dependencies { - tomcat "org.apache.tomcat:tomcat:9.0.36@zip" + tomcat "org.apache.tomcat:tomcat:9.0.36@zip" } dependencies { errorprone "com.google.errorprone:error_prone_core:2.4.0" } cargo { - containerId "tomcat9x" + containerId "tomcat9x" - local { - installer { - installConfiguration = configurations.tomcat - downloadDir = file("$buildDir/download") - extractDir = file("$buildDir/tomcat") + local { + installer { + installConfiguration = configurations.tomcat + downloadDir = file("$buildDir/download") + extractDir = file("$buildDir/tomcat") + } + startStopTimeout = 240000 + containerProperties { + property 'cargo.tomcat.connector.keystoreFile', file('src/main/resources/keystore.jks') + property 'cargo.tomcat.connector.keystorePass', 'openmf' + property 'cargo.tomcat.httpSecure', true + property 'cargo.tomcat.connector.sslProtocol', 'TLS' + property 'cargo.tomcat.connector.clientAuth', false + property 'cargo.protocol', 'https' + property 'cargo.servlet.port', 8443 + } } - startStopTimeout = 240000 - containerProperties { - property 'cargo.tomcat.connector.keystoreFile', file('src/main/resources/keystore.jks') - property 'cargo.tomcat.connector.keystorePass', 'openmf' - property 'cargo.tomcat.httpSecure', true - property 'cargo.tomcat.connector.sslProtocol', 'TLS' - property 'cargo.tomcat.connector.clientAuth', false - property 'cargo.protocol', 'https' - property 'cargo.servlet.port', 8443 - } - } } cargoRunLocal.dependsOn bootWar @@ -655,7 +694,7 @@ if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) { } sourceSets { - integrationTest { + integrationTest { compileClasspath += main.output + test.output runtimeClasspath += main.output + test.output } @@ -677,7 +716,8 @@ task integrationTest(type:Test) { integrationTest { useJUnitPlatform() - testLogging { // FINERACT-927 + testLogging { + // FINERACT-927 events "skipped", "failed" showStandardStreams = false exceptionFormat "full" @@ -685,7 +725,8 @@ integrationTest { } test { useJUnitPlatform() - testLogging { // FINERACT-927 + testLogging { + // FINERACT-927 events "skipped", "failed" showStandardStreams = false exceptionFormat "full" diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index c8b8d0c36..700d5a122 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -71,16 +71,16 @@ dependencies { 'com.github.spullara.mustache.java:compiler', 'com.jayway.jsonpath:json-path', - // JAX-B dependencies for JDK 9+ - 'jakarta.xml.bind:jakarta.xml.bind-api', + // JAX-B dependencies for JDK 9+ + 'jakarta.xml.bind:jakarta.xml.bind-api', - 'org.dom4j:dom4j', + 'org.dom4j:dom4j', - 'javax.cache:cache-api', + 'javax.cache:cache-api', - 'com.github.spotbugs:spotbugs-annotations', - 'io.swagger.core.v3:swagger-annotations' - ) + 'com.github.spotbugs:spotbugs-annotations', + 'io.swagger.core.v3:swagger-annotations' + ) implementation ('org.apache.activemq:activemq-broker') { exclude group: 'org.apache.geronimo.specs' } @@ -114,7 +114,7 @@ dependencies { // 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! @@ -124,7 +124,7 @@ dependencies { '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('org.mock-server:mockserver-junit-jupiter') { exclude group: 'com.sun.mail', module: 'mailapi' exclude group: 'javax.servlet', module: 'javax.servlet-api' From 750024ba7a4334508f0944bb42808341d664aef6 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 4 Jul 2020 22:41:11 +0000 Subject: [PATCH 055/131] Update dependency com.diffplug.spotless:spotless-plugin-gradle to v4.5.1 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index e21ae8126..25af117cf 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -48,7 +48,7 @@ buildscript { classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" - classpath "com.diffplug.spotless:spotless-plugin-gradle:4.5.0" + classpath "com.diffplug.spotless:spotless-plugin-gradle:4.5.1" classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.3" } } From c20329cd07ee58158320fe1b688894b227548431 Mon Sep 17 00:00:00 2001 From: percyashu Date: Tue, 30 Jun 2020 06:17:09 +0100 Subject: [PATCH 056/131] FINERACT-1023 Update spring boot gradle plugin from v2.2.7 to v2.3.1 --- fineract-provider/build.gradle | 3 ++- fineract-provider/dependencies.gradle | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 25af117cf..e3bab486a 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -39,7 +39,7 @@ buildscript { classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1', 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0', 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10', - 'org.springframework.boot:spring-boot-gradle-plugin:2.2.7.RELEASE' + 'org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE' // below classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' @@ -108,6 +108,7 @@ dependencyManagement { dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4' dependency 'jakarta.jms:jakarta.jms-api:2.0.3' dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' + dependency 'jakarta.validation:jakarta.validation-api:2.0.2' dependency 'org.apache.activemq:activemq-broker:5.16.0' dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' dependency 'org.mockito:mockito-core:3.3.3' diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 700d5a122..4e6c42e04 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -52,7 +52,7 @@ dependencies { 'com.squareup.retrofit:retrofit', 'jakarta.jms:jakarta.jms-api', 'jakarta.management.j2ee:jakarta.management.j2ee-api', - + 'jakarta.validation:jakarta.validation-api', 'com.squareup.okhttp:okhttp', 'com.squareup.okhttp:okhttp-urlconnection', From 06ab553d92c63dabeba4a5390e11b1c857719fe8 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Sat, 4 Jul 2020 21:30:31 +0530 Subject: [PATCH 057/131] FINERACT-821 Added ClassTypeParameterName Checkstyle --- fineract-provider/config/checkstyle/checkstyle.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml index b94e3f803..3f29e719e 100644 --- a/fineract-provider/config/checkstyle/checkstyle.xml +++ b/fineract-provider/config/checkstyle/checkstyle.xml @@ -161,6 +161,11 @@ + + + + @@ -228,11 +233,7 @@ - - - - + From e4d6cc543ebeab3f9d078553156e5e20f32e3dec Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Sat, 4 Jul 2020 14:33:47 +0300 Subject: [PATCH 058/131] FINERACT-1074: Sorting out plugin configurations --- fineract-provider/build.gradle | 93 +++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index e3bab486a..2bb6b52e0 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -20,10 +20,17 @@ description = '''\ Run as: gradle clean bootRun''' +group = 'org.apache.fineract' +buildDir = new File(rootProject.projectDir, "../build") + +repositories { + jcenter() + mavenCentral() +} + project.ext.jerseyVersion = '1.19.4' ext["groovy.version"] = '3.0.3' - buildscript { ext { jacocoVersion = '0.8.5' @@ -36,11 +43,10 @@ buildscript { dependencies { classpath 'io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE' - classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1', - 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0', - 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10', - 'org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE' - // below + classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1' + classpath 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10' + classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE' + classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0' classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0' @@ -56,7 +62,7 @@ buildscript { apply plugin: 'io.spring.dependency-management' apply plugin: "org.nosphere.apache.rat" apply plugin: 'rebel' -apply plugin: 'license' +apply plugin: 'com.github.hierynomus.license' apply plugin: 'war' apply plugin: 'org.springframework.boot' apply plugin: 'eclipse' @@ -158,16 +164,6 @@ sourceCompatibility = JavaVersion.VERSION_11 /* define binary compatibility version */ targetCompatibility = JavaVersion.VERSION_11 -project.ext.mysqlUser='root' -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) -} - // If we are running Gradle within Eclipse to enhance classes with OpenJPA, // set the classes directory to point to Eclipse's default build directory if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') @@ -182,6 +178,8 @@ eclipse } } +// Configuration for the OpenJPA enhance task +// https://github.com/radcortez/openjpa-gradle-plugin System.setProperty("openjpa.Log", "commons") openjpa { @@ -210,17 +208,18 @@ resolve { jacoco { toolVersion = jacocoVersion reportsDir = file("$buildDir/reports/jacoco") - } -jacocoTestReport{ - reports{ +jacocoTestReport { + reports { html.enabled=true xml.enabled=true html.destination file("${buildDir}/code-coverage") } } +// Configuration for the spotless plugin +// https://github.com/diffplug/spotless/tree/main/plugin-gradle spotless { format 'misc', { target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql' @@ -272,7 +271,6 @@ spotless { } ) } - } lineEndings 'UNIX' @@ -306,7 +304,7 @@ rat { '**/.gitignore', '**/.gitkeep', '**/*.iml', - //Notice files + // Notice files '**/NOTICE_RELEASE', '**/NOTICE_SOURCE', // Swagger License @@ -321,7 +319,7 @@ rat { '**/native/**', '**/wrapper/**', '**/build/**', - //Api Docs + // Api Docs '**/api-docs/*.*', '**/docs/system-architecture/.htaccess', '**/docs/system-architecture/404.html', @@ -329,10 +327,10 @@ rat { '**/docs/system-architecture/**/*.xml', '**/bootstrap-3.0.0/assets/application.js', '**/system-architecture/js/plugins.js', - //Apache License + // Apache License '**/bootstrap-3.0.0/assets/less.js', '**/css/bootstrap-3.0.0/**/*.*', - //Public Domain See http://www.JSON.org/js.html + // Public Domain See http://www.JSON.org/js.html '**/bootstrap-3.0.0/assets/json2.js.htm', // MIT License '**/modernizr-2.6.2.min.js', @@ -348,9 +346,9 @@ rat { '**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js', '**/assets/respond.min.js', '**/assets/html5shiv.js', - //BSD License + // BSD License '**/assets/uglify.js', - //Ignore out folder + // Ignore out folder '**/out/**', // Git build info "**/git.properties", @@ -554,6 +552,8 @@ if (project.hasProperty('security') && project.getProperty('security') == 'oauth } } +// Configuration for the modernizer plugin +// https://github.com/andygoossens/gradle-modernizer-plugin modernizer { includeTestClasses = true failOnViolations = true @@ -581,11 +581,6 @@ compileJava{ dependsOn spotlessCheck finalizedBy resolve } -/* - pmd { - sourceSets = [sourceSets.main] - } - */ war { from('../licenses/binary/') { @@ -610,6 +605,8 @@ war { war.finalizedBy(bootWar) } +// Configuration for Gradle license plug-in +// https://github.com/hierynomus/license-gradle-plugin license { header rootProject.file('../APACHE_LICENSETEXT.md') excludes([ @@ -633,6 +630,14 @@ task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License) } licenseFormat.dependsOn licenseFormatBuildScripts +// Configuration for the errorprone plugin +// https://github.com/tbroyer/gradle-errorprone-plugin +dependencies { + errorprone "com.google.errorprone:error_prone_core:2.4.0" +} + +// Configuration for the Gradle Cargo plugin +// https://github.com/bmuschko/gradle-cargo-plugin configurations { tomcat @@ -642,9 +647,6 @@ dependencies { tomcat "org.apache.tomcat:tomcat:9.0.36@zip" } -dependencies { - errorprone "com.google.errorprone:error_prone_core:2.4.0" -} cargo { containerId "tomcat9x" @@ -734,19 +736,25 @@ test { } } +// Configuration for the Checkstyle plugin +// https://docs.gradle.org/current/userguide/checkstyle_plugin.html +dependencies { + checkstyle 'com.puppycrawl.tools:checkstyle:8.34' + checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.37.1' +} +// Configuration for SQL tasks +// https://docs.groovy-lang.org/latest/html/api/groovy/sql/Sql.html import groovy.sql.Sql -repositories { - mavenCentral() -} +project.ext.mysqlUser='root' +project.ext.mysqlPassword='mysql' + configurations { driver } dependencies { driver 'org.drizzle.jdbc:drizzle-jdbc:1.4' - checkstyle 'com.puppycrawl.tools:checkstyle:8.34' - checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.37.1' } URLClassLoader loader = GroovyObject.class.classLoader @@ -790,6 +798,9 @@ bootJar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } +// Configuration for spotbugs plugin +// https://github.com/spotbugs/spotbugs-gradle-plugin + // To generate an HTML report instead of XML spotbugs { reportLevel = 'high' @@ -821,6 +832,8 @@ spotbugsIntegrationTest { } } +// Configuration for git properties gradle plugin +// https://github.com/n0mer/gradle-git-properties gitProperties { gitPropertiesResourceDir = "$buildDir/classes/java/main/resources" dateFormat = "yyyy-MM-dd'T'HH:mmZ" From b45b4eb6674a60a0c4b6d2e10e9519a2c2c5fe91 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 5 Jul 2020 19:55:52 +0000 Subject: [PATCH 059/131] Update dependency org.apache.tomcat:tomcat to v9.0.37 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 2bb6b52e0..ff5af1f49 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -644,7 +644,7 @@ configurations } dependencies { - tomcat "org.apache.tomcat:tomcat:9.0.36@zip" + tomcat "org.apache.tomcat:tomcat:9.0.37@zip" } cargo { From 457b0544d31b895b455d2141e5a41060d2a74cee Mon Sep 17 00:00:00 2001 From: Awasum Yannick Date: Sun, 5 Jul 2020 22:38:43 +0100 Subject: [PATCH 060/131] FINERACT-1079: Run spotlessApply before compileJava task --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index ff5af1f49..838c59a74 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -578,7 +578,7 @@ modernizer { compileJava{ dependsOn rat - dependsOn spotlessCheck + dependsOn spotlessApply finalizedBy resolve } From d62f9ecc8aefe364e4b19847ed591bd241e82091 Mon Sep 17 00:00:00 2001 From: Awasum Yannick Date: Mon, 6 Jul 2020 06:33:17 +0100 Subject: [PATCH 061/131] Revert "FINERACT-1079: Run spotlessApply before compileJava task" This reverts commit 457b0544d31b895b455d2141e5a41060d2a74cee. --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 838c59a74..ff5af1f49 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -578,7 +578,7 @@ modernizer { compileJava{ dependsOn rat - dependsOn spotlessApply + dependsOn spotlessCheck finalizedBy resolve } From 333759f2aaf056831620cff8467b17833d7d7634 Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Mon, 6 Jul 2020 12:44:45 +0300 Subject: [PATCH 062/131] FINERACT-1079: Run spotlessCheck for automated builds, spotlessApply for manual ones --- .travis.yml | 2 +- Dockerfile | 2 +- fineract-provider/build.gradle | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 184a4516d..60a35f49b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,6 @@ script: # and Docker test does not run if integration test fails, which makes PR failure easier to understand. # @see https://docs.travis-ci.com/user/job-lifecycle/#customizing-the-build-phase # NOTE: Sleep after docker-compose increased to 60 seconds as often Travis would fail to get Docker up in 30 seconds - - ./gradlew --console=plain -q licenseMain licenseTest licenseIntegrationTest check && ./gradlew --console=plain integrationTest --fail-fast && sudo service mysql stop && docker-compose build && docker-compose up -d && sleep 60s && http --verify=no --timeout 240 --check-status get https://localhost:8443/fineract-provider/actuator/health && (( $(http --verify=no --timeout 30 --check-status --body get https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 )) + - ./gradlew --console=plain -PautomatedBuild=true -q licenseMain licenseTest licenseIntegrationTest check && ./gradlew --console=plain -PautomatedBuild=true integrationTest --fail-fast && sudo service mysql stop && docker-compose build && docker-compose up -d && sleep 60s && http --verify=no --timeout 240 --check-status get https://localhost:8443/fineract-provider/actuator/health && (( $(http --verify=no --timeout 30 --check-status --body get https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 )) # We stop the mysql system service when running the Docker test to avoid port 3306 conflicts (unless we run the mysql in docker-compose on another port; req. FINERACT-773) # The fany /actuator/info test makes sure that has more than 100 characters of JSON to test that the git.properties worked (see FINERACT-983) diff --git a/Dockerfile b/Dockerfile index fa32a21d0..bfc5350b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get update -qq && apt-get install -y wget COPY . fineract WORKDIR /fineract -RUN ./gradlew --no-daemon -q -x rat -x test bootJar +RUN ./gradlew -PautomatedBuild=true --no-daemon -q -x rat -x test bootJar WORKDIR /fineract/target RUN jar -xf /fineract/build/libs/fineract-provider.jar diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index ff5af1f49..d783ccb25 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -576,10 +576,15 @@ modernizer { ] } -compileJava{ +compileJava { dependsOn rat - dependsOn spotlessCheck finalizedBy resolve + + if (project.hasProperty("automatedBuild")) { + dependsOn(spotlessCheck) + } else { + dependsOn(spotlessApply) + } } war { From 33dedd06f46fcb6c388263a31ae663f9c680a370 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 10 Jul 2020 20:31:29 +0000 Subject: [PATCH 063/131] Update dependency org.mockito:mockito-core to v3.4.0 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index d783ccb25..d232416be 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -117,7 +117,7 @@ dependencyManagement { dependency 'jakarta.validation:jakarta.validation-api:2.0.2' dependency 'org.apache.activemq:activemq-broker:5.16.0' dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' - dependency 'org.mockito:mockito-core:3.3.3' + dependency 'org.mockito:mockito-core:3.4.0' dependency 'org.mockito:mockito-junit-jupiter:3.3.3' dependency 'io.github.classgraph:classgraph:4.8.87' dependency 'org.awaitility:awaitility:4.0.3' From d24e0c57f5b9b32bed5945ac38ebeed76878d844 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 13 Jul 2020 15:12:29 +0000 Subject: [PATCH 064/131] Update dependency org.flywaydb:flyway-core to v6.5.1 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index d232416be..d50840785 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -102,7 +102,7 @@ dependencyManagement { dependency 'org.drizzle.jdbc:drizzle-jdbc:1.4' dependency 'com.github.librepdf:openpdf:1.3.20' dependency 'org.mnode.ical4j:ical4j:3.0.19' - dependency 'org.flywaydb:flyway-core:6.5.0' + dependency 'org.flywaydb:flyway-core:6.5.1' dependency 'org.quartz-scheduler:quartz:2.3.2' dependency 'com.amazonaws:aws-java-sdk-s3:1.11.816' dependency 'org.ehcache:ehcache:3.8.1' From 6a8a9936708a31c4b167e343ccff744ad8ab57bf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 11 Jul 2020 00:47:05 +0000 Subject: [PATCH 065/131] Update dependency org.mockito:mockito-junit-jupiter to v3.4.0 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index d50840785..cacb3d108 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -118,7 +118,7 @@ dependencyManagement { dependency 'org.apache.activemq:activemq-broker:5.16.0' dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' dependency 'org.mockito:mockito-core:3.4.0' - dependency 'org.mockito:mockito-junit-jupiter:3.3.3' + dependency 'org.mockito:mockito-junit-jupiter:3.4.0' dependency 'io.github.classgraph:classgraph:4.8.87' dependency 'org.awaitility:awaitility:4.0.3' dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' From a440d56392a2415cc883cfb4e50641b6a37a8480 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Thu, 9 Jul 2020 01:57:51 +0530 Subject: [PATCH 066/131] FINERACT-1044 Added redirects in swagger-ui --- .../infrastructure/core/boot/WebFrontEndConfiguration.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java index c90b2a65d..4b58a8ade 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java @@ -21,6 +21,7 @@ package org.apache.fineract.infrastructure.core.boot; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @EnableWebMvc @@ -41,4 +42,10 @@ public class WebFrontEndConfiguration implements WebMvcConfigurer { registry.addResourceHandler("/swagger-ui/**").addResourceLocations(SWAGGER_RESOURCE_LOCATIONS); } + + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addRedirectViewController("/swagger-ui", "/swagger-ui/index.html"); + registry.addRedirectViewController("/swagger-ui/", "/swagger-ui/index.html"); + } } From acca72f83d6772927b0406a0a4261509c93708dd Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Thu, 9 Jul 2020 10:04:22 +0300 Subject: [PATCH 067/131] FINERACT-835: Complete work on automatically generating Swagger docs --- fineract-provider/build.gradle | 4 +- .../config/swagger/fineract-input.json | 16 + fineract-provider/dependencies.gradle | 3 +- .../core/boot/WebFrontEndConfiguration.java | 14 +- .../resources/static/swagger-ui/response.json | 55427 ---------------- 5 files changed, 31 insertions(+), 55433 deletions(-) create mode 100644 fineract-provider/config/swagger/fineract-input.json delete mode 100644 fineract-provider/src/main/resources/static/swagger-ui/response.json diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index cacb3d108..1c7a6fa4e 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -124,9 +124,8 @@ dependencyManagement { dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' dependency 'javax.cache:cache-api:1.1.1' dependency 'org.mock-server:mockserver-junit-jupiter:5.10.0' - - // If this is upgraded, you need to change path in WebFrontEndConfiguration dependency 'org.webjars.npm:swagger-ui-dist:3.28.0' + dependency 'org.webjars:webjars-locator-core:0.46' dependency ('org.dom4j:dom4j:2.1.3') { exclude 'relaxngDatatype:relaxngDatatype' // already in com.sun.xml.bind:jaxb-osgi:2.3.0.1 @@ -201,6 +200,7 @@ resolve { prettyPrint = 'TRUE' classpath = sourceSets.main.runtimeClasspath outputDir = file("${buildDir}/classes/java/main/static/swagger-ui") + openApiFile = file("config/swagger/fineract-input.json") } // Configuration for JaCoCo code coverage task diff --git a/fineract-provider/config/swagger/fineract-input.json b/fineract-provider/config/swagger/fineract-input.json new file mode 100644 index 000000000..264ad5629 --- /dev/null +++ b/fineract-provider/config/swagger/fineract-input.json @@ -0,0 +1,16 @@ +{ + "openapi" : "3.0.3", + "info": { + "version": "1.4.0", + "title": "Apache Fineract", + "description": "Apache Fineract is a secure, multi-tenanted microfinance platform\n\nThe goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform
              The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation\n\n- The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top)\n- You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact)\n- The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts)\n- Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers)\n- For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview)\n- Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors)\n\nPlease refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries", + "termsOfService": "https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm", + "contact": { + "email": "dev@fineract.apache.org" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + } +} diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 4e6c42e04..3a84a62e2 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -79,7 +79,8 @@ dependencies { 'javax.cache:cache-api', 'com.github.spotbugs:spotbugs-annotations', - 'io.swagger.core.v3:swagger-annotations' + 'io.swagger.core.v3:swagger-annotations', + 'org.webjars:webjars-locator-core' ) implementation ('org.apache.activemq:activemq-broker') { exclude group: 'org.apache.geronimo.specs' diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java index 4b58a8ade..03068f3b5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java @@ -18,16 +18,21 @@ */ package org.apache.fineract.infrastructure.core.boot; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.webjars.WebJarAssetLocator; @EnableWebMvc @Configuration public class WebFrontEndConfiguration implements WebMvcConfigurer { + private static final Logger LOG = LoggerFactory.getLogger(WebFrontEndConfiguration.class); + private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { "classpath:/static/", "classpath:/public/" }; @Override @@ -36,9 +41,12 @@ public class WebFrontEndConfiguration implements WebMvcConfigurer { registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); } - // TODO: The below path should be version agnostic - String[] SWAGGER_RESOURCE_LOCATIONS = { "classpath:/static/swagger-ui/", - "classpath:/META-INF/resources/webjars/swagger-ui-dist/3.26.0/" }; + WebJarAssetLocator locator = new WebJarAssetLocator(); + String fullPathToSwaggerUiJs = locator.getFullPath("swagger-ui.js"); + LOG.info("Found Swagger UI at {}", fullPathToSwaggerUiJs); + String fullPathToSwaggerUi = fullPathToSwaggerUiJs.substring(0, fullPathToSwaggerUiJs.lastIndexOf("/") + 1); + + String[] SWAGGER_RESOURCE_LOCATIONS = { "classpath:/static/swagger-ui/", "classpath:" + fullPathToSwaggerUi }; registry.addResourceHandler("/swagger-ui/**").addResourceLocations(SWAGGER_RESOURCE_LOCATIONS); } diff --git a/fineract-provider/src/main/resources/static/swagger-ui/response.json b/fineract-provider/src/main/resources/static/swagger-ui/response.json deleted file mode 100644 index 90c5ea400..000000000 --- a/fineract-provider/src/main/resources/static/swagger-ui/response.json +++ /dev/null @@ -1,55427 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "Apache Fineract is a secure, multi-tenanted microfinance platform.
              The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform. The reference app [ https://demo.openmf.org ] (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation.
              The API is organized around REST [ https://en.wikipedia.org/wiki/Representational_state_transfer ]
              Find out more about Apache Fineract on [ https://demo.openmf.org/api-docs/apiLive.htm#top ]
              You can Try The API From Your Browser itself at [ https://demo.openmf.org/api-docs/apiLive.htm#interact ]
              The Generic Options are available at [ https://demo.openmf.org/api-docs/apiLive.htm#genopts ]
              Find out more about Updating Dates and Numbers at [ https://demo.openmf.org/api-docs/apiLive.htm#dates_and_numbers ]
              For the Authentication and the Basic of HTTP and HTTPS refer [ https://demo.openmf.org/api-docs/apiLive.htm#authentication_overview ]
              Check about ERROR codes at [ https://demo.openmf.org/api-docs/apiLive.htm#errors ]

              Please refer to the old documentation for any documentation queries [ https://demo.openmf.org/api-docs/apiLive.htm ]
              ______________________________________________________________________________________________________________________________ ", - "version": "1.0.0", - "title": "Apache Fineract API Documentation", - "termsOfService": "https://demo.openmf.org/api-docs/apiLive.htm", - "contact": { - "name": "https://gitter.im/openMF/mifos" - } - }, - "host": "https://demo.openmf.org", - "basePath": "/fineract-provider/api/v1", - "tags": [ - { - "name": "Periodic Accrual Accounting", - "description": "Periodic Accrual is to accrue the loan income till the specific date or till batch job scheduled time.\n" - }, - { - "name": "Accounting Closure", - "description": "An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date\n\nField Descriptions\nclosingDate\nThe date for which the accounting closure is defined\nofficeId\nThe identifer of the branch for which accounting has been closed\ncomments\nDescription associated with an Accounting closure" - }, - { - "name": "Mapping Financial Activities to Accounts", - "description": "Organization Level Financial Activities like Asset and Liability Transfer can be mapped to GL Account. Integrated accounting takes these accounts into consideration when an Account transfer is made between a savings to loan/savings account and vice-versa\n\nField Descriptions\nfinancialActivityId\nThe identifier of the Financial Activity\nglAccountId\nThe identifier of a GL Account ( Ledger Account) which shall be used as the default account for the selected Financial Activity" - }, - { - "name": "General Ledger Account", - "description": "Ledger accounts represent an Individual account within an Organizations Chart Of Accounts(COA) and are assigned a name and unique number by which they can be identified. \nAll transactions relating to a company's assets, liabilities, owners' equity, revenue and expenses are recorded against these accounts" - }, - { - "name": "Journal Entries", - "description": "A journal entry refers to the logging of transactions against general ledger accounts. A journal entry may consist of several line items, each of which is either a \"debit\" or a \"credit\". The total amount of the debits must equal the total amount of the credits or the journal entry is said to be \"unbalanced\" \n\nA journal entry directly changes the account balances on the general ledger" - }, - { - "name": "Provisioning Entries", - "description": "This defines the Provisioning Entries for all active loan products\n\nField Descriptions\ndate\nDate on which day provisioning entries should be created\ncreatejournalentries\nBoolean variable whether to add journal entries for generated provisioning entries\n" - }, - { - "name": "Accounting Rules", - "description": "It is typical scenario in MFI's that non accountants pass journal entries on a regular basis. For Ex: A branch office might deposit their entire cash at hand to their Bank account at the end of a working day. The branch office users might not understand enough of accounting to figure out which account needs to get credited and which account needs to be debited to represent this transaction.\n\nEnter accounting rules, an abstraction on top of manual Journal entires for enabling simpler data entry. An accounting rule can define any of the following abstractions\n\nA Simple journal entry where both the credit and debit account have been preselected\nA Simple journal entry where either credit or debit accounts have been limited to a pre-selected list of accounts (Ex: Debit account should be one of \"Bank of America\" of \"JP Morgan\" and credit account should be \"Cash\")\nA Compound journal entry where multiple debits and / or multiple credits may be made amongst a set of preselected list of accounts (Ex: Credit account should be either \"Bank Of America\" or \"Cash\" and debit account can be \"Employee Salary\" and/or \"Miscellenous Expenses\")\nAn accounting rule can also be optionally associated with a branch, so that only a particular Branch's users have access to the rule" - }, - { - "name": "AdhocQuery Api", - "description": "" - }, - { - "name": "Batch API", - "description": "The Apache Fineract Batch API enables a consumer to access significant amounts of data in a single call or to make changes to several objects at once. Batching allows a consumer to pass instructions for several operations in a single HTTP request. A consumer can also specify dependencies between related operations. Once all operations have been completed, a consolidated response will be passed back and the HTTP connection will be closed.\n\nThe Batch API takes in an array of logical HTTP requests represented as JSON arrays - each request has a requestId (the id of a request used to specify the sequence and as a dependency between requests), a method (corresponding to HTTP method GET/PUT/POST/DELETE etc.), a relativeUrl (the portion of the URL after https://example.org/api/v2/), optional headers array (corresponding to HTTP headers), optional reference parameter if a request is dependent on another request and an optional body (for POST and PUT requests). The Batch API returns an array of logical HTTP responses represented as JSON arrays - each response has a requestId, a status code, an optional headers array and an optional body (which is a JSON encoded string).\n\nBatch API uses Json Path to handle dependent parameters. For example, if request '2' is referencing request '1' and in the \"body\" or in \"relativeUrl\" of request '2', there is a dependent parameter (which will look like \"$.parameter_name\"), then Batch API will internally substitute this dependent parameter from the response body of request '1'.\n\nBatch API is able to handle deeply nested dependent requests as well nested parameters. As shown in the example, requests are dependent on each other as, 1<--2<--6, i.e a nested dependency, where request '6' is not directly dependent on request '1' but still it is one of the nested child of request '1'. In the same way Batch API could handle a deeply nested dependent value, such as {..[..{..,$.parameter_name,..}..]}." - }, - { - "name": "Audits", - "description": "Every non-read Mifos API request is audited. A fully processed request can not be changed or deleted. See maker checker api for situations where an audit is not fully processed.\n\nPermissions: To search and look at audit entries a user needs to be attached to a role that has one of the ALL_FUNCTIONS, ALL_FUNCTIONS_READ or READ_AUDIT permissions.\n\nData Scope: A user can only see audits that are within their data scope. However, 'head office' users can see all audits including those that aren't office/branch related e.g. Loan Product changes.\")" - }, - { - "name": "Maker Checker (or 4-eye) functionality", - "description": "" - }, - { - "name": "Account number format", - "description": "Account number preferences are used to describe custom formats for account numbers associated with Customer, Loan and Savings accounts." - }, - { - "name": "Cache", - "description": "The following settings are possible for cache:\n\nNo Caching: caching turned off\nSingle node: caching on for single instance deployments of platorm (works for multiple tenants but only one tomcat)\nBy default caching is set to No Caching. Switching between caches results in the cache been clear e.g. from Single node to No cache and back again would clear down the single node cache." - }, - { - "name": "Code Values", - "description": "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n\nCodes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc" - }, - { - "name": "Codes", - "description": "Code and code values: Codes represent a specific category of data, their code values are a specific instance of that category.\n\nCodes are mostly system defined which means the code itself comes out of the box and cannot be modified however its code values can be. e.g. 'Customer Identifier', it defaults to a code value of 'Passport' but could be 'Drivers License, National Id' etc" - }, - { - "name": "External Services", - "description": "External Services Configuration related to set of supported configurations for third party services like Amazon S3 and SMTP:\n\nS3 (Amazon S3):\ns3_access_key -\ns3_bucket_name -\ns3_secret_key -\n\n\nSMTP (Email Service):\nusername -\npassword -\nhost -\nport -\nuseTLS -" - }, - { - "name": "Global Configuration", - "description": "Global configuration related to set of supported enable/disable configurations:\n\nmaker-checker - defaults to false - if true turns on maker-checker functionality\nreschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\nallow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\nreschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\nallow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\nsavings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\nfinancial-year-beginning-month - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.\nmeetings-mandatory-for-jlg-loans - if set to true, enforces all JLG loans to follow a meeting schedule belonging to either the parent group or Center." - }, - { - "name": "Data Tables", - "description": "The datatables API allows you to plug-in your own tables (MySql) that have a relationship to a Apache Fineract core table. For example, you might want to add some extra client fields and record information about each of the clients' family members. Via the API you can create, read, update and delete entries for each 'plugged-in' table. The API checks for permission and for 'data scoping' (only data within the users' office hierarchy can be managed by the user).\n\nThe Apache Fineract Reference App uses a JQuery plug-in called stretchydatatables (which in turn uses this datatables resource) to provide a pretty flexible CRUD (Create, Read, Update, Delete) User Interface." - }, - { - "name": "Entity Data Table", - "description": "This defines Entity-Datatable Check." - }, - { - "name": "Reports", - "description": "Non-core reports can be added, updated and deleted." - }, - { - "name": "Run Reports", - "description": "" - }, - { - "name": "Documents", - "description": "Multiple Documents (a combination of a name, description and a file) may be attached to different Entities like Clients, Groups, Staff, Loans, Savings and Client Identifiers in the system\n\nNote: The currently allowed Entities are\n\nClients: URL Pattern as clients\nStaff: URL Pattern as staff\nLoans: URL Pattern as loans\nSavings: URL Pattern as savings\nClient Identifiers: URL Pattern as client_identifiers\nGroups: URL Pattern as groups" - }, - { - "name": "Hooks", - "description": "Hooks are a mechanism to trigger custom code on the occurence of events. " - }, - { - "name": "Scheduler", - "description": "" - }, - { - "name": "MIFOSX-BATCH JOBS", - "description": "Batch jobs (also known as cron jobs on Unix-based systems) are a series of back-end jobs executed on a computer at a particular time defined in job's cron expression.\n\n At any point, you can view the list of batch jobs scheduled to run along with other details specific to each job. Manually you can execute the jobs at any point of time.\n\n The scheduler status can be either \"Active\" or \"Standby\". If the scheduler status is Active, it indicates that all batch jobs are running/ will run as per the specified schedule.If the scheduler status is Standby, it will ensure all scheduled batch runs are suspended." - }, - { - "name": "Report Mailing Jobs", - "description": "This resource allows you to create a scheduled job that runs a report and sents it by email to specified email addresses.\n\nThe scheduled job can be configured to run once or on a regular basis (once a day, twice a week, etc)" - }, - { - "name": "List Report Mailing Job History", - "description": "" - }, - { - "name": "Authentication HTTP Basic", - "description": "An API capability that allows client applications to verify authentication details using HTTP Basic Authentication." - }, - { - "name": "Fetch authenticated user details", - "description": "" - }, - { - "name": "Mix Report", - "description": "" - }, - { - "name": "Mix Taxonomy", - "description": "" - }, - { - "name": "Mix Mapping", - "description": "" - }, - { - "name": "Notification", - "description": "" - }, - { - "name": "Holidays", - "description": "Some MFI's span large regions where different branch offices might observe different holidays. They need the ability to define holidays for specific branch offices and be able to set the repayment rule to follow during those holidays.\n\nThe reschedule of repayments to repaymentsRescheduledTo date during defined holidays is turned on/off by enabling/disabling reschedule-repayments-on-holidays in Global configurations.\n\nAllow Repayment transactions on a defined holidays is turned on/off by enabling/disabling allow-transactions-on-holiday in Global configurations." - }, - { - "name": "Currency", - "description": "Application related configuration around viewing/updating the currencies permitted for use within the MFI." - }, - { - "name": "Offices", - "description": "Offices are used to model an MFIs structure. A hierarchical representation of offices is supported. There will always be at least one office (which represents the MFI or an MFIs head office). All subsequent offices added must have a parent office." - }, - { - "name": "Provisioning Category", - "description": "" - }, - { - "name": "Provisioning Criteria", - "description": "This defines the Provisioning Criteria" - }, - { - "name": "Staff", - "description": "Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not." - }, - { - "name": "Cashiers", - "description": "" - }, - { - "name": "Teller Cash Management", - "description": "Teller cash management which will allow an organization to manage their cash transactions at branches or head office more effectively." - }, - { - "name": "Cashier Journals", - "description": "" - }, - { - "name": "Working days", - "description": "The days of the week that are workdays.\n\nRescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n\nAllow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations." - }, - { - "name": "Account Transfers", - "description": "Ability to be able to transfer monetary funds from one account to another.\n\nNote: At present only savings account to savings account transfers are supported." - }, - { - "name": "Standing Instructions", - "description": "Standing instructions (or standing orders) refer to instructions a bank account holder (\"the payer\") gives to his or her bank to pay a set amount at regular intervals to another's (\"the payee's\") account.\n\nNote: At present only savings account to savings account and savings account to Loan account transfers are permitted." - }, - { - "name": "Standing Instructions History", - "description": "The list capability of history can support pagination and sorting." - }, - { - "name": "Share Account", - "description": "Share accounts are instances of a praticular share product created for an individual. An application process around the creation of accounts is also supported." - }, - { - "name": "Entity Field Configuration", - "description": "Entity Field configuration API is a generic and extensible \nwherein various entities and subentities can be related.\nAlso it gives the user an ability to enable/disable fields,\nadd regular expression for validation" - }, - { - "name": "Charges", - "description": "Its typical for MFIs to add extra costs for their financial products. These are typically Fees or Penalties.\n\nA Charge on fineract platform is what we use to model both Fees and Penalties.\n\nAt present we support defining charges for use with Client accounts and both loan and saving products." - }, - { - "name": "Clients Address", - "description": "Address module is an optional module and can be configured into the system by using GlobalConfiguration setting: enable-address. In order to activate Address module, we need to enable the configuration, enable-address by setting its value to true." - }, - { - "name": "Client Charges", - "description": "It is typical for MFI's to directly associate charges with an implicit Client account. These can be either fees or penalties\n\nClient Charges are client specific instances of Charges. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Client account) are described here" - }, - { - "name": "Client Identifier", - "description": "Client Identifiers refer to documents that are used to uniquely identify a customer\nEx: Drivers License, Passport, Ration card etc " - }, - { - "name": "Client Transaction", - "description": "Client Transactions refer to transactions made directly againt a Client's internal account. Currently, these transactions are only created as a result of charge payments/waivers. You are allowed to undo a transaction, however you cannot explicitly create one. " - }, - { - "name": "Client", - "description": "Clients are people and businesses that have applied (or may apply) to an MFI for loans.\n\nClients can be created in Pending or straight into Active state." - }, - { - "name": "Loan Collateral", - "description": "In lending agreements, collateral is a borrower's pledge of specific property to a lender, to secure repayment of a loan. The collateral serves as protection for a lender against a borrower's default - that is, any borrower failing to pay the principal and interest under the terms of a loan obligation. If a borrower does default on a loan (due to insolvency or other event), that borrower forfeits (gives up) the property pledged as collateral - and the lender then becomes the owner of the collateral" - }, - { - "name": "Floating Rates", - "description": "It lets you create, list, retrieve and upload the floating rates" - }, - { - "name": "Centers", - "description": "Centers along with Groups are used to provided a distinctive banking distribution channel used in microfinance. Its common in areas such as Southern Asia to use Centers and Group as administrative units in grameen style lending. Typically groups will contain one to five people and centers themselves will be made of anywhere between 2-10 groups." - }, - { - "name": "Groups", - "description": "Groups are used to provide a distinctive banking distribution channel used in microfinances throughout the world. The Group is an administrative unit. It can contain as few as 5 people or as many as 40 depending on how its used.\n\nDifferent styles of group lending - Joint-Liability Group, Grameen Model (Center-Group), Self-Help Groups, Village/Communal Banks)" - }, - { - "name": "Interest Rate Slab (A.K.A interest bands)", - "description": "The slabs a.k.a interest bands are associated with Interest Rate Chart. These bands allow to define different interest rates for different deposit term periods." - }, - { - "name": "Interest Rate Chart", - "description": "This defines an interest rate scheme that can be associated to a term deposit product. This will have a slab (band or range) of deposit periods and the associated interest rates applicable along with incentives for each band." - }, - { - "name": "Loan Charges", - "description": "Its typical for MFIs to add extra costs for their loan products. They can be either Fees or Penalties.\n\nLoan Charges are instances of Charges and represent either fees and penalties for loan products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Loan) are described here" - }, - { - "name": "Loan Rescheduling", - "description": "Loan Term Variations provides the ability to change due dates, amounts and number of instalments before loan approval." - }, - { - "name": "Loan Transactions", - "description": "Capabilities include loan repayment's, interest waivers and the ability to 'adjust' an existing transaction. An 'adjustment' of a transaction is really a 'reversal' of existing transaction followed by creation of a new transaction with the provided details." - }, - { - "name": "Loans", - "description": "The API concept of loans models the loan application process and the loan contract/monitoring process.\n\nField Descriptions\naccountNo\nThe account no. associated with this loan. Is auto generated if not provided at loan application creation time.\nexternalId\nA place to put an external reference for this loan e.g. The ID another system uses.\nIf provided, it must be unique.\nfundId\nOptional: For associating a loan with a given fund.\nloanOfficerId\nOptional: For associating a loan with a given staff member who is a loan officer.\nloanPurposeId\nOptional: For marking a loan with a given loan purpose option. Loan purposes are configurable and can be setup by system admin through code/code values screens.\nprincipal\nThe loan amount to be disbursed to through loan.\nloanTermFrequency\nThe length of loan term\nUsed like: loanTermFrequency loanTermFrequencyType\ne.g. 12 Months\nloanTermFrequencyType\nThe loan term period to use. Used like: loanTermFrequency loanTermFrequencyType\ne.g. 12 Months Example Values: 0=Days, 1=Weeks, 2=Months, 3=Years\nnumberOfRepayments\nNumber of installments to repay.\nUsed like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\ne.g. 10 (repayments) Every 12 Weeks\nrepaymentEvery\nUsed like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\ne.g. 10 (repayments) Every 12 Weeks\nrepaymentFrequencyType\nUsed like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\ne.g. 10 (repayments) Every 12 Weeks \nExample Values: 0=Days, 1=Weeks, 2=Months\ninterestRatePerPeriod\nInterest Rate.\nUsed like: interestRatePerPeriod % interestRateFrequencyType - interestType\ne.g. 12.0000% Per year - Declining Balance\ninterestRateFrequencyType\nUsed like: interestRatePerPeriod% interestRateFrequencyType - interestType\ne.g. 12.0000% Per year - Declining Balance \nExample Values: 2=Per month, 3=Per year\ngraceOnPrincipalPayment\nOptional: Integer - represents the number of repayment periods that grace should apply to the principal component of a repayment period.\ngraceOnInterestPayment\nOptional: Integer - represents the number of repayment periods that grace should apply to the interest component of a repayment period. Interest is still calculated but offset to later repayment periods.\ngraceOnInterestCharged\nOptional: Integer - represents the number of repayment periods that should be interest-free.\ngraceOnArrearsAgeing\nOptional: Integer - Used in Arrears calculation to only take into account loans that are more than graceOnArrearsAgeing days overdue.\ninterestChargedFromDate\nOptional: Date - The date from with interest is to start being charged.\nexpectedDisbursementDate\nThe proposed disbursement date of the loan so a proposed repayment schedule can be provided.\nsubmittedOnDate\nThe date the loan application was submitted by applicant.\nlinkAccountId\nThe Savings Account id for linking with loan account for payments.\namortizationType\nExample Values: 0=Equal principle payments, 1=Equal installments\ninterestType\nUsed like: interestRatePerPeriod% interestRateFrequencyType - interestType\ne.g. 12.0000% Per year - Declining Balance \nExample Values: 0=Declining Balance, 1=Flat\ninterestCalculationPeriodType\nExample Values: 0=Daily, 1=Same as repayment period\nallowPartialPeriodInterestCalcualtion\nThis value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\ninArrearsTolerance\nThe amount that can be 'waived' at end of all loan payments because it is too small to worry about.\nThis is also the tolerance amount assessed when determining if a loan is in arrears.\ntransactionProcessingStrategyId\nAn enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\nA number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n\nRefer to the Payment Application Logic / Transaction Processing Strategy section in the appendix for more detailed overview of each available payment application logic provided out of the box.\n\nList of current approaches:\n1 = Mifos style (Similar to Old Mifos)\n2 = Heavensfamily (Custom MFI approach)\n3 = Creocore (Custom MFI approach)\n4 = RBI (India)\n5 = Principal Interest Penalties Fees Order\n6 = Interest Principal Penalties Fees Order\n7 = Early Payment Strategy\nloanType\nTo represent different type of loans.\nAt present there are three type of loans are supported. \nAvailable loan types:\nindividual: Loan given to individual member\ngroup: Loan given to group as a whole\njlg: Joint liability group loan given to members in a group on individual basis. JLG loan can be given to one or more members in a group.\nrecalculationRestFrequencyDate\nSpecifies rest frequency start date for interest recalculation. This date must be before or equal to disbursement date\nrecalculationCompoundingFrequencyDate\nSpecifies compounding frequency start date for interest recalculation. This date must be equal to disbursement date" - }, - { - "name": "Loan Products", - "description": "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation." - }, - { - "name": "Notes", - "description": "Notes API allows to enter notes for supported resources." - }, - { - "name": "Payment Type", - "description": "This defines the payment type" - }, - { - "name": "Fixed Deposit Account", - "description": "Fixed Deposit accounts are instances of a praticular fixed deposit product created. An application process around the creation of accounts is also supported." - }, - { - "name": "Fixed Deposit Product", - "description": "This is one of the advanced term deposit product offered by MFI's. The Fixed Deposit Products (aka FD) product offerings are modeled using this API.\n\nThe FD products are deposit accounts which are held for a fixed term – like 1 year, 2 years etc.\n\nWhen creating fixed deposit accounts, the details from the fixed deposit product are used to auto fill details of the fixed deposit account application process." - }, - { - "name": "Recurring Deposit Account Transactions", - "description": "Transactions possible on a recurring deposit account." - }, - { - "name": "Recurring Deposit Account", - "description": "Recurring Deposit accounts are instances of a praticular recurring deposit product created. An application process around the creation of accounts is also supported." - }, - { - "name": "Recurring Deposit Product", - "description": "Recurring Deposits are a special kind of Term Deposits offered by MFI's. The Recurring Deposit Products (aka RD) product offerings are modeled using this API.\n\nRecurring Deposits help people with regular incomes to deposit a fixed amount every month (specified recurring frequency) into their Recurring Deposit account.\n\nWhen creating recurring deposit accounts, the details from the recurring deposit product are used to auto fill details of the recurring deposit account application process." - }, - { - "name": "Savings Charges", - "description": "Its typical for MFIs to add maintenance and operating charges. They can be either Fees or Penalties.\n\nSavings Charges are instances of Charges and represent either fees and penalties for savings products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Savings account) are described here" - }, - { - "name": "Savings Account", - "description": "Savings accounts are instances of a particular savings product created for an individual or group. An application process around the creation of accounts is also supported." - }, - { - "name": "Savings Product", - "description": "An MFIs savings product offerings are modeled using this API.\nWhen creating savings accounts, the details from the savings product are used to auto fill details of the savings account application process." - }, - { - "name": "Search API", - "description": "Search API allows to search scoped resources clients, loans and groups on specified fields." - }, - { - "name": "Self Account transfer", - "description": "" - }, - { - "name": "Self Third Party Transfer", - "description": "" - }, - { - "name": "Self Client", - "description": "" - }, - { - "name": "Self Loans", - "description": "" - }, - { - "name": "Pocket", - "description": "" - }, - { - "name": "Self Loan Products", - "description": "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.\n\nField Descriptions\nname\nName associated with loan product on system.\nshortName\nShort name associated with a loan product. \nAn abbreviated version of the name, used in reports or menus where space is limited, such as Collection Sheets.\ndescription\nFor providing helpful description of product offering.\nfundId\nFor associating a loan product with a given fund by default.\nincludeInBorrowerCycle\nIt is a flag, Used to denote whether the loans should include in loan cycle counter or not.\nuseBorrowerCycle\nIt is a flag, Used to denote whether the loans should depend on \nborrower loan cycle counter or not.\ncurrencyCode\nA three letter ISO code of currency.\ndigitsAfterDecimal\nOverride the currency default value for digitsAfterDecimal.\ninMultiplesOf\nOverride the default value for rounding currency to multiples of value provided.\ninstallmentAmountInMultiplesOf\nOverride the default value for rounding instalment amount to multiples of value provided.\nprincipal\nThe loan amount to be disbursed to through loan.\nnumberOfRepayments\nNumber of installments to repay.\nUsed like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\ne.g. 10 (repayments) Every 12 Weeks\nrepaymentEvery\nUsed like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\ne.g. 10 (repayments) Every 12 Weeks\nrepaymentFrequencyType\nUsed like: numberOfRepayments Every repaymentEvery repaymentFrequencyType\ne.g. 10 (repayments) Every 12 Weeks \nExample Values: 0=Days, 1=Weeks, 2=Months\ninterestRatePerPeriod\nInterest Rate.\nUsed like: interestRatePerPeriod % interestRateFrequencyType - interestType\ne.g. 12.0000% Per year - Declining Balance\ninterestRateFrequencyType\nUsed like: interestRatePerPeriod% interestRateFrequencyType - interestType\ne.g. 12.0000% Per year - Declining Balance \nExample Values: 2=Per month, 3=Per year\namortizationType\nExample Values: 0=Equal principle payments, 1=Equal installments\ninterestType\nUsed like: interestRatePerPeriod% interestRateFrequencyType - interestType\ne.g. 12.0000% Per year - Declining Balance \nExample Values: 0=Declining Balance, 1=Flat\ninterestCalculationPeriodType\nExample Values: 0=Daily, 1=Same as repayment period\nallowPartialPeriodInterestCalcualtion\nThis value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\ninArrearsTolerance\nThe amount that can be 'waived' at end of all loan payments because it is too small to worry about.\nThis is also the tolerance amount assessed when determining if a loan is in arrears.\nprincipalVariationsForBorrowerCycle,interestRateVariationsForBorrowerCycle,\nnumberOfRepaymentVariationsForBorrowerCycle\nVariations for loan, based on borrower cycle number\nminimumDaysBetweenDisbursalAndFirstRepayment\nThe minimum number of days allowed between a Loan disbursal and its first repayment.\nprincipalThresholdForLastInstalment\nField represents percentage of current instalment principal amount for comparing against principal outstanding to add another repayment instalment. If the outstanding principal amount is less then calculated amount, remaining outstanding amount will be added to current instalment. Default value for multi disburse loan is 50% and non-multi disburse loan is 0%\ncanDefineInstallmentAmount\nif provided as true, then fixed instalment amount can be provided from loan account.\ntransactionProcessingStrategyId\nAn enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\nA number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n\nRefer to the Payment Application Logic / Transaction Processing Strategy section in the appendix for more detailed overview of each available payment application logic provided out of the box.\n\nList of current approaches:\n1 = Mifos style (Similar to Old Mifos)\n2 = Heavensfamily (Custom MFI approach)\n3 = Creocore (Custom MFI approach)\n4 = RBI (India)\n5 = Principal Interest Penalties Fees Order\n6 = Interest Principal Penalties Fees Order\n7 = Early Payment Strategy\ngraceOnPrincipalPayment\nOptional: Integer - represents the number of repayment periods that grace should apply to the principal component of a repayment period.\ngraceOnInterestPayment\nOptional: Integer - represents the number of repayment periods that grace should apply to the interest component of a repayment period. Interest is still calculated but offset to later repayment periods.\ngraceOnInterestCharged\nOptional: Integer - represents the number of repayment periods that should be interest-free.\ngraceOnArrearsAgeing\nOptional: Integer - Used in Arrears calculation to only take into account loans that are more than graceOnArrearsAgeing days overdue.\noverdueDaysForNPA\nOptional: Integer - represents the maximum number of days a Loan may be overdue before being classified as a NPA (non performing asset)\naccountMovesOutOfNPAOnlyOnArrearsCompletion\nOptional: Boolean - if provided as true, Loan Account moves out of NPA state only when all arrears are cleared\naccountingRule\nSpecifies if accounting is enabled for the particular product and the type of the accounting rule to be used Example Values:1=NONE, 2=CASH_BASED, 3=ACCRUAL_PERIODIC, 4=ACCRUAL_UPFRONT\nisInterestRecalculationEnabled\nIt is a flag, Used to denote whether interest recalculation is enabled or disabled for the particular product\ndaysInYearType\nSpecifies the number of days in a year. \nExample Values:1=ACTUAL(Actual number of days in year), 360=360 DAYS, 364=364 DAYS(52 WEEKS), 365=365 DAYS\ndaysInMonthType\nSpecifies the number of days in a month. \nExample Values:1=ACTUAL(Actual number of days in month), 30=30 DAYS\ninterestRecalculationCompoundingMethod\nSpecifies which amount portion should be added to principal for interest recalculation. \nExample Values:0=NONE(Only on principal), 1=INTEREST(Principal+Interest), 2=FEE(Principal+Fee), 3=FEE And INTEREST (Principal+Fee+Interest)\nrescheduleStrategyMethod\nSpecifies what action should perform on loan repayment schedule for advance payments. \nExample Values:1=Reschedule next repayments, 2=Reduce number of installments, 3=Reduce EMI amount\nrecalculationCompoundingFrequencyType\nSpecifies effective date from which the compounding of interest or fee amounts will be considered in recalculation on late payment.\nExample Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly\nrecalculationCompoundingFrequencyInterval\nSpecifies compounding frequency interval for interest recalculation.\nrecalculationCompoundingFrequencyDate\nSpecifies compounding frequency start date for interest recalculation.\nrecalculationRestFrequencyType\nSpecifies effective date from which the late or advanced payment amounts will be considered in recalculation.\nExample Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly\nrecalculationRestFrequencyInterval\nSpecifies rest frequency interval for interest recalculation.\nrecalculationRestFrequencyDate\nSpecifies rest frequency start date for interest recalculation.\npreClosureInterestCalculationStrategy\nSpecifies applicable days for interest calculation on pre closure of a loan.\nExample Values:1=Calculate till pre closure date, 2=Calculate till rest frequency date\nisArrearsBasedOnOriginalSchedule\nIf Specified as true, arrears will be identified based on original schedule.\nallowAttributeOverrides\nSpecifies if select attributes may be overridden for individual loan accounts." - }, - { - "name": "Self Service Registration", - "description": "" - }, - { - "name": "Self Run Report", - "description": "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n\nThe default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n\nIf Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats.\n\nThe Apache Fineract reference application uses a JQuery plugin called stretchyreporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI).\n\nARGUMENTS\nR_'parameter names' ... optional, No defaults The number and names of the parameters depend on the specific report and how it has been configured. R_officeId is an example parameter name.Note: the prefix R_ stands for ReportinggenericResultSetoptional, defaults to true If 'true' an optimised JSON format is returned suitable for tabular display of data. If 'false' a simple JSON format is returned. parameterType optional, The only valid value is 'true'. If any other value is provided the argument will be ignored Determines whether the request looks in the list of reports or the list of parameters for its data. Doesn't apply to Pentaho reports.exportCSV optional, The only valid value is 'true'. If any other value is provided the argument will be ignored Output will be delivered as a CSV file instead of JSON. Doesn't apply to Pentaho reports.output-type optional, Defaults to HTML. Valid Values are HTML, XLS, XSLX, CSV and PDF for html, Excel, Excel 2007+, CSV and PDF formats respectively.Only applies to Pentaho reports.locale optional Any valid locale Ex: en_US, en_IN, fr_FR etcOnly applies to Pentaho reports." - }, - { - "name": "Self Savings Account", - "description": "" - }, - { - "name": "Self Authentication", - "description": "Authenticates the credentials provided and returns the set roles and permissions allowed" - }, - { - "name": "Self User", - "description": "" - }, - { - "name": "Self User Details", - "description": "" - }, - { - "name": "Self Share Accounts", - "description": "" - }, - { - "name": "Self Score Card", - "description": "" - }, - { - "name": "Self Spm", - "description": "" - }, - { - "name": "Self Dividend", - "description": "" - }, - { - "name": "Tax Components", - "description": "This defines the Tax Components" - }, - { - "name": "Tax Group", - "description": "This defines the Tax Group" - }, - { - "name": "SPM API - LookUp Table", - "description": "The Apache Fineract SPM API provides the ability to create custom surveys to collect social performance measurentment data or any additional questionnaire a financial institute want to collect." - }, - { - "name": "Score Card", - "description": "" - }, - { - "name": "Spm-Surveys", - "description": "" - }, - { - "name": "User Generated Documents", - "description": "User Generated Documents(alternatively, Templates) are used for end-user features such as custom user defined document generation (AKA UGD). They are based on {{ moustache }} templates. Think of them as a sort of built-in \"mail merge\" functionality.\n\nUser Generated Documents (and other types of templates) can aggregate data from several Apache Fineract back-end API calls via mappers. Mappers can even access non-Apache Fineract REST services from other servers. UGDs can render such data in tables, show images, etc. TBD: Please have a look at some of the Example UGDs included in Apache Fineract (or the Wiki page, for now.).\n\nUGDs can be assigned to an entity like client or loan and be of a type like Document or SMS. The entity and type of a UGD is only there for the convenience of user agents (UIs), in order to know where to show UGDs for the user (i.e. which tab). The Template Engine back-end runner does not actually need this metadata." - }, - { - "name": "Password preferences", - "description": "This API enables management of password policy for user administration.\n\nThere is no Apache Fineract functionality for creating a validation policy. The validation policies come pre-installed.\n\nValidation policies may be updated" - }, - { - "name": "Permissions", - "description": "An API capability to support management of application permissions for user administration.\n\nThere is no Apache Fineract functionality for creating or deleting permissions. Permissions come pre-installed.\n\nPermissions are not updated, except in the case of enabling or disabling non-read transactions for Maker Checker functionality" - }, - { - "name": "Roles", - "description": "An API capability to support management of application roles for user administration." - }, - { - "name": "Users", - "description": "An API capability to support administration of application users." - }, - { - "name": "SMS Campaigns" - }, - { - "name": "CreditBureau Configuration" - }, - { - "name": "Entity Datatable Check" - }, - { - "name": "DomainNameapiv1{entity}{entityId}images" - }, - { - "name": "DomainNameapiv1entitytoentitymapping" - }, - { - "name": "SMS" - }, - { - "name": "Likelihood" - }, - { - "name": "Poverty Line" - }, - { - "name": "Survey" - }, - { - "name": "interoperation" - }, - { - "name": "Mix Mapping " - }, - { - "name": "officetransactions" - }, - { - "name": "Collection Sheet" - }, - { - "name": "Funds" - }, - { - "name": "Products" - }, - { - "name": "Self Account Transfer" - }, - { - "name": "Self Run Report " - } - ], - "schemes": [ - "https" - ], - "paths": { - "/runaccruals": { - "post": { - "tags": [ - "Periodic Accrual Accounting" - ], - "summary": "Executes Periodic Accrual Accounting", - "description": "Mandatory Fields\n\ntillDate\n", - "operationId": "executePeriodicAccrualAccounting", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "Request Body\n\nField Descriptions: \ntillDate: \nwhich specifies periodic accruals should happen till the given Date", - "required": true, - "schema": { - "$ref": "#/definitions/runaccrualsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/glclosures": { - "get": { - "tags": [ - "Accounting Closure" - ], - "summary": "List Accounting closures", - "description": "Example Requests:\n\nglclosures", - "operationId": "retrieveAllClosures", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetGLClosureResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Accounting Closure" - ], - "summary": "Create an Accounting Closure", - "description": "Mandatory Fields\nofficeId,closingDate", - "operationId": "createGLClosure", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "Request Body", - "required": true, - "schema": { - "$ref": "#/definitions/PostGLCLosuresRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostGlClosuresResponse" - } - } - } - } - }, - "/glclosures/{glClosureId}": { - "get": { - "tags": [ - "Accounting Closure" - ], - "summary": "Retrieve an Accounting Closure", - "description": "Example Requests:\n\nglclosures/1\n\n\n/glclosures/1?fields=officeName,closingDate", - "operationId": "retreiveClosure", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "glClosureId", - "in": "path", - "description": "glClosureId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetGLClosureResponse" - } - } - } - }, - "put": { - "tags": [ - "Accounting Closure" - ], - "summary": "Update an Accounting closure", - "description": "Once an accounting closure is created, only the comments associated with it may be edited", - "operationId": "updateGLClosure", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "glClosureId", - "in": "path", - "description": "glClosureId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "Request body", - "required": true, - "schema": { - "$ref": "#/definitions/PutGlClosuresRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutGlClosuresResponse" - } - } - } - }, - "delete": { - "tags": [ - "Accounting Closure" - ], - "summary": "Delete an accounting closure", - "description": "Note: Only the latest accounting closure associated with a branch may be deleted.", - "operationId": "deleteGLClosure", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "glClosureId", - "in": "path", - "description": "glclosureId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteGlClosuresResponse" - } - } - } - } - }, - "/financialactivityaccounts/{mappingId}": { - "get": { - "tags": [ - "Mapping Financial Activities to Accounts" - ], - "summary": "Retrieve a Financial Activity to Account Mapping\n", - "description": "Example Requests:\n\nfinancialactivityaccounts/1", - "operationId": "retreive", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mappingId", - "in": "path", - "description": "mappingId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetFinancialActivityAccountsResponse" - } - } - } - }, - "put": { - "tags": [ - "Mapping Financial Activities to Accounts" - ], - "summary": "Update a Financial Activity to Account Mapping", - "description": "the API updates the Ledger account linked to a Financial Activity \n", - "operationId": "updateGLAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mappingId", - "in": "path", - "description": "mappingId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "Request body", - "required": false, - "schema": { - "$ref": "#/definitions/PostFinancialActivityAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutFinancialActivityAccountsResponse" - } - } - } - }, - "delete": { - "tags": [ - "Mapping Financial Activities to Accounts" - ], - "summary": "Delete a Financial Activity to Account Mapping", - "description": "", - "operationId": "deleteGLAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mappingId", - "in": "path", - "description": "mappingId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteFinancialActivityAccountsResponse" - } - } - } - } - }, - "/financialactivityaccounts": { - "get": { - "tags": [ - "Mapping Financial Activities to Accounts" - ], - "summary": "List Financial Activities to Accounts Mappings", - "description": "Example Requests:\n\nfinancialactivityaccounts", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetFinancialActivityAccountsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Mapping Financial Activities to Accounts" - ], - "summary": "Create a new Financial Activity to Accounts Mapping", - "description": "Mandatory Fields\nfinancialActivityId, glAccountId", - "operationId": "createGLAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "Request body", - "required": false, - "schema": { - "$ref": "#/definitions/PostFinancialActivityAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostFinancialActivityAccountsResponse" - } - } - } - } - }, - "/financialactivityaccounts/template": { - "get": { - "tags": [ - "Mapping Financial Activities to Accounts" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/glaccounts/{glAccountId}": { - "get": { - "tags": [ - "General Ledger Account" - ], - "summary": "Retrieve a General Ledger Account", - "description": "Example Requests:\n\nglaccounts/1\n\n\nglaccounts/1?template=true\n\n\nglaccounts/1?fields=name,glCode\n\n\nglaccounts/1?fetchRunningBalance=true", - "operationId": "retreiveAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "glAccountId", - "in": "path", - "description": "glAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "fetchRunningBalance", - "in": "query", - "description": "fetchRunningBalance", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetGLAccountsResponse" - } - } - } - }, - "put": { - "tags": [ - "General Ledger Account" - ], - "summary": "Update an Accounting closure", - "description": "Once an accounting closure is created, only the comments associated with it may be edited\n\n", - "operationId": "updateGLAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "glAccountId", - "in": "path", - "description": "glAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PutGLAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutGLAccountsResponse" - } - } - } - }, - "delete": { - "tags": [ - "General Ledger Account" - ], - "summary": "Delete an accounting closure", - "description": "Note: Only the latest accounting closure associated with a branch may be deleted.", - "operationId": "deleteGLAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "glAccountId", - "in": "path", - "description": "glAccountId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteGLAccountsRequest" - } - } - } - } - }, - "/glaccounts": { - "get": { - "tags": [ - "General Ledger Account" - ], - "summary": "List General Ledger Accounts", - "description": "ARGUMENTS\ntype Integer optional manualEntriesAllowed boolean optional usage Integer optional disabled boolean optional parentId Long optional tagId Long optional\nExample Requests:\n\nglaccounts\n\n\nglaccounts?type=1&manualEntriesAllowed=true&usage=1&disabled=false\n\nglaccounts?fetchRunningBalance=true", - "operationId": "retrieveAllAccounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "type", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "searchParam", - "in": "query", - "description": "searchParam", - "required": false, - "type": "string" - }, - { - "name": "usage", - "in": "query", - "description": "usage", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "manualEntriesAllowed", - "in": "query", - "description": "manualEntriesAllowed", - "required": false, - "type": "boolean" - }, - { - "name": "disabled", - "in": "query", - "description": "disabled", - "required": false, - "type": "boolean" - }, - { - "name": "fetchRunningBalance", - "in": "query", - "description": "fetchRunningBalance", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetGLAccountsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "General Ledger Account" - ], - "summary": "Create a General Ledger Account", - "description": "Note: You may optionally create Hierarchical Chart of Accounts by using the \"parentId\" property of an Account\nMandatory Fields: \nname, glCode, type, usage and manualEntriesAllowed", - "operationId": "createGLAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostGLAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostGLAccountsResponse" - } - } - } - } - }, - "/glaccounts/template": { - "get": { - "tags": [ - "General Ledger Account" - ], - "summary": "Retrieve GL Accounts Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nglaccounts/template\nglaccounts/template?type=1\n\ntype is optional and integer value from 1 to 5.\n\n1.Assets \n2.Liabilities \n3.Equity \n4.Income \n5.Expenses", - "operationId": "retrieveNewAccountDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "type", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetGLAccountsTemplateResponse" - } - } - } - } - }, - "/glaccounts/downloadtemplate": { - "get": { - "tags": [ - "General Ledger Account" - ], - "operationId": "getGlAccountsTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/glaccounts/uploadtemplate": { - "post": { - "tags": [ - "General Ledger Account" - ], - "operationId": "postGlAccountsTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/journalentries/{journalEntryId}": { - "get": { - "tags": [ - "Journal Entries" - ], - "summary": "Retrieve a single Entry", - "description": "Example Requests:\n\njournalentries/1\n\n\n\njournalentries/1?fields=officeName,glAccountId,entryType,amount\n\njournalentries/1?runningBalance=true\n\njournalentries/1?transactionDetails=true", - "operationId": "retreiveJournalEntryById", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "journalEntryId", - "in": "path", - "description": "journalEntryId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "runningBalance", - "in": "query", - "description": "runningBalance", - "required": false, - "type": "boolean" - }, - { - "name": "transactionDetails", - "in": "query", - "description": "transactionDetails", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/JournalEntryData" - } - } - } - } - }, - "/journalentries": { - "get": { - "tags": [ - "Journal Entries" - ], - "summary": "List Journal Entries", - "description": "The list capability of journal entries can support pagination and sorting.\n\nExample Requests:\n\njournalentries\n\njournalentries?transactionId=PB37X8Y21EQUY4S\n\njournalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n\njournalentries?fields=officeName,glAccountName,transactionDate\n\njournalentries?offset=10&limit=50\n\njournalentries?orderBy=transactionId&sortOrder=DESC\n\njournalentries?runningBalance=true\n\njournalentries?transactionDetails=true\n\njournalentries?loanId=12\n\njournalentries?savingsId=24", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "glAccountId", - "in": "query", - "description": "glAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "manualEntriesOnly", - "in": "query", - "description": "manualEntriesOnly", - "required": false, - "type": "boolean" - }, - { - "name": "fromDate", - "in": "query", - "description": "fromDate", - "required": false, - "type": "string" - }, - { - "name": "toDate", - "in": "query", - "description": "toDate", - "required": false, - "type": "string" - }, - { - "name": "transactionId", - "in": "query", - "description": "transactionId", - "required": false, - "type": "string" - }, - { - "name": "entityType", - "in": "query", - "description": "entityType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "locale", - "in": "query", - "description": "locale", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "query", - "description": "dateFormat", - "required": false, - "type": "string" - }, - { - "name": "loanId", - "in": "query", - "description": "loanId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "savingsId", - "in": "query", - "description": "savingsId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "runningBalance", - "in": "query", - "description": "runningBalance", - "required": false, - "type": "boolean" - }, - { - "name": "transactionDetails", - "in": "query", - "description": "transactionDetails", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/JournalEntryData" - } - } - } - } - }, - "post": { - "tags": [ - "Journal Entries" - ], - "summary": "Create \"Balanced\" Journal Entries", - "description": "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \nCompound Journal entries may have \"n\" debits and \"m\" credits where both \"m\" and \"n\" are greater than 0 and the net sum or all debits and credits are equal \n\n\nMandatory Fields\nofficeId, transactionDate\n\n\ncredits- glAccountId, amount, comments\n\n \ndebits- glAccountId, amount, comments\n\n \nOptional Fields\npaymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber", - "operationId": "createGLJournalEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/JournalEntryCommand" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostJournalEntriesResponse" - } - } - } - } - }, - "/journalentries/{transactionId}": { - "post": { - "tags": [ - "Journal Entries" - ], - "summary": "Update Running balances for Journal Entries", - "description": "This API calculates the running balances for office. If office ID not provided this API calculates running balances for all offices. \nMandatory Fields\nofficeId", - "operationId": "createReversalJournalEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "string" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostJournalEntriesTransactionIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostJournalEntriesTransactionIdResponse" - } - } - } - } - }, - "/journalentries/provisioning": { - "get": { - "tags": [ - "Journal Entries" - ], - "operationId": "retrieveJournalEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "entryId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/journalentries/openingbalance": { - "get": { - "tags": [ - "Journal Entries" - ], - "operationId": "retrieveOpeningBalance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "currencyCode", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/journalentries/downloadtemplate": { - "get": { - "tags": [ - "Journal Entries" - ], - "operationId": "getJournalEntriesTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/journalentries/uploadtemplate": { - "post": { - "tags": [ - "Journal Entries" - ], - "operationId": "postJournalEntriesTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/provisioningentries": { - "get": { - "tags": [ - "Provisioning Entries" - ], - "summary": "List all Provisioning Entries", - "description": "", - "operationId": "retrieveAllProvisioningEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ProvisioningEntryData" - } - } - } - } - }, - "post": { - "tags": [ - "Provisioning Entries" - ], - "summary": "Create new Provisioning Entries", - "description": "Creates a new Provisioning Entries\n\nMandatory Fields\ndate\ndateFormat\nlocale\nOptional Fields\ncreatejournalentries", - "operationId": "createProvisioningEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostProvisioningEntriesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostProvisioningEntriesResponse" - } - } - } - } - }, - "/provisioningentries/{entryId}": { - "get": { - "tags": [ - "Provisioning Entries" - ], - "summary": "Retrieves a Provisioning Entry", - "description": "Returns the details of a generated Provisioning Entry.", - "operationId": "retrieveProvisioningEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entryId", - "in": "path", - "description": "entryId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ProvisioningEntryData" - } - } - } - }, - "post": { - "tags": [ - "Provisioning Entries" - ], - "summary": "Recreates Provisioning Entry", - "description": "Recreates Provisioning Entry | createjournalentry.", - "operationId": "modifyProvisioningEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entryId", - "in": "path", - "description": "entryId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command=createjournalentry\ncommand=recreateprovisioningentry", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PutProvisioningEntriesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutProvisioningEntriesResponse" - } - } - } - } - }, - "/provisioningentries/entries": { - "get": { - "tags": [ - "Provisioning Entries" - ], - "operationId": "retrieveProviioningEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entryId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "categoryId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/LoanProductProvisioningEntryData" - } - } - } - } - }, - "/accountingrules": { - "get": { - "tags": [ - "Accounting Rules" - ], - "summary": "Retrieve Accounting Rules", - "description": "Returns the list of defined accounting rules.\n\nExample Requests:\n\naccountingrules", - "operationId": "retrieveAllAccountingRules", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetAccountRulesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Accounting Rules" - ], - "summary": "Create/Define a Accounting rule", - "description": "Define a new Accounting rule.\n\nMandatory Fields\nname, officeId,\naccountToDebit OR debitTags,\naccountToCredit OR creditTags.\n\nOptional Fields\ndescription", - "operationId": "createAccountingRule", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostAccountingRulesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostAccountingRulesResponse" - } - } - } - } - }, - "/accountingrules/{accountingRuleId}": { - "get": { - "tags": [ - "Accounting Rules" - ], - "summary": "Retrieve a Accounting rule", - "description": "Returns the details of a defined Accounting rule.\n\nExample Requests:\n\naccountingrules/1", - "operationId": "retreiveAccountingRule", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountingRuleId", - "in": "path", - "description": "accountingRuleId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/AccountingRuleData" - } - } - } - }, - "put": { - "tags": [ - "Accounting Rules" - ], - "summary": "Update a Accounting Rule", - "description": "Updates the details of a Accounting rule.", - "operationId": "updateAccountingRule", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountingRuleId", - "in": "path", - "description": "accountingRuleId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PutAccountingRulesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutAccountingRulesResponse" - } - } - } - }, - "delete": { - "tags": [ - "Accounting Rules" - ], - "summary": "Delete a Accounting Rule", - "description": "Deletes a Accounting rule.", - "operationId": "deleteAccountingRule", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountingRuleId", - "in": "path", - "description": "accountingRuleId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteAccountingRulesResponse" - } - } - } - } - }, - "/accountingrules/template": { - "get": { - "tags": [ - "Accounting Rules" - ], - "summary": "Retrieve Accounting Rule Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\naccountingrules/template", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetAccountRulesTemplateResponse" - } - } - } - } - }, - "/adhocquery/{adHocId}": { - "get": { - "tags": [ - "AdhocQuery Api" - ], - "operationId": "retrieveAdHocQuery", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "adHocId", - "in": "path", - "description": "adHocId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "AdhocQuery Api" - ], - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "adHocId", - "in": "path", - "description": "adHocId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "AdhocQuery Api" - ], - "operationId": "deleteAdHocQuery", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "adHocId", - "in": "path", - "description": "adHocId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/adhocquery": { - "get": { - "tags": [ - "AdhocQuery Api" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "post": { - "tags": [ - "AdhocQuery Api" - ], - "operationId": "createAdHocQuery", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/adhocquery/template": { - "get": { - "tags": [ - "AdhocQuery Api" - ], - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/batches": { - "post": { - "tags": [ - "Batch API" - ], - "summary": "Batch requests in a single transaction", - "description": "The Apache Fineract Batch API is also capable of executing all the requests in a single transaction, by setting a Query Parameter, \"enclosingTransaction=true\". So, if one or more of the requests in a batch returns an erroneous response all of the Data base transactions made by other successful requests will be rolled back.\n\nIf there has been a rollback in a transaction then a single response will be provided, with a '400' status code and a body consisting of the error details of the first failed request.", - "operationId": "handleBatchRequests", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "enclosingTransaction", - "in": "query", - "description": "enclosingTransaction", - "required": false, - "type": "boolean", - "default": false - }, - { - "in": "body", - "name": "body", - "description": "request body", - "required": true, - "schema": { - "$ref": "#/definitions/PostBatchesRequest" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/BatchResponse" - } - } - } - } - }, - "/audits": { - "get": { - "tags": [ - "Audits" - ], - "summary": "List Audits", - "description": "Get a 200 list of audits that match the criteria supplied and sorted by audit id in descending order, and are within the requestors' data scope. Also it supports pagination and sorting\n\nExample Requests:\n\naudits\n\naudits?fields=madeOnDate,maker,processingResult\n\naudits?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n\naudits?officeId=1\n\naudits?officeId=1&includeJson=true", - "operationId": "retrieveAuditEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "actionName", - "in": "query", - "description": "actionName", - "required": false, - "type": "string" - }, - { - "name": "entityName", - "in": "query", - "description": "entityName", - "required": false, - "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "description": "resourceId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "makerId", - "in": "query", - "description": "makerId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "makerDateTimeFrom", - "in": "query", - "description": "makerDateTimeFrom", - "required": false, - "type": "string" - }, - { - "name": "makerDateTimeTo", - "in": "query", - "description": "makerDateTimeTo", - "required": false, - "type": "string" - }, - { - "name": "checkerId", - "in": "query", - "description": "checkerId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "checkerDateTimeFrom", - "in": "query", - "description": "checkerDateTimeFrom", - "required": false, - "type": "string" - }, - { - "name": "checkerDateTimeTo", - "in": "query", - "description": "checkerDateTimeTo", - "required": false, - "type": "string" - }, - { - "name": "processingResult", - "in": "query", - "description": "processingResult", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "groupId", - "in": "query", - "description": "groupId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "loanid", - "in": "query", - "description": "loanid", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "savingsAccountId", - "in": "query", - "description": "savingsAccountId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "paged", - "in": "query", - "description": "paged", - "required": false, - "type": "boolean" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetMakerCheckerResponse" - } - } - } - } - } - }, - "/audits/{auditId}": { - "get": { - "tags": [ - "Audits" - ], - "summary": "Retrieve an Audit Entry", - "description": "Example Requests:\n\naudits/20\naudits/20?fields=madeOnDate,maker,processingResult", - "operationId": "retrieveAuditEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "auditId", - "in": "path", - "description": "auditId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetMakerCheckerResponse" - } - } - } - } - }, - "/audits/searchtemplate": { - "get": { - "tags": [ - "Audits" - ], - "summary": "Audit Search Template", - "description": "This is a convenience resource. It can be useful when building an Audit Search UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with.\n\nExample Requests:\n\naudits/searchtemplate\naudits/searchtemplate?fields=actionNames", - "operationId": "retrieveAuditSearchTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetMakerCheckersSearchTemplateResponse" - } - } - } - } - }, - "/makercheckers/searchtemplate": { - "get": { - "tags": [ - "Maker Checker (or 4-eye) functionality" - ], - "summary": "Maker Checker Search Template", - "description": "This is a convenience resource. It can be useful when building a Checker Inbox UI. \"appUsers\" are data scoped to the office/branch the requestor is associated with. \"actionNames\" and \"entityNames\" returned are those that the requestor has Checker approval permissions for.\n\nExample Requests:\n\nmakercheckers/searchtemplate\nmakercheckers/searchtemplate?fields=entityNames", - "operationId": "retrieveAuditSearchTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetMakerCheckersSearchTemplateResponse" - } - } - } - } - }, - "/makercheckers/{auditId}": { - "post": { - "tags": [ - "Maker Checker (or 4-eye) functionality" - ], - "summary": "Approve Maker Checker Entry | Reject Maker Checker Entry", - "description": "", - "operationId": "approveMakerCheckerEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "auditId", - "in": "path", - "description": "auditId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostMakerCheckersResponse" - } - } - } - }, - "delete": { - "tags": [ - "Maker Checker (or 4-eye) functionality" - ], - "summary": "Delete Maker Checker Entry", - "description": "", - "operationId": "deleteMakerCheckerEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "auditId", - "in": "path", - "description": "auditId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostMakerCheckersResponse" - } - } - } - } - }, - "/makercheckers": { - "get": { - "tags": [ - "Maker Checker (or 4-eye) functionality" - ], - "summary": "List Maker Checker Entries", - "description": "Get a list of entries that can be checked by the requestor that match the criteria supplied.\n\nExample Requests:\n\nmakercheckers\n\nmakercheckers?fields=madeOnDate,maker,processingResult\n\nmakercheckers?makerDateTimeFrom=2013-03-25 08:00:00&makerDateTimeTo=2013-04-04 18:00:00\n\nmakercheckers?officeId=1\n\nmakercheckers?officeId=1&includeJson=true", - "operationId": "retrieveCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "actionName", - "in": "query", - "description": "actionName", - "required": false, - "type": "string" - }, - { - "name": "entityName", - "in": "query", - "description": "entityName", - "required": false, - "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "description": "resourceId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "makerId", - "in": "query", - "description": "makerId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "makerDateTimeFrom", - "in": "query", - "description": "makerDateTimeFrom", - "required": false, - "type": "string" - }, - { - "name": "makerDateTimeTo", - "in": "query", - "description": "makerDateTimeTo", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "groupId", - "in": "query", - "description": "groupId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "loanid", - "in": "query", - "description": "loanid", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "savingsAccountId", - "in": "query", - "description": "savingsAccountId", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetMakerCheckerResponse" - } - } - } - } - } - }, - "/accountnumberformats": { - "get": { - "tags": [ - "Account number format" - ], - "summary": "List Account number formats", - "description": "Example Requests:\n\naccountnumberformats\n\n\naccountnumberformats?fields=accountType,prefixType", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetAccountNumberFormatsIdResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Account number format" - ], - "summary": "Create an Account number format", - "description": "Note: You may associate a single Account number format for a given account type\nMandatory Fields for Account number formats\naccountType", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostAccountNumberFormatsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostAccountNumberFormatsResponse" - } - } - } - } - }, - "/accountnumberformats/{accountNumberFormatId}": { - "get": { - "tags": [ - "Account number format" - ], - "summary": "Retrieve an Account number format", - "description": "Example Requests:\n\naccountnumberformats/1\n\n\naccountnumberformats/1?template=true\n\n\naccountnumberformats/1?fields=accountType,prefixType", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountNumberFormatId", - "in": "path", - "description": "accountNumberFormatId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetAccountNumberFormatsIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Account number format" - ], - "summary": "Update an Account number format", - "description": "", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountNumberFormatId", - "in": "path", - "description": "accountNumberFormatId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutAccountNumberFormatsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutAccountNumberFormatsResponse" - } - } - } - }, - "delete": { - "tags": [ - "Account number format" - ], - "summary": "Delete an Account number format", - "description": "Note: Account numbers created while this format was active would remain unchanged.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountNumberFormatId", - "in": "path", - "description": "accountNumberFormatId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteAccountNumberFormatsResponse" - } - } - } - } - }, - "/accountnumberformats/template": { - "get": { - "tags": [ - "Account number format" - ], - "summary": "Retrieve Account number format Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Request:\n\naccountnumberformats/template", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetAccountNumberFormatsResponseTemplate" - } - } - } - } - }, - "/caches": { - "get": { - "tags": [ - "Cache" - ], - "summary": "Retrieve Cache Types", - "description": "Returns the list of caches.\n\nExample Requests:\n\ncaches", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetCachesResponse" - } - } - } - } - }, - "put": { - "tags": [ - "Cache" - ], - "summary": "Switch Cache", - "description": "Switches the cache to chosen one.", - "operationId": "switchCache", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutCachesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutCachesResponse" - } - } - } - } - }, - "/smscampaigns": { - "get": { - "tags": [ - "SMS Campaigns" - ], - "summary": "List SMS Campaigns", - "description": "Example Requests:\n\nsmscampaigns", - "operationId": "retrieveAllEmails", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "tags": [ - "SMS Campaigns" - ], - "summary": "Create a SMS Campaign", - "description": "Mandatory Fields\ncampaignName, campaignType, triggerType, providerId, runReportId, message\n\nMandatory Fields for Cash based on selected report id\nparamValue in json format", - "operationId": "createCampaign", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CommandWrapper" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - } - }, - "/smscampaigns/{campaignId}": { - "post": { - "tags": [ - "SMS Campaigns" - ], - "summary": "SMS Campaign", - "description": "Activates | Deactivates | Reactivates", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "campaignId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - }, - "put": { - "tags": [ - "SMS Campaigns" - ], - "summary": "Update a Campaign", - "description": "", - "operationId": "updateCampaign", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "campaignId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CommandWrapper" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - }, - "delete": { - "tags": [ - "SMS Campaigns" - ], - "summary": "Delete a SMS Campaign", - "description": "Note: Only closed SMS Campaigns can be deleted", - "operationId": "delete", - "parameters": [ - { - "name": "campaignId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - } - }, - "/smscampaigns/{resourceId}": { - "get": { - "tags": [ - "SMS Campaigns" - ], - "summary": "Retrieve a SMS Campaign", - "description": "Example Requests:\n\nsmscampaigns/1\n", - "operationId": "retrieveCampaign", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - } - }, - "/smscampaigns/template": { - "get": { - "tags": [ - "SMS Campaigns" - ], - "summary": "Retrieve a SMS Campaign", - "description": "Example Requests:\n\nsmscampaigns/1\n\n\nsmscampaigns/1?template=true\n\n\nsmscampaigns/template", - "operationId": "template", - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - } - } - } - } - }, - "/smscampaigns/preview": { - "post": { - "tags": [ - "SMS Campaigns" - ], - "operationId": "preview", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/codes/{codeId}/codevalues": { - "get": { - "tags": [ - "Code Values" - ], - "summary": "List Code Values", - "description": "Returns the list of Code Values for a given Code\n\nExample Requests:\n\ncodes/1/codevalues", - "operationId": "retrieveAllCodeValues", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "A List of Given response", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetCodeValuesDataResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Code Values" - ], - "summary": "Create a Code Value", - "description": "", - "operationId": "createCodeValue", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostCodeValuesDataRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostCodeValueDataResponse" - } - } - } - } - }, - "/codes/{codeId}/codevalues/{codeValueId}": { - "get": { - "tags": [ - "Code Values" - ], - "summary": "Retrieve a Code Value", - "description": "Returns the details of a Code Value\n\nExample Requests:\n\ncodes/1/codevalues/1", - "operationId": "retrieveCodeValue", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeValueId", - "in": "path", - "description": "codeValueId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetCodeValuesDataResponse" - } - } - } - }, - "put": { - "tags": [ - "Code Values" - ], - "summary": "Update a Code Value", - "description": "Updates the details of a code value.", - "operationId": "updateCodeValue", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "codeValueId", - "in": "path", - "description": "codeValueId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutCodeValuesDataRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutCodeValueDataResponse" - } - } - } - }, - "delete": { - "tags": [ - "Code Values" - ], - "summary": "Delete a Code Value", - "description": "Deletes a code value", - "operationId": "deleteCodeValue", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "codeValueId", - "in": "path", - "description": "codeValueId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteCodeValueDataResponse" - } - } - } - } - }, - "/codes": { - "get": { - "tags": [ - "Codes" - ], - "summary": "Retrieve Codes", - "description": "Returns the list of codes.\n\nExample Requests:\n\ncodes", - "operationId": "retrieveCodes", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetCodesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Codes" - ], - "summary": "Create a Code", - "description": "Creates a code. Codes created through api are always 'user defined' and so system defined is marked as false.", - "operationId": "createCode", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostCodesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostCodesResponse" - } - } - } - } - }, - "/codes/{codeId}": { - "get": { - "tags": [ - "Codes" - ], - "summary": "Retrieve a Code", - "description": "Returns the details of a Code.\n\nExample Requests:\n\ncodes/1", - "operationId": "retrieveCode", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetCodesResponse" - } - } - } - }, - "put": { - "tags": [ - "Codes" - ], - "summary": "Update a Code", - "description": "Updates the details of a code if it is not system defined.", - "operationId": "updateCode", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutCodesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutCodesResponse" - } - } - } - }, - "delete": { - "tags": [ - "Codes" - ], - "summary": "Delete a Code", - "description": "Deletes a code if it is not system defined.", - "operationId": "deleteCode", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "codeId", - "in": "path", - "description": "codeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteCodesResponse" - } - } - } - } - }, - "/externalservice/{servicename}": { - "get": { - "tags": [ - "External Services" - ], - "summary": "Retrieve External Services Configuration", - "description": "Returns a external Service configurations based on the Service Name.\n\nService Names supported are S3 and SMTP.\n\nExample Requests:\n\nexternalservice/SMTP", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "servicename", - "in": "path", - "description": "servicename", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ExternalServicesPropertiesData" - } - } - } - }, - "put": { - "tags": [ - "External Services" - ], - "summary": "Update External Service", - "description": "Updates the external Service Configuration for a Service Name.\n\nExample: \n\nexternalservice/S3", - "operationId": "updateExternalServiceProperties", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "servicename", - "in": "path", - "description": "servicename", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutExternalServiceRequest" - } - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/configurations/{configId}": { - "get": { - "tags": [ - "Global Configuration" - ], - "summary": "Retrieve Global Configuration", - "description": "Returns a global enable/disable configurations.\n\nExample Requests:\n\nconfigurations/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "configId", - "in": "path", - "description": "configId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetGlobalConfigurationsResponse" - } - } - } - }, - "put": { - "tags": [ - "Global Configuration" - ], - "summary": "Update Global Configuration", - "description": "Updates an enable/disable global configuration item.", - "operationId": "updateConfiguration", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "configId", - "in": "path", - "description": "configId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutGlobalConfigurationsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutGlobalConfigurationsResponse" - } - } - } - } - }, - "/configurations": { - "get": { - "tags": [ - "Global Configuration" - ], - "summary": "Retrieve Global Configuration | Retrieve Global Configuration for surveys", - "description": "Returns the list global enable/disable configurations.\n\nExample Requests:\n\nconfigurations\n\n\nReturns the list global enable/disable survey configurations.\n\nExample Requests:\n\nconfigurations/survey", - "operationId": "retrieveConfiguration", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "survey", - "in": "query", - "description": "survey", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "List of example \n response \nsurveys response \ngiven below", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetGlobalConfigurationsResponse" - } - } - } - } - } - }, - "/CreditBureauConfiguration/organisationCreditBureau": { - "get": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "getOrganisationCreditBureau", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "updateCreditBureau", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/CreditBureauConfiguration/loanProduct": { - "get": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "fetchLoanProducts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/CreditBureauConfiguration/mappings": { - "get": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "getCreditBureauLoanProductMapping", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "updateCreditBureauLoanProductMapping", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/CreditBureauConfiguration/organisationCreditBureau/{organisationCreditBureauId}": { - "post": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "addOrganisationCreditBureau", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "organisationCreditBureauId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/CreditBureauConfiguration/mappings/{CreditBureauId}": { - "post": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "createCreditBureauLoanProductMapping", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "CreditBureauId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/CreditBureauConfiguration": { - "get": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "getCreditBureau", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/CreditBureauConfiguration/config/{organisationCreditBureauId}": { - "get": { - "tags": [ - "CreditBureau Configuration" - ], - "operationId": "getConfiguration", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "organisationCreditBureauId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/datatables": { - "get": { - "tags": [ - "Data Tables" - ], - "summary": "List Data Tables", - "description": "Lists registered data tables and the Apache Fineract Core application table they are registered to.\n\nARGUMENTS\n\napptable - optional\nThe Apache Fineract core application table.\n\nExample Requests:\n\ndatatables?apptable=m_client\n\n\ndatatables", - "operationId": "getDatatables", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "apptable", - "in": "query", - "description": "apptable", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetDataTablesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Data Tables" - ], - "summary": "Create Data Table", - "description": "Create a new data table and registers it with the Apache Fineract Core application table.\n\nField Descriptions\n\nMandatory - datatableName : \n\nThe name of the Data Table.\n\nMandatory - apptableName\n\nApplication table name. Must be one of the following:\n\nm_client\n\nm_group\n\nm_loan\n\nm_office\n\nm_saving_account\n\nm_product_loan\n\nm_savings_product\n\nMandatory - columns \nAn array of columns in the new Data Table.\n\nOptional - multiRow\n\nAllows to create multiple entries in the Data Table. Optional, defaults to false. If this property is not provided Data Table will allow only one entry.\n\nField Descriptions - columns\n\nMandatory - name\n\nName of the created column. Can contain only alphanumeric characters, underscores and spaces, but cannot start with a number. Cannot start or end with an underscore or space.\n\nMandatory - type\n\nColumn type. Must be one of the following:\n\nBoolean\n\nDate\n\nDateTime\n\nDecimal\n\nDropdown\n\n\nNumber\n\nString\n\nText\n\nMandatory [type = Dropdown] - code\n\nUsed in Code Value fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned.\n\nOptional - mandatory\n\nDetermines whether this column must have a value in every entry. Optional, defaults to false.\n\nMandatory [type = String] - length\n\nLength of the text field. Mandatory if type String is used, otherwise an error is returned.", - "operationId": "createDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostDataTablesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostDataTablesResponse" - } - } - } - } - }, - "/datatables/register/{datatable}/{apptable}": { - "post": { - "tags": [ - "Data Tables" - ], - "summary": "Register Data Table", - "description": "Registers a data table with the Apache Fineract Core application table. This allows the data table to be maintained through the API. In case the datatable is a PPI (survey table), a parameter category should be pass along with the request. The API currently support one category (200)", - "operationId": "registerDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - }, - { - "name": "apptable", - "in": "path", - "description": "apptable", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostDataTablesRegisterDatatableAppTable" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutDataTablesResponse" - } - } - } - } - }, - "/datatables/deregister/{datatable}": { - "post": { - "tags": [ - "Data Tables" - ], - "summary": "Deregister Data Table", - "description": "Deregisters a data table. It will no longer be available through the API.", - "operationId": "deregisterDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutDataTablesResponse" - } - } - } - } - }, - "/datatables/{datatableName}": { - "put": { - "tags": [ - "Data Tables" - ], - "summary": "Update Data Table", - "description": "Modifies fields of a data table. If the apptableName parameter is passed, data table is deregistered and registered with the new application table.", - "operationId": "updateDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatableName", - "in": "path", - "description": "datatableName", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutDataTablesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutDataTablesResponse" - } - } - } - }, - "delete": { - "tags": [ - "Data Tables" - ], - "summary": "Delete Data Table", - "description": "Deletes a data table and deregisters it from the Apache Fineract Core application table.", - "operationId": "deleteDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatableName", - "in": "path", - "description": "datatableName", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteDataTablesResponse" - } - } - } - } - }, - "/datatables/{datatable}/{apptableId}/{datatableId}": { - "get": { - "tags": [ - "Data Tables" - ], - "operationId": "getDatatableManyEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "datatableId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "order", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "Data Tables" - ], - "summary": "Update Entry in Data Table (One to Many)", - "description": "Updates the row (if it exists) of the data table.", - "operationId": "updateDatatableEntryOneToMany", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "datatableId", - "in": "path", - "description": "datatableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutDataTablesAppTableIdDatatableIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutDataTablesAppTableIdDatatableIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Data Tables" - ], - "summary": "Delete Entry in Datatable (One to Many)", - "description": "Deletes the entry (if it exists) for data tables that are one to many with the application table.\n\n", - "operationId": "deleteDatatableEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "body", - "x-example": "{}" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "datatableId", - "in": "path", - "description": "datatableId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteDataTablesDatatableAppTableIdDatatableIdResponse" - } - } - } - } - }, - "/datatables/{datatable}/{apptableId}": { - "get": { - "tags": [ - "Data Tables" - ], - "summary": "Retrieve Entry(s) from Data Table", - "description": "Gets the entry (if it exists) for data tables that are one to one with the application table. \nGets the entries (if they exist) for data tables that are one to many with the application table.\n\nNote: The 'fields' parameter is not available for datatables.\n\nARGUMENTS\norderoptional Specifies the order in which data is returned.genericResultSetoptional, defaults to false If 'true' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality.\nExample Requests:\n\ndatatables/extra_client_details/1\n\n\ndatatables/extra_family_details/1?order=`Date of Birth` desc\n\n\ndatatables/extra_client_details/1?genericResultSet=true", - "operationId": "getDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "order", - "in": "query", - "description": "order", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetDataTablesAppTableIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Data Tables" - ], - "summary": "Create Entry in Data Table", - "description": "Adds a row to the data table.\n\nNote that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name \"Business Description\" is considered the same as \"Business_Description\". So you shouldn't have both \"versions\" in any data table.", - "operationId": "createDatatableEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostDataTablesAppTableIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostDataTablesAppTableIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Data Tables" - ], - "summary": "Update Entry in Data Table (One to One)", - "description": "Updates the row (if it exists) of the data table.", - "operationId": "updateDatatableEntryOnetoOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutDataTablesAppTableIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutDataTablesAppTableIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Data Tables" - ], - "summary": "Delete Entry(s) in Data Table", - "description": "Deletes the entry (if it exists) for data tables that are one-to-one with the application table. \nDeletes the entries (if they exist) for data tables that are one-to-many with the application table.", - "operationId": "deleteDatatableEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteDataTablesDatatableAppTableIdResponse" - } - } - } - } - }, - "/datatables/{datatable}": { - "get": { - "tags": [ - "Data Tables" - ], - "summary": "Retrieve Data Table Details", - "description": "Lists a registered data table details and the Apache Fineract Core application table they are registered to.", - "operationId": "getDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "datatable", - "in": "path", - "description": "datatable", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetDataTablesResponse" - } - } - } - } - }, - "/entityDatatableChecks/{entityDatatableCheckId}": { - "delete": { - "tags": [ - "Entity Datatable Check" - ], - "summary": "Delete Entity-Datatable Checks", - "description": "Deletes an existing Entity-Datatable Check", - "operationId": "deleteDatatable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityDatatableCheckId", - "in": "path", - "description": "entityDatatableCheckId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteEntityDatatableChecksTemplateResponse" - } - } - } - } - }, - "/entityDatatableChecks": { - "get": { - "tags": [ - "Entity Datatable Check" - ], - "summary": "List Entity-Datatable Checks", - "description": "The list capability of Entity-Datatable Checks can support pagination.\n\nOPTIONAL ARGUMENTS\noffset Integer optional, defaults to 0 Indicates the result from which pagination startslimit Integer optional, defaults to 200 Restricts the size of results returned. To override the default and return all entries you must explicitly pass a non-positive integer value for limit e.g. limit=0, or limit=-1\nExample Request:\n\nentityDatatableChecks?offset=0&limit=15", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "status", - "in": "query", - "description": "status", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "entity", - "in": "query", - "description": "entity", - "required": false, - "type": "string" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetEntityDatatableChecksResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Entity Datatable Check" - ], - "summary": "Create Entity-Datatable Checks", - "description": "Mandatory Fields : \nentity, status, datatableName\n\nNon-Mandatory Fields : \nproductId", - "operationId": "createEntityDatatableCheck", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostEntityDatatableChecksTemplateRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostEntityDatatableChecksTemplateResponse" - } - } - } - } - }, - "/entityDatatableChecks/template": { - "get": { - "tags": [ - "Entity Datatable Check" - ], - "summary": "Retrieve Entity-Datatable Checks Template", - "description": "This is a convenience resource useful for building maintenance user interface screens for Entity-Datatable Checks applications. The template data returned consists of:\n\nAllowed Value Lists\nExample Request:\n\nentityDatatableChecks/template", - "operationId": "getTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetEntityDatatableChecksTemplateResponse" - } - } - } - } - }, - "/reports/{id}": { - "get": { - "tags": [ - "Reports" - ], - "summary": "Retrieve a Report\n", - "description": "Example Requests:\n\nreports/1\n\n\nreports/1?template=true", - "operationId": "retrieveReport", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetReportsResponse" - } - } - } - }, - "put": { - "tags": [ - "Reports" - ], - "summary": "Update a Report", - "description": "Only the useReport value can be updated for core reports.", - "operationId": "updateReport", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutReportRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutReportResponse" - } - } - } - }, - "delete": { - "tags": [ - "Reports" - ], - "summary": "Delete a Report", - "description": "Only non-core reports can be deleted.", - "operationId": "deleteReport", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteReportsResponse" - } - } - } - } - }, - "/reports/template": { - "get": { - "tags": [ - "Reports" - ], - "summary": "Retrieve Report Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Request : \n\nreports/template", - "operationId": "retrieveOfficeTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetReportsTemplateResponse" - } - } - } - } - }, - "/reports": { - "get": { - "tags": [ - "Reports" - ], - "summary": "List Reports", - "description": "Lists all reports and their parameters.\n\nExample Request:\n\nreports", - "operationId": "retrieveReportList", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Reports" - ], - "summary": "Create a Report", - "description": "", - "operationId": "createReport", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRepostRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostReportsResponse" - } - } - } - } - }, - "/runreports/{reportName}": { - "get": { - "tags": [ - "Run Reports" - ], - "summary": "Running a Report", - "description": "This resource allows you to run and receive output from pre-defined Apache Fineract reports.\n\nReports can also be used to provide data for searching and workflow functionality.\n\nThe default output is a JSON formatted \"Generic Resultset\". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding \"&exportCSV=true\" to the end of your URL.\n\nIf Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats.\n\nThe Apache Fineract reference application uses a JQuery plugin called stretchy reporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI).\n\n\n\nExample Requests:\n\nrunreports/Client%20Listing?R_officeId=1\n\n\nrunreports/Client%20Listing?R_officeId=1&exportCSV=true\n\n\nrunreports/OfficeIdSelectOne?R_officeId=1¶meterType=true\n\n\nrunreports/OfficeIdSelectOne?R_officeId=1¶meterType=true&exportCSV=true\n\n\nrunreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=HTML&R_officeId=1\n\n\nrunreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=XLS&R_officeId=1\n\n\nrunreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=CSV&R_officeId=1\n\n\nrunreports/Expected%20Payments%20By%20Date%20-%20Formatted?R_endDate=2013-04-30&R_loanOfficerId=-1&R_officeId=1&R_startDate=2013-04-16&output-type=PDF&R_officeId=1", - "operationId": "runReport", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json", - "text/csv", - "application/vnd.ms-excel", - "application/pdf", - "text/html" - ], - "parameters": [ - { - "name": "reportName", - "in": "path", - "description": "reportName", - "required": true, - "type": "string" - }, - { - "name": "isSelfServiceUserReport", - "in": "query", - "description": "isSelfServiceUserReport", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetReportNameResponse" - } - } - } - } - }, - "/{entityType}/{entityId}/documents/{documentId}/attachment": { - "get": { - "tags": [ - "Documents" - ], - "summary": "Retrieve Binary File associated with Document", - "description": "Request used to download the file associated with the document\n\nExample Requests:\n\nclients/1/documents/1/attachment\n\n\nloans/1/documents/1/attachment", - "operationId": "downloadFile", - "consumes": [ - "application/json" - ], - "produces": [ - "application/octet-stream" - ], - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "entityType", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "documentId", - "in": "path", - "description": "documentId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Not Shown: The corresponding Binary file" - } - } - } - }, - "/{entityType}/{entityId}/documents": { - "get": { - "tags": [ - "Documents" - ], - "summary": "List documents", - "description": "Example Requests:\n\nclients/1/documents\n\nclient_identifiers/1/documents\n\nloans/1/documents?fields=name,description", - "operationId": "retreiveAllDocuments", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "entityType", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetEntityTypeEntityIdDocumentsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Documents" - ], - "summary": "Create a Document", - "description": "Note: A document is created using a Multi-part form upload \n\nBody Parts\n\nname : \nName or summary of the document\n\ndescription : \nDescription of the document\n\nfile : \nThe file to be uploaded\n\nMandatory Fields : \nfile and description", - "operationId": "createDocument", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "entityType", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "Content-Length", - "in": "header", - "description": "Content-Length", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "file", - "in": "formData", - "description": "file", - "required": false, - "type": "file" - }, - { - "name": "name", - "in": "formData", - "description": "name", - "required": false, - "type": "string" - }, - { - "name": "description", - "in": "formData", - "description": "description", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Not Shown (multi-part form data)", - "schema": { - "$ref": "#/definitions/PostEntityTypeEntityIdDocumentsResponse" - } - } - } - } - }, - "/{entityType}/{entityId}/documents/{documentId}": { - "get": { - "tags": [ - "Documents" - ], - "summary": "Retrieve a Document", - "description": "Example Requests:\n\nclients/1/documents/1\n\n\nloans/1/documents/1\n\n\nclient_identifiers/1/documents/1?fields=name,description", - "operationId": "getDocument", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "entityType", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "documentId", - "in": "path", - "description": "documentId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetEntityTypeEntityIdDocumentsResponse" - } - } - } - }, - "put": { - "tags": [ - "Documents" - ], - "summary": "Update a Document", - "description": "Note: A document is updated using a Multi-part form upload \nBody Parts\nname\nName or summary of the document\ndescription\nDescription of the document\nfile\nThe file to be uploaded", - "operationId": "updateDocument", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "entityType", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "documentId", - "in": "path", - "description": "documentId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "Content-Length", - "in": "header", - "description": "Content-Length", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "file", - "in": "formData", - "description": "file", - "required": false, - "type": "file" - }, - { - "name": "name", - "in": "formData", - "description": "name", - "required": false, - "type": "string" - }, - { - "name": "description", - "in": "formData", - "description": "description", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Not Shown (multi-part form data)", - "schema": { - "$ref": "#/definitions/PutEntityTypeEntityIdDocumentsResponse" - } - } - } - }, - "delete": { - "tags": [ - "Documents" - ], - "summary": "Remove a Document", - "description": "", - "operationId": "deleteDocument", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "entityType", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "documentId", - "in": "path", - "description": "documentId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteEntityTypeEntityIdDocumentsResponse" - } - } - } - } - }, - "/{entity}/{entityId}/images": { - "get": { - "tags": [ - "DomainNameapiv1{entity}{entityId}images" - ], - "operationId": "retrieveImage", - "consumes": [ - "text/plain", - "text/html", - "application/json" - ], - "produces": [ - "text/plain" - ], - "parameters": [ - { - "name": "entity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "maxWidth", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "maxHeight", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "output", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - }, - "post": { - "tags": [ - "DomainNameapiv1{entity}{entityId}images" - ], - "operationId": "addNewClientImage", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "Content-Length", - "in": "header", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "DomainNameapiv1{entity}{entityId}images" - ], - "operationId": "updateClientImage", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "Content-Length", - "in": "header", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "DomainNameapiv1{entity}{entityId}images" - ], - "operationId": "deleteClientImage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "entityId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/entitytoentitymapping/{mapId}/{fromId}/{toId}": { - "get": { - "tags": [ - "DomainNameapiv1entitytoentitymapping" - ], - "operationId": "getEntityToEntityMappings", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mapId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "fromId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "toId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/entitytoentitymapping": { - "get": { - "tags": [ - "DomainNameapiv1entitytoentitymapping" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/entitytoentitymapping/{mapId}": { - "get": { - "tags": [ - "DomainNameapiv1entitytoentitymapping" - ], - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mapId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "DomainNameapiv1entitytoentitymapping" - ], - "operationId": "updateMap", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mapId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "DomainNameapiv1entitytoentitymapping" - ], - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "mapId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/entitytoentitymapping/{relId}": { - "post": { - "tags": [ - "DomainNameapiv1entitytoentitymapping" - ], - "operationId": "createMap", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "relId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/hooks/{hookId}": { - "get": { - "tags": [ - "Hooks" - ], - "summary": "Retrieve a Hook", - "description": "Returns the details of a Hook.\n\nExample Requests:\n\nhooks/1", - "operationId": "retrieveHook", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "hookId", - "in": "path", - "description": "hookId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetHookResponse" - } - } - } - }, - "put": { - "tags": [ - "Hooks" - ], - "summary": "Update a Hook", - "description": "Updates the details of a hook.", - "operationId": "updateHook", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "hookId", - "in": "path", - "description": "hookId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutHookRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutHookResponse" - } - } - } - }, - "delete": { - "tags": [ - "Hooks" - ], - "summary": "Delete a Hook", - "description": "Deletes a hook.", - "operationId": "deleteHook", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "hookId", - "in": "path", - "description": "hookId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteHookResponse" - } - } - } - } - }, - "/hooks": { - "get": { - "tags": [ - "Hooks" - ], - "summary": "Retrieve Hooks", - "description": "Returns the list of hooks.\n\nExample Requests:\n\nhooks", - "operationId": "retrieveHooks", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetHookResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Hooks" - ], - "summary": "Create a Hook", - "description": "The following parameters can be passed for the creation of a hook :-\n\nname - string - Required. The name of the template that is being called. (See /hooks/template for the list of valid hook names.)\n\nisActive - boolean - Determines whether the hook is actually triggered.\n\nevents - array - Determines what events the hook is triggered for.\n\nconfig - hash - Required. Key/value pairs to provide settings for this hook. These settings vary between the templates.\n\ntemplateId - Optional. The UGD template ID associated with the same entity (client or loan).", - "operationId": "createHook", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostHookRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostHookResponse" - } - } - } - } - }, - "/hooks/template": { - "get": { - "tags": [ - "Hooks" - ], - "summary": "Retrieve Hooks Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nhooks/template", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetHookTemplateResponse" - } - } - } - } - }, - "/scheduler": { - "get": { - "tags": [ - "Scheduler" - ], - "summary": "Retrieve Scheduler Status", - "description": "Returns the scheduler status.\n\nExample Requests:\n\nscheduler", - "operationId": "retrieveStatus", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetSchedulerResponse" - } - } - } - }, - "post": { - "tags": [ - "Scheduler" - ], - "summary": "Activate Scheduler Jobs | Suspend Scheduler Jobs", - "description": "Activates the scheduler job service. | Suspends the scheduler job service.", - "operationId": "changeSchedulerStatus", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "POST : scheduler?command=start\n\n\nPOST : scheduler?command=stop" - } - } - } - }, - "/jobs/{jobId}/runhistory": { - "get": { - "tags": [ - "MIFOSX-BATCH JOBS" - ], - "summary": "Retrieve Job Run History", - "description": "Example Requests:\n\njobs/5/runhistory?offset=0&limit=200", - "operationId": "retrieveHistory", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "jobId", - "in": "path", - "description": "jobId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetJobsJobIDJobRunHistoryResponse" - } - } - } - } - }, - "/jobs/{jobId}": { - "get": { - "tags": [ - "MIFOSX-BATCH JOBS" - ], - "summary": "Retrieve a Job", - "description": "Returns the details of a Job.\n\nExample Requests:\n\njobs/5", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "jobId", - "in": "path", - "description": "jobId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetJobsResponse" - } - } - } - }, - "post": { - "tags": [ - "MIFOSX-BATCH JOBS" - ], - "summary": "Run a Job", - "description": "Manually Execute Specific Job.", - "operationId": "executeJob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "jobId", - "in": "path", - "description": "jobId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "POST: jobs/1?command=executeJob" - } - } - }, - "put": { - "tags": [ - "MIFOSX-BATCH JOBS" - ], - "summary": "Update a Job", - "description": "Updates the details of a job.", - "operationId": "updateJobDetail", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "jobId", - "in": "path", - "description": "jobId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutJobsJobsIDRequest" - } - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/jobs": { - "get": { - "tags": [ - "MIFOSX-BATCH JOBS" - ], - "summary": "Retrieve Scheduler Jobs", - "description": "Returns the list of jobs.\n\nExample Requests:\n\njobs", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetJobsResponse" - } - } - } - } - } - }, - "/reportmailingjobs": { - "get": { - "tags": [ - "Report Mailing Jobs" - ], - "summary": "List Report Mailing Jobs", - "description": "Example Requests:\n\nreportmailingjobs", - "operationId": "retrieveAllReportMailingJobs", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetReportMailingJobsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Report Mailing Jobs" - ], - "summary": "Create a Report Mailing Job", - "description": "Mandatory Fields: name, startDateTime, stretchyReportId, emailRecipients, emailSubject, emailMessage, emailAttachmentFileFormatId, recurrence, isActive\n\nOptional Fields: description, stretchyReportParamMap", - "operationId": "createReportMailingJob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostReportMailingJobsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostReportMailingJobsResponse" - } - } - } - } - }, - "/reportmailingjobs/{entityId}": { - "get": { - "tags": [ - "Report Mailing Jobs" - ], - "summary": "Retrieve a Report Mailing Job", - "description": "Example Requests:\n\nreportmailingjobs/1\n\n\nreportmailingjobs/1?template=true", - "operationId": "retrieveReportMailingJob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetReportMailingJobsResponse" - } - } - } - }, - "put": { - "tags": [ - "Report Mailing Jobs" - ], - "summary": "Update a Report Mailing Job\n", - "description": "", - "operationId": "updateReportMailingJob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutReportMailingJobsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutReportMailingJobsResponse" - } - } - } - }, - "delete": { - "tags": [ - "Report Mailing Jobs" - ], - "summary": "Delete a Report Mailing Job", - "description": "", - "operationId": "deleteReportMailingJob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entityId", - "in": "path", - "description": "entityId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DeleteReportMailingJobsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteReportMailingJobsResponse" - } - } - } - } - }, - "/reportmailingjobs/template": { - "get": { - "tags": [ - "Report Mailing Jobs" - ], - "summary": "Retrieve Report Mailing Job Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for report mailing job applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nreportmailingjobs/template", - "operationId": "retrieveReportMailingJobTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetReportMailingJobsTemplate" - } - } - } - } - }, - "/reportmailingjobrunhistory": { - "get": { - "tags": [ - "List Report Mailing Job History" - ], - "summary": "List Report Mailing Job History", - "description": "The list capability of report mailing job history can support pagination and sorting.\n\nExample Requests:\n\nreportmailingjobrunhistory/1", - "operationId": "retrieveAllByReportMailingJobId", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "reportMailingJobId", - "in": "query", - "description": "reportMailingJobId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ReportMailingJobRunHistoryData" - } - } - } - } - }, - "/authentication": { - "post": { - "tags": [ - "Authentication HTTP Basic" - ], - "summary": "Verify authentication", - "description": "Authenticates the credentials provided and returns the set roles and permissions allowed.", - "operationId": "authenticate", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "username", - "in": "query", - "description": "username", - "required": false, - "type": "string" - }, - { - "name": "password", - "in": "query", - "description": "password", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostAuthenticationResponse" - } - }, - "400": { - "description": "Unauthenticated. Please login" - } - } - } - }, - "/userdetails": { - "get": { - "tags": [ - "Fetch authenticated user details" - ], - "summary": "Fetch authenticated user details\n", - "description": "checks the Authentication and returns the set roles and permissions allowed.", - "operationId": "fetchAuthenticatedUserData", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "access_token", - "in": "query", - "description": "access_token", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetUserDetailsResponse" - } - } - } - } - }, - "/sms/{campaignId}/messageByStatus": { - "get": { - "tags": [ - "SMS" - ], - "operationId": "retrieveAllSmsByStatus", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "campaignId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "status", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromDate", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "toDate", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "locale", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sqlSearch", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/sms": { - "get": { - "tags": [ - "SMS" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "post": { - "tags": [ - "SMS" - ], - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/sms/{resourceId}": { - "get": { - "tags": [ - "SMS" - ], - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "SMS" - ], - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "SMS" - ], - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/likelihood/{ppiName}": { - "get": { - "tags": [ - "Likelihood" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "ppiName", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/likelihood/{ppiName}/{likelihoodId}": { - "get": { - "tags": [ - "Likelihood" - ], - "operationId": "retrieve", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "likelihoodId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "Likelihood" - ], - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "likelihoodId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/povertyLine/{ppiName}": { - "get": { - "tags": [ - "Poverty Line" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "ppiName", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/povertyLine/{ppiName}/{likelihoodId}": { - "get": { - "tags": [ - "Poverty Line" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "ppiName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "likelihoodId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/survey/{surveyName}/{apptableId}": { - "post": { - "tags": [ - "Survey" - ], - "summary": "Create an entry in the survey table", - "description": "Insert and entry in a survey table (full fill the survey).\n\nRefer Link for sample Body: [ https://demo.openmf.org/api-docs/apiLive.htm#survey_create ] ", - "operationId": "createDatatableEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyName", - "in": "path", - "description": "surveyName", - "required": true, - "type": "string" - }, - { - "name": "apptableId", - "in": "path", - "description": "apptableId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSurveySurveyNameApptableIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostSurveySurveyNameApptableIdResponse" - } - } - } - } - }, - "/survey/{surveyName}/{clientId}/{fulfilledId}": { - "delete": { - "tags": [ - "Survey" - ], - "operationId": "deleteDatatableEntries", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "fulfilledId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/survey/{surveyName}/{clientId}": { - "get": { - "tags": [ - "Survey" - ], - "operationId": "getClientSurveyOverview", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/survey/{surveyName}/{clientId}/{entryId}": { - "get": { - "tags": [ - "Survey" - ], - "operationId": "getSurveyEntry", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "entryId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/survey/{surveyName}": { - "get": { - "tags": [ - "Survey" - ], - "summary": "Retrieve survey", - "description": "Lists a registered survey table details and the Apache Fineract Core application table they are registered to.", - "operationId": "retrieveSurvey", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyName", - "in": "path", - "description": "surveyName", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetSurveyResponse" - } - } - } - } - }, - "/survey": { - "get": { - "tags": [ - "Survey" - ], - "summary": "Retrieve surveys", - "description": "Retrieve surveys. This allows to retrieve the list of survey tables registered .", - "operationId": "retrieveSurveys", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetSurveyResponse" - } - } - } - } - } - }, - "/survey/register/{surveyName}/{apptable}": { - "put": { - "tags": [ - "Survey" - ], - "operationId": "register", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "apptable", - "in": "path", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/interoperation/accounts/{accountId}": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Account details", - "description": "", - "operationId": "getAccountDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropAccountData" - } - } - } - } - }, - "/interoperation/accounts/{accountId}/transactions": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query transactions by Account Id", - "description": "", - "operationId": "getAccountTransactions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "string" - }, - { - "name": "debit", - "in": "query", - "description": "debit", - "required": false, - "type": "boolean", - "default": true - }, - { - "name": "credit", - "in": "query", - "description": "credit", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "fromBookingDateTime", - "in": "query", - "description": "fromBookingDateTime", - "required": false, - "type": "string" - }, - { - "name": "toBookingDateTime", - "in": "query", - "description": "toBookingDateTime", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropTransactionsData" - } - } - } - } - }, - "/interoperation/accounts/{accountId}/identifiers": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation secondary identifiers by Account Id", - "description": "", - "operationId": "getAccountIdentifiers", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifiersResponseData" - } - } - } - } - }, - "/interoperation/parties/{idType}/{idValue}": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Account by secondary identifier", - "description": "", - "operationId": "getAccountByIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "idType", - "in": "path", - "description": "idType", - "required": true, - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - { - "name": "idValue", - "in": "path", - "description": "idValue", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifierAccountResponseData" - } - } - } - }, - "post": { - "tags": [ - "interoperation" - ], - "summary": "Interoperation Identifier registration", - "description": "", - "operationId": "registerAccountIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "idType", - "in": "path", - "description": "idType", - "required": true, - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - { - "name": "idValue", - "in": "path", - "description": "idValue", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropIdentifierRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifierAccountResponseData" - } - } - } - }, - "delete": { - "tags": [ - "interoperation" - ], - "summary": "Allow Interoperation Identifier registration", - "description": "", - "operationId": "deleteAccountIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "idType", - "in": "path", - "description": "idType", - "required": true, - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - { - "name": "idValue", - "in": "path", - "description": "idValue", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropIdentifierRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifierAccountResponseData" - } - } - } - } - }, - "/interoperation/parties/{idType}/{idValue}/{subIdOrType}": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Account by secondary identifier", - "description": "", - "operationId": "getAccountByIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "idType", - "in": "path", - "description": "idType", - "required": true, - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - { - "name": "idValue", - "in": "path", - "description": "idValue", - "required": true, - "type": "string" - }, - { - "name": "subIdOrType", - "in": "path", - "description": "subIdOrType", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifierAccountResponseData" - } - } - } - }, - "post": { - "tags": [ - "interoperation" - ], - "summary": "Interoperation Identifier registration", - "description": "", - "operationId": "registerAccountIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "idType", - "in": "path", - "description": "idType", - "required": true, - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - { - "name": "idValue", - "in": "path", - "description": "idValue", - "required": true, - "type": "string" - }, - { - "name": "subIdOrType", - "in": "path", - "description": "subIdOrType", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropIdentifierRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifierAccountResponseData" - } - } - } - }, - "delete": { - "tags": [ - "interoperation" - ], - "summary": "Allow Interoperation Identifier registration", - "description": "", - "operationId": "deleteAccountIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "idType", - "in": "path", - "description": "idType", - "required": true, - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - { - "name": "idValue", - "in": "path", - "description": "idValue", - "required": true, - "type": "string" - }, - { - "name": "subIdOrType", - "in": "path", - "description": "subIdOrType", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropIdentifierRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropIdentifierAccountResponseData" - } - } - } - } - }, - "/interoperation/transactions/{transactionCode}/requests/{requestCode}": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Transaction Request", - "description": "", - "operationId": "getTransactionRequest", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "transactionCode", - "in": "path", - "description": "transactionCode", - "required": true, - "type": "string" - }, - { - "name": "requestCode", - "in": "path", - "description": "requestCode", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropTransactionRequestResponseData" - } - } - } - } - }, - "/interoperation/requests": { - "post": { - "tags": [ - "interoperation" - ], - "summary": "Allow Interoperation Transaction Request", - "description": "", - "operationId": "createTransactionRequest", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropTransactionRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropTransactionRequestResponseData" - } - } - } - } - }, - "/interoperation/transactions/{transactionCode}/quotes/{quoteCode}": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Quote", - "description": "", - "operationId": "getQuote", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "transactionCode", - "in": "path", - "description": "transactionCode", - "required": true, - "type": "string" - }, - { - "name": "quoteCode", - "in": "path", - "description": "quoteCode", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropQuoteResponseData" - } - } - } - } - }, - "/interoperation/quotes": { - "post": { - "tags": [ - "interoperation" - ], - "summary": "Calculate Interoperation Quote", - "description": "", - "operationId": "createQuote", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropQuoteRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropQuoteResponseData" - } - } - } - } - }, - "/interoperation/transactions/{transactionCode}/transfers/{transferCode}": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Transfer", - "description": "", - "operationId": "getTransfer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "transactionCode", - "in": "path", - "description": "transactionCode", - "required": true, - "type": "string" - }, - { - "name": "transferCode", - "in": "path", - "description": "transferCode", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropTransferResponseData" - } - } - } - } - }, - "/interoperation/transfers": { - "post": { - "tags": [ - "interoperation" - ], - "summary": "Prepare Interoperation Transfer", - "description": "", - "operationId": "performTransfer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "action", - "in": "query", - "description": "action", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/InteropTransferRequestData" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/InteropTransferResponseData" - } - } - } - } - }, - "/interoperation/health": { - "get": { - "tags": [ - "interoperation" - ], - "summary": "Query Interoperation Health Request", - "description": "", - "operationId": "health", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/mixreport": { - "get": { - "tags": [ - "Mix Report" - ], - "operationId": "retrieveXBRLReport", - "produces": [ - "application/xml" - ], - "parameters": [ - { - "name": "startDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "endDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "currency", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/mixtaxonomy": { - "get": { - "tags": [ - "Mix Taxonomy" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/mixmapping": { - "get": { - "tags": [ - "Mix Mapping " - ], - "operationId": "retrieveTaxonomyMapping", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "Mix Mapping " - ], - "operationId": "updateTaxonomyMapping", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/notifications": { - "get": { - "tags": [ - "Notification" - ], - "operationId": "getAllNotifications", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "orderBy", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "sortOrder", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "isRead", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "Notification" - ], - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/holidays/{holidayId}": { - "get": { - "tags": [ - "Holidays" - ], - "summary": "Retrieve a Holiday", - "description": "Example Requests:\n\nholidays/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "holidayId", - "in": "path", - "description": "holidayId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetHolidaysResponse" - } - } - } - }, - "post": { - "tags": [ - "Holidays" - ], - "summary": "Activate a Holiday", - "description": "Always Holidays are created in pending state. This API allows to activate a holiday.\n\nOnly the active holidays are considered for rescheduling the loan repayment.", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "holidayId", - "in": "path", - "description": "holidayId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostHolidaysHolidayIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostHolidaysHolidayIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Holidays" - ], - "summary": "Update a Holiday", - "description": "If a holiday is in pending state (created and not activated) then all fields are allowed to modify. Once holidays become active only name and descriptions are allowed to modify.", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "holidayId", - "in": "path", - "description": "holidayId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutHolidaysHolidayIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutHolidaysHolidayIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Holidays" - ], - "summary": "Delete a Holiday", - "description": "This API allows to delete a holiday. This is a soft delete the deleted holiday status is marked as deleted.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "holidayId", - "in": "path", - "description": "holidayId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteHolidaysHolidayIdResponse" - } - } - } - } - }, - "/holidays": { - "get": { - "tags": [ - "Holidays" - ], - "summary": "List Holidays", - "description": "Example Requests:\n\nholidays?officeId=1", - "operationId": "retrieveAllHolidays", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromDate", - "in": "query", - "description": "fromDate", - "required": false, - "type": "string" - }, - { - "name": "toDate", - "in": "query", - "description": "toDate", - "required": false, - "type": "string" - }, - { - "name": "locale", - "in": "query", - "description": "locale", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "query", - "description": "dateFormat", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetHolidaysResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Holidays" - ], - "summary": "Create a Holiday", - "description": "Mandatory Fields: name, description, fromDate, toDate, repaymentsRescheduledTo, offices", - "operationId": "createNewHoliday", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostHolidaysRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostHolidaysResponse" - } - } - } - } - }, - "/holidays/template": { - "get": { - "tags": [ - "Holidays" - ], - "operationId": "retrieveRepaymentScheduleUpdationTyeOptions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/currencies": { - "get": { - "tags": [ - "Currency" - ], - "summary": "Retrieve Currency Configuration", - "description": "Returns the list of currencies permitted for use AND the list of currencies not selected (but available for selection).\n\nExample Requests:\n\ncurrencies\n\n\ncurrencies?fields=selectedCurrencyOptions", - "operationId": "retrieveCurrencies", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetCurrenciesResponse" - } - } - } - }, - "put": { - "tags": [ - "Currency" - ], - "summary": "Update Currency Configuration", - "description": "Updates the list of currencies permitted for use.", - "operationId": "updateCurrencies", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutCurrenciesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutCurrenciesResponse" - } - } - } - } - }, - "/officetransactions": { - "get": { - "tags": [ - "officetransactions" - ], - "operationId": "retrieveOfficeTransactions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "post": { - "tags": [ - "officetransactions" - ], - "operationId": "transferMoneyFrom", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/officetransactions/template": { - "get": { - "tags": [ - "officetransactions" - ], - "operationId": "newOfficeTransactionDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/officetransactions/{transactionId}": { - "delete": { - "tags": [ - "officetransactions" - ], - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "transactionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/offices/template": { - "get": { - "tags": [ - "Offices" - ], - "summary": "Retrieve Office Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\noffices/template", - "operationId": "retrieveOfficeTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetOfficesTemplateResponse" - } - } - } - } - }, - "/offices/downloadtemplate": { - "get": { - "tags": [ - "Offices" - ], - "operationId": "getOfficeTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/offices/uploadtemplate": { - "post": { - "tags": [ - "Offices" - ], - "operationId": "postOfficeTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/offices": { - "get": { - "tags": [ - "Offices" - ], - "summary": "List Offices", - "description": "Example Requests:\n\noffices\n\n\noffices?fields=id,name,openingDate", - "operationId": "retrieveOffices", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "includeAllOffices", - "in": "query", - "description": "includeAllOffices", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetOfficesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Offices" - ], - "summary": "Create an Office", - "description": "Mandatory Fields\nname, openingDate, parentId", - "operationId": "createOffice", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostOfficesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostOfficesResponse" - } - } - } - } - }, - "/offices/{officeId}": { - "get": { - "tags": [ - "Offices" - ], - "summary": "Retrieve an Office", - "description": "Example Requests:\n\noffices/1\n\n\noffices/1?template=true\n\n\noffices/1?fields=id,name,parentName", - "operationId": "retreiveOffice", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "path", - "description": "officeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetOfficesResponse" - } - } - } - }, - "put": { - "tags": [ - "Offices" - ], - "summary": "Update Office", - "description": "", - "operationId": "updateOffice", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "path", - "description": "officeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutOfficesOfficeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutOfficesOfficeIdResponse" - } - } - } - } - }, - "/provisioningcategory/{categoryId}": { - "put": { - "tags": [ - "Provisioning Category" - ], - "operationId": "updateProvisioningCategory", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "categoryId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "Provisioning Category" - ], - "operationId": "deleteProvisioningCategory", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "categoryId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/provisioningcategory": { - "get": { - "tags": [ - "Provisioning Category" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "post": { - "tags": [ - "Provisioning Category" - ], - "operationId": "createProvisioningCategory", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/provisioningcriteria/{criteriaId}": { - "get": { - "tags": [ - "Provisioning Criteria" - ], - "summary": "Retrieves a Provisioning Criteria", - "description": "Retrieves a Provisioning Criteria", - "operationId": "retrieveProvisioningCriteria", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "criteriaId", - "in": "path", - "description": "criteriaId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetProvisioningCriteriaCriteriaIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Provisioning Criteria" - ], - "summary": "Updates a new Provisioning Criteria", - "description": "Updates a new Provisioning Criteria\n\nOptional Fields\ncriteriaName, loanProducts, provisioningcriteria", - "operationId": "updateProvisioningCriteria", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "criteriaId", - "in": "path", - "description": "criteriaId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutProvisioningCriteriaRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutProvisioningCriteriaResponse" - } - } - } - }, - "delete": { - "tags": [ - "Provisioning Criteria" - ], - "summary": "Deletes Provisioning Criteria", - "description": "Deletes Provisioning Criteria", - "operationId": "deleteProvisioningCriteria", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "criteriaId", - "in": "path", - "description": "criteriaId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteProvisioningCriteriaResponse" - } - } - } - } - }, - "/provisioningcriteria": { - "get": { - "tags": [ - "Provisioning Criteria" - ], - "summary": "Retrieves all created Provisioning Criterias", - "description": "Retrieves all created Provisioning Criterias", - "operationId": "retrieveAllProvisioningCriterias", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetProvisioningCriteriaResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Provisioning Criteria" - ], - "summary": "Create a new Provisioning Criteria", - "description": "Creates a new Provisioning Criteria\n\nMandatory Fields: \ncriteriaName\nprovisioningcriteria\n\nOptional Fields: \nloanProducts", - "operationId": "createProvisioningCriteria", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostProvisioningCriteriaRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostProvisioningCriteriaResponse" - } - } - } - } - }, - "/provisioningcriteria/template": { - "get": { - "tags": [ - "Provisioning Criteria" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/staff": { - "get": { - "tags": [ - "Staff" - ], - "summary": "Retrieve Staff", - "description": "Returns the list of staff members.\n\nExample Requests:\n\nstaff\n\n\n\n\nRetrieve a Staff by status\n\nReturns the details of a Staff based on status.\n\nBy default it Returns all the ACTIVE Staff.\n\nIf status=INACTIVE, then it returns all INACTIVE Staff.\n\nand for status=ALL, it Returns both ACTIVE and INACTIVE Staff.\n\nExample Requests:\n\nstaff?status=active", - "operationId": "retrieveStaff", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInOfficeHierarchy", - "in": "query", - "description": "staffInOfficeHierarchy", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "loanOfficersOnly", - "in": "query", - "description": "loanOfficersOnly", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "status", - "in": "query", - "description": "status", - "required": false, - "type": "string", - "default": "active" - } - ], - "responses": { - "200": { - "description": "GET https://DomainName/api/v1/staff?status={ACTIVE|INACTIVE|ALL}", - "schema": { - "$ref": "#/definitions/GetStaffResponse" - } - } - } - }, - "post": { - "tags": [ - "Staff" - ], - "summary": "Create a staff member", - "description": "Creates a staff member.\n\nMandatory Fields: \nofficeId, firstname, lastname\n\nOptional Fields: \nisLoanOfficer, isActive", - "operationId": "createStaff", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostStaffRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostStaffResponse" - } - } - } - } - }, - "/staff/{staffId}": { - "get": { - "tags": [ - "Staff" - ], - "summary": "Retrieve a Staff Member", - "description": "Returns the details of a Staff Member.\n\nExample Requests:\n\nstaff/1", - "operationId": "retreiveStaff", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "staffId", - "in": "path", - "description": "staffId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetStaffResponse" - } - } - } - }, - "put": { - "tags": [ - "Staff" - ], - "summary": "Update a Staff Member", - "description": "Updates the details of a staff member.", - "operationId": "updateStaff", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "staffId", - "in": "path", - "description": "staffId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutStaffRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutStaffResponse" - } - } - } - } - }, - "/staff/downloadtemplate": { - "get": { - "tags": [ - "Staff" - ], - "operationId": "getStaffTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/staff/uploadtemplate": { - "post": { - "tags": [ - "Staff" - ], - "operationId": "postStaffTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/cashiers": { - "get": { - "tags": [ - "Cashiers" - ], - "operationId": "getCashierData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "tellerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "date", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/tellers/{tellerId}": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Retrieve tellers", - "description": "", - "operationId": "findTeller", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTellersResponse" - } - } - } - }, - "put": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Update teller", - "description": "", - "operationId": "updateTeller", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutTellersRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutTellersResponse" - } - } - } - }, - "delete": { - "tags": [ - "Teller Cash Management" - ], - "operationId": "deleteTeller", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/tellers/{tellerId}/cashiers/{cashierId}": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Retrieve a cashier", - "description": "", - "operationId": "findCashierData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTellersTellerIdCashiersCashierIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Update Cashier", - "description": "", - "operationId": "updateCashier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutTellersTellerIdCashiersCashierIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutTellersTellerIdCashiersCashierIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Delete Cashier", - "description": "", - "operationId": "deleteCashier", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteTellersTellerIdCashiersCashierIdResponse" - } - } - } - } - }, - "/tellers/{tellerId}/cashiers/template": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Find Cashiers", - "description": "", - "operationId": "getCashierTemplate", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTellersTellerIdCashiersTemplateResponse" - } - } - } - } - }, - "/tellers/{tellerId}/cashiers": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "List Cashiers", - "description": "", - "operationId": "getCashierData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "fromdate", - "in": "query", - "description": "fromdate", - "required": false, - "type": "string" - }, - { - "name": "todate", - "in": "query", - "description": "todate", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTellersTellerIdCashiersResponse" - } - } - } - }, - "post": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Create Cashiers", - "description": "Mandatory Fields: \nCashier/staff, Fromm Date, To Date, Full Day or From time and To time\n\n\n\nOptional Fields: \nDescription/Notes", - "operationId": "createCashier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTellersTellerIdCashiersRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostTellersTellerIdCashiersResponse" - } - } - } - } - }, - "/tellers": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "List all tellers", - "description": "Retrieves list tellers", - "operationId": "getTellerData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetTellersResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Create teller", - "description": "Mandatory Fields\nTeller name, OfficeId, Description, Start Date, Status\nOptional Fields\nEnd Date", - "operationId": "createTeller", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTellersRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostTellersResponse" - } - } - } - } - }, - "/tellers/{tellerId}/cashiers/{cashierId}/allocate": { - "post": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Allocate Cash To Cashier", - "description": "Mandatory Fields: \nDate, Amount, Currency, Notes/Comments", - "operationId": "allocateCashToCashier", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTellersTellerIdCashiersCashierIdAllocateRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostTellersTellerIdCashiersCashierIdAllocateResponse" - } - } - } - } - }, - "/tellers/{tellerId}/cashiers/{cashierId}/settle": { - "post": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Settle Cash From Cashier", - "description": "Mandatory Fields\nDate, Amount, Currency, Notes/Comments", - "operationId": "settleCashFromCashier", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTellersTellerIdCashiersCashierIdSettleRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostTellersTellerIdCashiersCashierIdSettleResponse" - } - } - } - } - }, - "/tellers/{tellerId}/cashiers/{cashierId}/transactions": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Retrieve Cashier Transaction", - "description": "", - "operationId": "getTransactionsForCashier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "currencyCode", - "in": "query", - "description": "currencyCode", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetTellersTellerIdCashiersCashiersIdTransactionsResponse" - } - } - } - } - } - }, - "/tellers/{tellerId}/cashiers/{cashierId}/summaryandtransactions": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Transactions Wtih Summary For Cashier", - "description": "", - "operationId": "getTransactionsWtihSummaryForCashier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "currencyCode", - "in": "query", - "description": "currencyCode", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse" - } - } - } - } - }, - "/tellers/{tellerId}/cashiers/{cashierId}/transactions/template": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "summary": "Retrieve Cashier Transaction Template", - "description": "", - "operationId": "getCashierTxnTemplate", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "path", - "description": "cashierId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse" - } - } - } - } - }, - "/tellers/{tellerId}/transactions": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "operationId": "getTransactionData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "dateRange", - "in": "query", - "description": "dateRange", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/tellers/{tellerId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "operationId": "findTransactionData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/tellers/{tellerId}/journals": { - "get": { - "tags": [ - "Teller Cash Management" - ], - "operationId": "getJournalData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "tellerId", - "in": "path", - "description": "tellerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "query", - "description": "cashierId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateRange", - "in": "query", - "description": "dateRange", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/cashiersjournal": { - "get": { - "tags": [ - "Cashier Journals" - ], - "operationId": "getJournalData", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "tellerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "cashierId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateRange", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/workingdays": { - "get": { - "tags": [ - "Working days" - ], - "summary": "List Working days", - "description": "Example Requests:\n\nworkingdays", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetWorkingDaysResponse" - } - } - } - } - }, - "put": { - "tags": [ - "Working days" - ], - "summary": "Update a Working Day", - "description": "Mandatory Fields\nrecurrence,repaymentRescheduleType,extendTermForDailyRepayments,locale", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutWorkingDaysRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutWorkingDaysResponse" - } - } - } - } - }, - "/workingdays/template": { - "get": { - "tags": [ - "Working days" - ], - "summary": "Working Days Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for working days.\n\nExample Request:\n\nworkingdays/template", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetWorkingDaysTemplateResponse" - } - } - } - } - }, - "/accounttransfers/templateRefundByTransfer": { - "get": { - "tags": [ - "Account Transfers" - ], - "summary": "Retrieve Refund of an Active Loan by Transfer Template", - "description": "Retrieves Refund of an Active Loan by Transfer TemplateExample Requests :\n\n\n\naccounttransfers/templateRefundByTransfer?fromAccountId=2&fromAccountType=1& toAccountId=1&toAccountType=2&toClientId=1&toOfficeId=1", - "operationId": "templateRefundByTransfer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "fromOfficeId", - "in": "query", - "description": "fromOfficeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromClientId", - "in": "query", - "description": "fromClientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountId", - "in": "query", - "description": "fromAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountType", - "in": "query", - "description": "fromAccountType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "toOfficeId", - "in": "query", - "description": "toOfficeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toClientId", - "in": "query", - "description": "toClientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toAccountId", - "in": "query", - "description": "toAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toAccountType", - "in": "query", - "description": "toAccountType", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferResponse" - } - } - } - } - }, - "/accounttransfers/refundByTransfer": { - "post": { - "tags": [ - "Account Transfers" - ], - "summary": "Refund of an Active Loan by Transfer", - "description": "Ability to refund an active loan by transferring to a savings account.", - "operationId": "templateRefundByTransferPost", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostAccountTransfersRefundByTransferRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostAccountTransfersRefundByTransferResponse" - } - } - } - } - }, - "/accounttransfers": { - "get": { - "tags": [ - "Account Transfers" - ], - "summary": "List account transfers", - "description": "Lists account's transfers\n\nExample Requests:\n\n\n\naccounttransfers", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "x-example": "limit" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "accountDetailId", - "in": "query", - "description": "accountDetailId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountTransfersResponse" - } - } - } - }, - "post": { - "tags": [ - "Account Transfers" - ], - "summary": "Create new Transfer", - "description": "Ability to create new transfer of monetary funds from one account to another.", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostAccountTransfersRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostAccountTransfersResponse" - } - } - } - } - }, - "/accounttransfers/{transferId}": { - "get": { - "tags": [ - "Account Transfers" - ], - "summary": "Retrieve account transfer", - "description": "Retrieves account transfer\n\nExample Requests :\n\n\n\naccounttransfers/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "transferId", - "in": "path", - "description": "transferId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountTransfersPageItems" - } - } - } - } - }, - "/accounttransfers/template": { - "get": { - "tags": [ - "Account Transfers" - ], - "summary": "Retrieve Account Transfer Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n\n\nField Defaults\n\nAllowed Value Lists\n\nExample Requests:\n\n\n\naccounttransfers/template?fromAccountType=2&fromOfficeId=1\n\n\n\naccounttransfers/template?fromAccountType=2&fromOfficeId=1&fromClientId=1\n\n\n\naccounttransfers/template?fromClientId=1&fromAccountType=2&fromAccountId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "fromOfficeId", - "in": "query", - "description": "fromOfficeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromClientId", - "in": "query", - "description": "fromClientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountId", - "in": "query", - "description": "fromAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountType", - "in": "query", - "description": "fromAccountType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "toOfficeId", - "in": "query", - "description": "toOfficeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toClientId", - "in": "query", - "description": "toClientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toAccountId", - "in": "query", - "description": "toAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toAccountType", - "in": "query", - "description": "toAccountType", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountTransfersTemplateResponse" - } - } - } - } - }, - "/standinginstructions": { - "get": { - "tags": [ - "Standing Instructions" - ], - "summary": "List Standing Instructions", - "description": "Example Requests:\n\nstandinginstructions", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "transferType", - "in": "query", - "description": "transferType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "clientName", - "in": "query", - "description": "clientName", - "required": false, - "type": "string" - }, - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountId", - "in": "query", - "description": "fromAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountType", - "in": "query", - "description": "fromAccountType", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetStandingInstructionsResponse" - } - } - } - }, - "post": { - "tags": [ - "Standing Instructions" - ], - "summary": "Create new Standing Instruction", - "description": "Ability to create new instruction for transfer of monetary funds from one account to another", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostStandingInstructionsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostStandingInstructionsResponse" - } - } - } - } - }, - "/standinginstructions/{standingInstructionId}": { - "get": { - "tags": [ - "Standing Instructions" - ], - "summary": "Retrieve Standing Instruction", - "description": "Example Requests :\n\nstandinginstructions/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "standingInstructionId", - "in": "path", - "description": "standingInstructionId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetStandingInstructionsStandingInstructionIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Standing Instructions" - ], - "summary": "Update Standing Instruction | Delete Standing Instruction", - "description": "Ability to modify existing instruction for transfer of monetary funds from one account to another.\n\nPUT https://DomainName/api/v1/standinginstructions/1?command=update\n\n\nAbility to modify existing instruction for transfer of monetary funds from one account to another.\n\nPUT https://DomainName/api/v1/standinginstructions/1?command=delete", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "standingInstructionId", - "in": "path", - "description": "standingInstructionId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PutStandingInstructionsStandingInstructionIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutStandingInstructionsStandingInstructionIdResponse" - } - } - } - } - }, - "/standinginstructions/template": { - "get": { - "tags": [ - "Standing Instructions" - ], - "summary": "Retrieve Standing Instruction Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Requests:\n\nstandinginstructions/template?fromAccountType=2&fromOfficeId=1\n\nstandinginstructions/template?fromAccountType=2&fromOfficeId=1&fromClientId=1&transferType=1\n\nstandinginstructions/template?fromClientId=1&fromAccountType=2&fromAccountId=1&transferType=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "fromOfficeId", - "in": "query", - "description": "fromOfficeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromClientId", - "in": "query", - "description": "fromClientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountId", - "in": "query", - "description": "fromAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountType", - "in": "query", - "description": "fromAccountType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "toOfficeId", - "in": "query", - "description": "toOfficeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toClientId", - "in": "query", - "description": "toClientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toAccountId", - "in": "query", - "description": "toAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "toAccountType", - "in": "query", - "description": "toAccountType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "transferType", - "in": "query", - "description": "transferType", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetStandingInstructionsTemplateResponse" - } - } - } - } - }, - "/standinginstructionrunhistory": { - "get": { - "tags": [ - "Standing Instructions History" - ], - "summary": "Standing Instructions Logged History", - "description": "The list capability of history can support pagination and sorting \n\nExample Requests :\n\nstandinginstructionrunhistory\n\nstandinginstructionrunhistory?orderBy=name&sortOrder=DESC\n\nstandinginstructionrunhistory?offset=10&limit=50", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "transferType", - "in": "query", - "description": "transferType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "clientName", - "in": "query", - "description": "clientName", - "required": false, - "type": "string" - }, - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountId", - "in": "query", - "description": "fromAccountId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "fromAccountType", - "in": "query", - "description": "fromAccountType", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "locale", - "in": "query", - "description": "locale", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "query", - "description": "dateFormat", - "required": false, - "type": "string" - }, - { - "name": "fromDate", - "in": "query", - "description": "fromDate", - "required": false, - "type": "string" - }, - { - "name": "toDate", - "in": "query", - "description": "toDate", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetStandingInstructionRunHistoryResponse" - } - } - } - } - }, - "/accounts/{type}": { - "get": { - "tags": [ - "Share Account" - ], - "summary": "List share applications/accounts", - "description": "Lists share applications/accounts\n\nExample Requests:\n\nshareaccount", - "operationId": "retrieveAllAccounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountsTypeResponse" - } - } - } - }, - "post": { - "tags": [ - "Share Account" - ], - "summary": "Submit new share application", - "description": "Submits new share application\n\nMandatory Fields: clientId, productId, submittedDate, savingsAccountId, requestedShares, applicationDate\n\nOptional Fields: accountNo, externalId\n\nInherited from Product (if not provided): minimumActivePeriod, minimumActivePeriodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType", - "operationId": "createAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostAccountsTypeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostAccountsTypeResponse" - } - } - } - } - }, - "/accounts/{type}/{accountId}": { - "get": { - "tags": [ - "Share Account" - ], - "summary": "Retrieve a share application/account", - "description": "Retrieves a share application/account\n\nExample Requests :\n\nshareaccount/1", - "operationId": "retrieveAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountsTypeAccountIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Share Account" - ], - "summary": "Approve share application | Undo approval share application | Reject share application | Activate a share account | Close a share account | Apply additional shares on a share account | Approve additional shares request on a share account | Reject additional shares request on a share account | Redeem shares on a share account", - "description": "Approve share application:\n\nApproves share application so long as its in 'Submitted and pending approval' state.\n\nUndo approval share application:\n\nWill move 'approved' share application back to 'Submitted and pending approval' state.\n\nReject share application:\n\nRejects share application so long as its in 'Submitted and pending approval' state.\n\nActivate a share account:\n\nResults in an approved share application being converted into an 'active' share account.\n\nClose a share account:\n\nResults in an Activated share application being converted into an 'closed' share account.\n\nclosedDate is closure date of share account\n\nMandatory Fields: dateFormat,locale,closedDate\n\nApply additional shares on a share account:\n\nrequestedDate is requsted date of share purchase\n\nrequestedShares is number of shares to be purchase\n\nMandatory Fields: dateFormat,locale,requestedDate, requestedShares\n\nApprove additional shares request on a share account\n\nrequestedShares is Share purchase transaction ids\n\nMandatory Fields: requestedShares\n\nReject additional shares request on a share account:\n\nrequestedShares is Share purchase transaction ids\n\nMandatory Fields: requestedShares\n\nRedeem shares on a share account:\n\nResults redeem some/all shares from share account.\n\nrequestedDate is requsted date of shares redeem\n\nrequestedShares is number of shares to be redeemed\n\nMandatory Fields: dateFormat,locale,requestedDate,requestedShares\n\nShowing request/response for 'Reject additional shares request on a share account'\n\nFor more info visit this link - https://demo.openmf.org/api-docs/apiLive.htm#shareaccounts", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostAccountsTypeAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostAccountsTypeAccountIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Share Account" - ], - "summary": "Modify a share application", - "description": "Share application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc", - "operationId": "updateAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutAccountsTypeAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutAccountsTypeAccountIdResponse" - } - } - } - } - }, - "/accounts/{type}/downloadtemplate": { - "get": { - "tags": [ - "Share Account" - ], - "operationId": "getSharedAccountsTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/accounts/{type}/uploadtemplate": { - "post": { - "tags": [ - "Share Account" - ], - "operationId": "postSharedAccountsTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/accounts/{type}/template": { - "get": { - "tags": [ - "Share Account" - ], - "summary": "Retrieve Share Account Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Requests:\n\naccounts/share/template?clientId=1\n\n\naccounts/share/template?clientId=1&productId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountsTypeTemplateResponse" - } - } - } - } - }, - "/fieldconfiguration/{entity}": { - "get": { - "tags": [ - "Entity Field Configuration" - ], - "summary": "Retrieves the Entity Field Configuration", - "description": "It retrieves all the Entity Field Configuration", - "operationId": "getAddresses", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "entity", - "in": "path", - "description": "entity", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetFieldConfigurationEntityResponse" - } - } - } - } - } - }, - "/charges/{chargeId}": { - "get": { - "tags": [ - "Charges" - ], - "summary": "Retrieve a Charge", - "description": "Returns the details of a defined Charge.\n\nExample Requests:\n\ncharges/1", - "operationId": "retrieveCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetChargesResponse" - } - } - } - }, - "put": { - "tags": [ - "Charges" - ], - "summary": "Update a Charge", - "description": "Updates the details of a Charge.", - "operationId": "updateCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutChargesChargeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutChargesChargeIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Charges" - ], - "summary": "Delete a Charge", - "description": "Deletes a Charge.", - "operationId": "deleteCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteChargesChargeIdResponse" - } - } - } - } - }, - "/charges": { - "get": { - "tags": [ - "Charges" - ], - "summary": "Retrieve Charges", - "description": "Returns the list of defined charges.\n\nExample Requests:\n\ncharges", - "operationId": "retrieveAllCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetChargesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Charges" - ], - "summary": "Create/Define a Charge", - "description": "Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance.", - "operationId": "createCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostChargesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostChargesResponse" - } - } - } - } - }, - "/charges/template": { - "get": { - "tags": [ - "Charges" - ], - "summary": "Retrieve Charge Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\ncharges/template\n", - "operationId": "retrieveNewChargeDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetChargesTemplateResponse" - } - } - } - } - }, - "/client/{clientid}/addresses": { - "get": { - "tags": [ - "Clients Address" - ], - "summary": "List all addresses for a Client", - "description": "Example Requests:\n\nclient/1/addresses\n\n\nclients/1/addresses?status=false,true&&type=1,2,3", - "operationId": "getAddresses", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "status", - "in": "query", - "description": "status", - "required": false, - "type": "string" - }, - { - "name": "type", - "in": "query", - "description": "type", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "clientid", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetClientClientIdAddressesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Clients Address" - ], - "summary": "Create an address for a Client", - "description": "Mandatory Fields : \ntype and clientId", - "operationId": "AddClientAddress", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "type", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "clientid", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostClientClientIdAddressesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostClientClientIdAddressesResponse" - } - } - } - }, - "put": { - "tags": [ - "Clients Address" - ], - "summary": "Update an address for a Client", - "description": "All the address fields can be updated by using update client address API\n\nMandatory Fields\ntype and addressId", - "operationId": "UpdateClientAddress", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientid", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutClientClientIdAddressesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutClientClientIdAddressesResponse" - } - } - } - } - }, - "/client/addresses/template": { - "get": { - "tags": [ - "Clients Address" - ], - "operationId": "getAddressesTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/clients/{clientId}/charges": { - "get": { - "tags": [ - "Client Charges" - ], - "summary": "List Client Charges", - "description": "The list capability of client charges supports pagination.Example Requests:\nclients/1/charges\n\nclients/1/charges?offset=0&limit=5", - "operationId": "retrieveAllClientCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - }, - { - "name": "pendingPayment", - "in": "query", - "description": "pendingPayment", - "required": false, - "type": "boolean" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdChargesResponse" - } - } - } - }, - "post": { - "tags": [ - "Client Charges" - ], - "summary": "Add Client Charge", - "description": " This API associates a Client charge with an implicit Client account\nMandatory Fields : \nchargeId and dueDate \nOptional Fields : \namount", - "operationId": "applyClientCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostClientsClientIdChargesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostClientsClientIdChargesResponse" - } - } - } - } - }, - "/clients/{clientId}/charges/{chargeId}": { - "get": { - "tags": [ - "Client Charges" - ], - "summary": "Retrieve a Client Charge", - "description": "Example Requests:\nclients/1/charges/1\n\n\nclients/1/charges/1?fields=name,id", - "operationId": "retrieveClientCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetClientsChargesPageItems" - } - } - } - }, - "post": { - "tags": [ - "Client Charges" - ], - "summary": "Pay a Client Charge | Waive a Client Charge", - "description": "Pay a Client Charge:\n\nMandatory Fields:transactionDate and amount \"Pay either a part of or the entire due amount for a charge.(command=paycharge)\n\nWaive a Client Charge:\n\n\nThis API provides the facility of waiving off the remaining amount on a client charge (command=waive)\n\nShowing request/response for 'Pay a Client Charge'", - "operationId": "payOrWaiveClientCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostClientsClientIdChargesChargeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostClientsClientIdChargesChargeIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Client Charges" - ], - "summary": "Delete a Client Charge", - "description": "Deletes a Client Charge on which no transactions have taken place (either payments or waivers). ", - "operationId": "deleteClientCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteClientsClientIdChargesChargeIdResponse" - } - } - } - } - }, - "/clients/{clientId}/charges/template": { - "get": { - "tags": [ - "Client Charges" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/clients/{clientId}/identifiers": { - "get": { - "tags": [ - "Client Identifier" - ], - "summary": "List all Identifiers for a Client", - "description": "Example Requests:\nclients/1/identifiers\n\n\nclients/1/identifiers?fields=documentKey,documentType,description", - "operationId": "retrieveAllClientIdentifiers", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetClientsClientIdIdentifiersResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Client Identifier" - ], - "summary": "Create an Identifier for a Client", - "description": "Mandatory Fields\ndocumentKey, documentTypeId ", - "operationId": "createClientIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostClientsClientIdIdentifiersRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostClientsClientIdIdentifiersResponse" - } - } - } - } - }, - "/clients/{clientId}/identifiers/template": { - "get": { - "tags": [ - "Client Identifier" - ], - "summary": "Retrieve Client Identifier Details Template", - "description": "This is a convenience resource useful for building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n Field Defaults\n Allowed Value Lists\n\n\nExample Request:\nclients/1/identifiers/template", - "operationId": "newClientIdentifierDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdIdentifiersTemplateResponse" - } - } - } - } - }, - "/clients/{clientId}/identifiers/{identifierId}": { - "get": { - "tags": [ - "Client Identifier" - ], - "summary": "Retrieve a Client Identifier", - "description": "Example Requests:\nclients/1/identifier/2\n\n\nclients/1/identifier/2?template=true\n\nclients/1/identifiers/2?fields=documentKey,documentType,description", - "operationId": "retrieveClientIdentifiers", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "identifierId", - "in": "path", - "description": "identifierId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdIdentifiersResponse" - } - } - } - }, - "put": { - "tags": [ - "Client Identifier" - ], - "summary": "Update a Client Identifier", - "description": "Updates a Client Identifier", - "operationId": "updateClientIdentifer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "identifierId", - "in": "path", - "description": "identifierId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutClientsClientIdIdentifiersIdentifierIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutClientsClientIdIdentifiersIdentifierIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Client Identifier" - ], - "summary": "Delete a Client Identifier", - "description": "Deletes a Client Identifier", - "operationId": "deleteClientIdentifier", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "identifierId", - "in": "path", - "description": "identifierId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteClientsClientIdIdentifiersIdentifierIdResponse" - } - } - } - } - }, - "/clients/{clientId}/transactions": { - "get": { - "tags": [ - "Client Transaction" - ], - "summary": "List Client Transactions", - "description": "The list capability of client transaction can support pagination.\n\nExample Requests:\n\nclients/189/transactions\n\nclients/189/transactions?offset=10&limit=50", - "operationId": "retrieveAllClientTransactions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdTransactionsResponse" - } - } - } - } - }, - "/clients/{clientId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Client Transaction" - ], - "summary": "Retrieve a Client Transaction", - "description": "Example Requests:\nclients/1/transactions/1\n\n\nclients/1/transactions/1?fields=id,officeName", - "operationId": "retrieveClientTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdTransactionsTransactionIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Client Transaction" - ], - "summary": "Undo a Client Transaction", - "description": "Undoes a Client Transaction", - "operationId": "undoClientTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostClientsClientIdTransactionsTransactionIdResponse" - } - } - } - } - }, - "/clients/{clientId}/accounts": { - "get": { - "tags": [ - "Client" - ], - "summary": "Retrieve client accounts overview", - "description": "An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application.\nIt is quite reasonable to add resources like this to simplify User Interface development.\n\nExample Requests:\n \nclients/1/accounts\n\nclients/1/accounts?fields=loanAccounts,savingsAccounts", - "operationId": "retrieveAssociatedAccounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdAccountsResponse" - } - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/clients/downloadtemplate": { - "get": { - "tags": [ - "Client" - ], - "operationId": "getClientTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "legalFormType", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/clients/uploadtemplate": { - "post": { - "tags": [ - "Client" - ], - "operationId": "postClientTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "legalFormType", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/clients/{clientId}/obligeedetails": { - "get": { - "tags": [ - "Client" - ], - "operationId": "retrieveObligeeDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/clients/{clientId}/transferproposaldate": { - "get": { - "tags": [ - "Client" - ], - "operationId": "retrieveTransferTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/clients": { - "get": { - "tags": [ - "Client" - ], - "summary": "List Clients", - "description": "The list capability of clients can support pagination and sorting.\n\nExample Requests:\n\nclients\n\nclients?fields=displayName,officeName,timeline\n\nclients?offset=10&limit=50\n\nclients?orderBy=displayName&sortOrder=DESC", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "displayName", - "in": "query", - "description": "displayName", - "required": false, - "type": "string" - }, - { - "name": "firstName", - "in": "query", - "description": "firstName", - "required": false, - "type": "string" - }, - { - "name": "lastName", - "in": "query", - "description": "lastName", - "required": false, - "type": "string" - }, - { - "name": "underHierarchy", - "in": "query", - "description": "underHierarchy", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "orphansOnly", - "in": "query", - "description": "orphansOnly", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsResponse" - } - } - } - }, - "post": { - "tags": [ - "Client" - ], - "summary": "Create a Client", - "description": "Note:\n\n1. You can enter either:firstname/middlename/lastname - for a person (middlename is optional) OR fullname - for a business or organisation (or person known by one name).\n\n2.If address is enable(enable-address=true), then additional field called address has to be passed.\n\nMandatory Fields: firstname and lastname OR fullname, officeId, active=true and activationDate OR active=false, if(address enabled) address\n\nOptional Fields: groupId, externalId, accountNo, staffId, mobileNo, savingsProductId, genderId, clientTypeId, clientClassificationId", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostClientsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostClientsResponse" - } - } - } - } - }, - "/clients/{clientId}": { - "get": { - "tags": [ - "Client" - ], - "summary": "Retrieve a Client", - "description": "Example Requests:\n\nclients/1\n\n\nclients/1?template=true\n\n\nclients/1?fields=id,displayName,officeName", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsClientIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Client" - ], - "summary": "Activate a Client | Close a Client | Reject a Client | Withdraw a Client | Reactivate a Client | UndoReject a Client | UndoWithdraw a Client | Assign a Staff | Unassign a Staff | Update Default Savings Account | Propose a Client Transfer | Withdraw a Client Transfer | Reject a Client Transfer | Accept a Client Transfer | Propose and Accept a Client Transfer", - "description": "Activate a Client:\n\nClients can be created in a Pending state. This API exists to enable client activation (for when a client becomes an approved member of the financial Institution).\n\nIf the client happens to be already active this API will result in an error.\n\nClose a Client:\n\nClients can be closed if they do not have any non-closed loans/savingsAccount. This API exists to close a client .\n\nIf the client have any active loans/savingsAccount this API will result in an error.\n\nReject a Client:\n\nClients can be rejected when client is in pending for activation status.\n\nIf the client is any other status, this API throws an error.\n\nMandatory Fields: rejectionDate, rejectionReasonId\n\nWithdraw a Client:\n\nClient applications can be withdrawn when client is in a pending for activation status.\n\nIf the client is any other status, this API throws an error.\n\nMandatory Fields: withdrawalDate, withdrawalReasonId\n\nReactivate a Client: Clients can be reactivated after they have been closed.\n\nTrying to reactivate a client in any other state throws an error.\n\nMandatory Fields: reactivationDate\n\nUndoReject a Client:\n\nClients can be reactivated after they have been rejected.\n\nTrying to reactivate a client in any other state throws an error.\n\nMandatory Fields: reopenedDateUndoWithdraw a Client:\n\nClients can be reactivated after they have been withdrawn.\n\nTrying to reactivate a client in any other state throws an error.\n\nMandatory Fields: reopenedDate\n\nAssign a Staff:\n\nAllows you to assign a Staff for existed Client.\n\nThe selected Staff should belong to the same office (or an officer higher up in the hierarchy) as the Client he manages.\n\nUnassign a Staff:\n\nAllows you to unassign the Staff assigned to a Client.\n\nUpdate Default Savings Account:\n\nAllows you to modify or assign a default savings account for an existing Client.\n\nThe selected savings account should be one among the existing savings account for a particular customer.\n\nPropose a Client Transfer:\n\nAllows you to propose the transfer of a Client to a different Office.\n\nWithdraw a Client Transfer:\n\nAllows you to withdraw the proposed transfer of a Client to a different Office.\n\nWithdrawal can happen only if the destination Branch (to which the transfer was proposed) has not already accepted the transfer proposal\n\nReject a Client Transfer:\n\nAllows the Destination Branch to reject the proposed Client Transfer.\n\nAccept a Client Transfer:\n\nAllows the Destination Branch to accept the proposed Client Transfer.\n\nThe destination branch may also choose to link this client to a group (in which case, any existing active JLG loan of the client is rescheduled to match the meeting frequency of the group) and loan Officer at the time of accepting the transfer\n\nPropose and Accept a Client Transfer:\n\nAbstraction over the Propose and Accept Client Transfer API's which enable a user with Data Scope over both the Target and Destination Branches to directly transfer a Client to the destination Office.\n\nShowing request/response for 'Reject a Client Transfer'", - "operationId": "activate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostClientsClientIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostClientsClientIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Client" - ], - "summary": "Update a Client", - "description": "Note: You can update any of the basic attributes of a client (but not its associations) using this API.\n\nChanging the relationship between a client and its office is not supported through this API. An API specific to handling transfers of clients between offices is available for the same.\n\nThe relationship between a client and a group must be removed through the Groups API.", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutClientsClientIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutClientsClientIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Client" - ], - "summary": "Delete a Client", - "description": "If a client is in Pending state, you are allowed to Delete it. The delete is a 'hard delete' and cannot be recovered from. Once clients become active or have loans or savings associated with them, you cannot delete the client but you may Close the client if they have left the program.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DeleteClientsClientIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteClientsClientIdResponse" - } - } - } - } - }, - "/clients/template": { - "get": { - "tags": [ - "Client" - ], - "summary": "Retrieve Client Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Request:\n\nclients/template", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "commandParam", - "in": "query", - "description": "commandParam", - "required": false, - "type": "string" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetClientsTemplateResponse" - } - } - } - } - }, - "/loans/{loanId}/collaterals/template": { - "get": { - "tags": [ - "Loan Collateral" - ], - "summary": "Retrieve Collateral Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nloans/1/collaterals/template", - "operationId": "newCollateralTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdCollateralsTemplateResponse" - } - } - } - } - }, - "/loans/{loanId}/collaterals": { - "get": { - "tags": [ - "Loan Collateral" - ], - "summary": "List Loan Collaterals", - "description": "Example Requests:\n\nloans/1/collaterals\n\n\nloans/1/collaterals?fields=value,description", - "operationId": "retrieveCollateralDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetLoansLoanIdCollateralsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Loan Collateral" - ], - "summary": "Create a Collateral", - "description": "Note: Currently, Collaterals may be added only before a Loan is approved", - "operationId": "createCollateral", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdCollateralsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdCollateralsResponse" - } - } - } - } - }, - "/loans/{loanId}/collaterals/{collateralId}": { - "get": { - "tags": [ - "Loan Collateral" - ], - "summary": "Retrieve a Collateral", - "description": "Example Requests:\n\n/loans/1/collaterals/1\n\n\n/loans/1/collaterals/1?fields=value,description", - "operationId": "retrieveCollateralDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "collateralId", - "in": "path", - "description": "collateralId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdCollateralsResponse" - } - } - } - }, - "put": { - "tags": [ - "Loan Collateral" - ], - "summary": "Update a Collateral", - "description": "", - "operationId": "updateCollateral", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "collateralId", - "in": "path", - "description": "collateralId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutLoansLoandIdCollateralsCollateralIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutLoansLoanIdCollateralsCollateralIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Loan Collateral" - ], - "summary": "Remove a Collateral", - "description": "Note: A collateral can only be removed from Loans that are not yet approved.", - "operationId": "deleteCollateral", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "collateralId", - "in": "path", - "description": "collateralId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteLoansLoanIdCollateralsCollateralIdResponse" - } - } - } - } - }, - "/collectionsheet": { - "post": { - "tags": [ - "Collection Sheet" - ], - "summary": "Generate Individual Collection Sheet | Save Collection Sheet", - "description": "Generate Individual Collection Sheet:\n\nThis Api retrieves repayment details of all individual loans under a office as on a specified meeting date.\n\nSave Collection Sheet:\n\nThis Api allows the loan officer to perform bulk repayments of individual loans and deposit of mandatory savings on a given meeting date.", - "operationId": "generateCollectionSheet", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostCollectionSheetRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostCollectionSheetResponse" - } - } - } - } - }, - "/floatingrates": { - "get": { - "tags": [ - "Floating Rates" - ], - "summary": "List Floating Rates", - "description": "Lists Floating Rates", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetFloatingRatesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Floating Rates" - ], - "summary": "Create a new Floating Rate", - "description": "Creates a new Floating Rate\nMandatory Fields: name\nOptional Fields: isBaseLendingRate, isActive, ratePeriods", - "operationId": "createFloatingRate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostFloatingRatesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostFloatingRatesResponse" - } - } - } - } - }, - "/floatingrates/{floatingRateId}": { - "get": { - "tags": [ - "Floating Rates" - ], - "summary": "Retrieve Floating Rate", - "description": "Retrieves Floating Rate", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "floatingRateId", - "in": "path", - "description": "floatingRateId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetFloatingRatesFloatingRateIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Floating Rates" - ], - "summary": "Update Floating Rate", - "description": "Updates new Floating Rate. Rate Periods in the past cannot be modified. All the future rateperiods would be replaced with the new ratePeriods data sent.", - "operationId": "updateFloatingRate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "floatingRateId", - "in": "path", - "description": "floatingRateId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutFloatingRatesFloatingRateIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutFloatingRatesFloatingRateIdResponse" - } - } - } - } - }, - "/funds": { - "get": { - "tags": [ - "Funds" - ], - "summary": "Retrieve Funds", - "description": "Returns the list of funds.\n\nExample Requests:\n\nfunds", - "operationId": "retrieveFunds", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetFundsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Funds" - ], - "summary": "Create a Fund", - "description": "Creates a Fund", - "operationId": "createFund", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostFundsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostFundsResponse" - } - } - } - } - }, - "/funds/{fundId}": { - "get": { - "tags": [ - "Funds" - ], - "summary": "Retrieve a Fund", - "description": "Returns the details of a Fund.\n\nExample Requests:\n\nfunds/1", - "operationId": "retreiveFund", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "fundId", - "in": "path", - "description": "fundId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetFundsResponse" - } - } - } - }, - "put": { - "tags": [ - "Funds" - ], - "summary": "Update a Fund", - "description": "Updates the details of a fund.", - "operationId": "updateFund", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "fundId", - "in": "path", - "description": "fundId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutFundsFundIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutFundsFundIdResponse" - } - } - } - } - }, - "/centers/{centerId}/accounts": { - "get": { - "tags": [ - "Centers" - ], - "summary": "Retrieve Center accounts overview", - "description": "An example of how a savings summary for a Center can be provided. This is requested in a specific use case of the reference application.\n\nIt is quite reasonable to add resources like this to simplify User Interface development.\n\n\n\nExample Requests:\n\n\n\ncenters/9/accounts", - "operationId": "retrieveGroupAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "centerId", - "in": "path", - "description": "centerId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCentersCenterIdAccountsResponse" - } - } - } - } - }, - "/centers/downloadtemplate": { - "get": { - "tags": [ - "Centers" - ], - "operationId": "getCentersTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/centers/uploadtemplate": { - "post": { - "tags": [ - "Centers" - ], - "operationId": "postCentersTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/centers": { - "get": { - "tags": [ - "Centers" - ], - "summary": "List Centers", - "description": "The default implementation supports pagination and sorting with the default pagination size set to 200 records. The parameter limit with value -1 will return all entries.\n\nExample Requests:\n\n\n\ncenters\n\n\n\ncenters?fields=name,officeName,joinedDate\n\n\n\ncenters?offset=10&limit=50\n\n\n\ncenters?orderBy=name&sortOrder=DESC", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "description": "staffId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "name", - "in": "query", - "description": "name", - "required": false, - "type": "string" - }, - { - "name": "underHierarchy", - "in": "query", - "description": "underHierarchy", - "required": false, - "type": "string" - }, - { - "name": "paged", - "in": "query", - "description": "paged", - "required": false, - "type": "boolean" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "meetingDate", - "in": "query", - "description": "meetingDate", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "query", - "description": "dateFormat", - "required": false, - "type": "string" - }, - { - "name": "locale", - "in": "query", - "description": "locale", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCentersResponse" - } - } - } - }, - "post": { - "tags": [ - "Centers" - ], - "summary": "Create a Center", - "description": "Creates a Center\n\nMandatory Fields: name, officeId, active, activationDate (if active=true)\n\nOptional Fields: externalId, staffId, groupMembers", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostCentersRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostCentersResponse" - } - } - } - } - }, - "/centers/{centerId}": { - "get": { - "tags": [ - "Centers" - ], - "summary": "Retrieve a Center", - "description": "Retrieves a Center\n\nExample Requests:\n\n\n\ncenters/1\n\n\n\ncenters/1?associations=groupMembers", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "centerId", - "in": "path", - "description": "centerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCentersCenterIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Centers" - ], - "summary": "Activate a Center | Generate Collection Sheet | Save Collection Sheet | Close a Center | Associate Groups | Disassociate Groups", - "description": "Activate a Center:\n\nCenters can be created in a Pending state. This API exists to enable center activation. If the center happens to be already active, this API will result in an error.\n\nClose a Center:\n\nCenters can be closed if they don't have any non-closed groups or saving accounts. If the Center has any active groups or savings accounts, this API will result in an error.\n\nAssociate Groups:\n\nThis API allows associating existing groups to a center. The groups are listed from the office to which the center is associated. If group(s) is already associated with a center, this API will result in an error.\n\nDisassociate Groups:\n\nThis API allows to disassociate groups from a center.\n\nGenerate Collection Sheet:\n\nThis Api retrieves repayment details of all jlg loans under a center as on a specified meeting date.\n\nSave Collection Sheet:\n\nThis Api allows the loan officer to perform bulk repayments of JLG loans for a center on a given meeting date.\n\nShowing Request/Response for Close a Center", - "operationId": "activate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "centerId", - "in": "path", - "description": "centerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostCentersCenterIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostCentersCenterIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Centers" - ], - "summary": "Update a Center", - "description": "Updates a Center", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "centerId", - "in": "path", - "description": "centerId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutCentersCenterIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutCentersCenterIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Centers" - ], - "summary": "Delete a Center", - "description": "A Center can be deleted if it is in pending state and has no association - groups, loans or savings", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "centerId", - "in": "path", - "description": "centerId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteCentersCenterIdResponse" - } - } - } - } - }, - "/centers/template": { - "get": { - "tags": [ - "Centers" - ], - "summary": "Retrieve a Center Template", - "description": "Retrieves a Center Template\n\nExample Requests:\n\n\n\ncenters/template\n\n\n\ncenters/template?officeId=2", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetCentersTemplateResponse" - } - } - } - } - }, - "/groups/{groupId}/command/unassign_staff": { - "post": { - "tags": [ - "Groups" - ], - "summary": "Unassign a Staff", - "description": "Allows you to unassign the Staff.\n\nMandatory Fields: staffId", - "operationId": "unassignLoanOfficer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "groupId", - "in": "path", - "description": "groupId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostGroupsGroupIdCommandUnassignStaffRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostGroupsGroupIdCommandUnassignStaffResponse" - } - } - } - } - }, - "/groups/{groupId}": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Retrieve a Group", - "description": "Retrieve group information.\n\nExample Requests:\n\n\n\ngroups/1\n\n\n\ngroups/1?associations=clientMembers", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "groupId", - "in": "path", - "description": "groupId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "roleId", - "in": "query", - "description": "roleId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetGroupsGroupIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Groups" - ], - "summary": "Activate a Group | Associate Clients | Disassociate Clients | Transfer Clients across groups | Generate Collection Sheet | Save Collection Sheet | Unassign a Staff | Assign a Staff | Close a Group | Unassign a Role | Update a Role", - "description": "Activate a Group:\n\nGroups can be created in a Pending state. This API exists to enable group activation.\n\n\n\nIf the group happens to be already active this API will result in an error.\n\nMandatory Fields: activationDate\n\nAssociate Clients:\n\nThis API allows to associate existing clients to a group.\n\n\n\nThe clients are listed from the office to which the group is associated.\n\n\n\nIf client(s) is already associated with group then API will result in an error.\n\nMandatory Fields: clientMembers\n\nDisassociate Clients:\n\nThis API allows to disassociate clients from a group.\n\n\n\nDisassociating a client with active joint liability group loans results in an error.\n\nMandatory Fields: clientMembers\n\nTransfer Clients across groups:\n\nThis API allows to transfer clients from one group to another\n\nMandatory Fields: destinationGroupId and clients\n\nOptional Fields: inheritDestinationGroupLoanOfficer (defaults to true) and transferActiveLoans (defaults to true)\n\nGenerate Collection Sheet:\n\nThis API retrieves repayment details of all jlg loans of all members of a group on a specified meeting date.\n\nMandatory Fields: calendarId and transactionDate\n\nSave Collection Sheet:\n\nThis api allows the loan officer to perform bulk repayments of JLG loans for a group on its meeting date.\n\nMandatory Fields: calendarId, transactionDate, actualDisbursementDate\n\nOptional Fields: clientsAttendance, bulkRepaymentTransaction, bulkDisbursementTransactions\n\nUnassign a Staff:\n\nAllows you to unassign the Staff.\n\nMandatory Fields: staffId\n\nAssign a Staff:\n\nAllows you to assign Staff to an existing Group.\n\n\n\nThe selected Staff should be belong to the same office (or an office higher up in the hierarchy) as this groupMandatory Fields: staffId\n\nOptional Fields: inheritStaffForClientAccounts (Optional: Boolean if true all members of the group (i.e all clients with active loans and savings ) will inherit the staffId)\n\nClose a Group:\n\nThis API exists to close a group. Groups can be closed if they don't have any non-closed clients/loans/savingsAccounts.\n\n\n\nIf the group has any active clients/loans/savingsAccount, this API will result in an error.Assign a Role:\n\nAllows you to assign a Role to an existing member of a group.\n\n\n\nWe can define the different roles applicable to group members by adding code values to the pre-defined system code GROUPROLE. Example:Group leader etc.\n\nMandatory Fields: clientId, role\n\nUnassign a Role:\n\nAllows you to unassign Roles associated tp Group members.\n\nUpdate a Role:\n\nAllows you to update the member Role.\n\nMandatory Fields: role\n\nShowing request/response for Transfer Clients across groups", - "operationId": "activateOrGenerateCollectionSheet", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "groupId", - "in": "path", - "description": "groupId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "name": "roleId", - "in": "query", - "description": "roleId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostGroupsGroupIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostGroupsGroupIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Groups" - ], - "summary": "Update a Group", - "description": "Updates a Group", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "groupId", - "in": "path", - "description": "groupId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutGroupsGroupIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutGroupsGroupIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Groups" - ], - "summary": "Delete a Group", - "description": "A group can be deleted if it is in pending state and has no associations - clients, loans or savings", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "groupId", - "in": "path", - "description": "groupId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteGroupsGroupIdResponse" - } - } - } - } - }, - "/groups/{groupId}/accounts": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Retrieve Group accounts overview", - "description": "Retrieves details of all Loan and Savings accounts associated with this group.\n\n\n\nExample Requests:\n\n\n\ngroups/1/accounts\n\n\n\n\n\ngroups/1/accounts?fields=loanAccounts,savingsAccounts,memberLoanAccounts,\n\nmemberSavingsAccounts", - "operationId": "retrieveAccounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "groupId", - "in": "path", - "description": "groupId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsResponse" - } - } - } - } - }, - "/groups/downloadtemplate": { - "get": { - "tags": [ - "Groups" - ], - "operationId": "getGroupsTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/groups/uploadtemplate": { - "post": { - "tags": [ - "Groups" - ], - "operationId": "postGroupTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/groups": { - "get": { - "tags": [ - "Groups" - ], - "summary": "List Groups", - "description": "The default implementation of listing Groups returns 200 entries with support for pagination and sorting. Using the parameter limit with value -1 returns all entries.\n\nExample Requests:\n\n\n\ngroups\n\n\n\ngroups?fields=name,officeName,joinedDate\n\n\n\ngroups?offset=10&limit=50\n\n\n\ngroups?orderBy=name&sortOrder=DESC", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "description": "staffId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "name", - "in": "query", - "description": "name", - "required": false, - "type": "string" - }, - { - "name": "underHierarchy", - "in": "query", - "description": "underHierarchy", - "required": false, - "type": "string" - }, - { - "name": "paged", - "in": "query", - "description": "paged", - "required": false, - "type": "boolean" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "orphansOnly", - "in": "query", - "description": "orphansOnly", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetGroupsResponse" - } - } - } - }, - "post": { - "tags": [ - "Groups" - ], - "summary": "Create a Group", - "description": "Creates a Group\n\nMandatory Fields: name, officeId, active, activationDate (if active=true)\n\nOptional Fields: externalId, staffId, clientMembers", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostGroupsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostGroupsResponse" - } - } - } - } - }, - "/groups/template": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Retrieve Group Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\n\n\nField Defaults\n\nAllowed Value Lists\n\nExample Requests:\n\n\n\ngroups/template\n\n\n\ngroups/template?officeId=2\n\n\n\ngroups/template?centerId=1\n\n\n\ngroups/template?centerId=1&staffInSelectedOfficeOnly=true", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "description": "officeId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "center", - "in": "query", - "description": "center", - "required": false, - "type": "boolean" - }, - { - "name": "centerId", - "in": "query", - "description": "centerId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetGroupsTemplateResponse" - } - } - } - } - }, - "/interestratecharts/{chartId}/chartslabs": { - "get": { - "tags": [ - "Interest Rate Slab (A.K.A interest bands)" - ], - "summary": "Retrieve all Slabs", - "description": "Retrieve list of slabs associated with a chart\n\nExample Requests:\n\ninterestratecharts/1/chartslabs", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Interest Rate Slab (A.K.A interest bands)" - ], - "summary": "Create a Slab", - "description": "Creates a new interest rate slab for an interest rate chart.\nMandatory Fields\nperiodType, fromPeriod, annualInterestRate\nOptional Fields\ntoPeriod and description\nExample Requests:\n\ninterestratecharts/1/chartslabs", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostInterestRateChartsChartIdChartSlabsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostInterestRateChartsChartIdChartSlabsResponse" - } - } - } - } - }, - "/interestratecharts/{chartId}/chartslabs/{chartSlabId}": { - "get": { - "tags": [ - "Interest Rate Slab (A.K.A interest bands)" - ], - "summary": "Retrieve a Slab", - "description": "Retrieve a slab associated with an Interest rate chart\n\nExample Requests:\n\ninterestratecharts/1/chartslabs/1\n", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chartSlabId", - "in": "path", - "description": "chartSlabId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsResponse" - } - } - } - }, - "put": { - "tags": [ - "Interest Rate Slab (A.K.A interest bands)" - ], - "summary": "Update a Slab", - "description": "It updates the Slab from chart", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chartSlabId", - "in": "path", - "description": "chartSlabId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Interest Rate Slab (A.K.A interest bands)" - ], - "summary": "Delete a Slab", - "description": "Delete a Slab from a chart", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chartSlabId", - "in": "path", - "description": "chartSlabId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteInterestRateChartsChartIdChartSlabsResponse" - } - } - } - } - }, - "/interestratecharts/{chartId}/chartslabs/template": { - "get": { - "tags": [ - "Interest Rate Slab (A.K.A interest bands)" - ], - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/interestratecharts": { - "get": { - "tags": [ - "Interest Rate Chart" - ], - "summary": "Retrieve all Charts", - "description": "Retrieve list of charts associated with a term deposit product(FD or RD).\nExample Requests:\n\ninterestratecharts?productId=1", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetInterestRateChartsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Interest Rate Chart" - ], - "summary": "Create a Chart", - "description": "Creates a new chart which can be attached to a term deposit products (FD or RD).", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostInterestRateChartsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostInterestRateChartsResponse" - } - } - } - } - }, - "/interestratecharts/{chartId}": { - "get": { - "tags": [ - "Interest Rate Chart" - ], - "summary": "Retrieve a Chart", - "description": "It retrieves the Interest Rate Chart\nExample Requests:\n\ninterestratecharts/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInterestRateChartsResponse" - } - } - } - }, - "put": { - "tags": [ - "Interest Rate Chart" - ], - "summary": "Update a Chart", - "description": "It updates the Chart.", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutInterestRateChartsChartIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutInterestRateChartsChartIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Interest Rate Chart" - ], - "summary": "Delete a Chart", - "description": "It deletes the chart", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "chartId", - "in": "path", - "description": "chartId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteInterestRateChartsChartIdResponse" - } - } - } - } - }, - "/interestratecharts/template": { - "get": { - "tags": [ - "Interest Rate Chart" - ], - "summary": "Retrieve Chart Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for creating a chart. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\ninterestratecharts/template", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetInterestRateChartsTemplateResponse" - } - } - } - } - }, - "/loans/{loanId}/charges/{chargeId}": { - "get": { - "tags": [ - "Loan Charges" - ], - "summary": "Retrieve a Loan Charge", - "description": "Retrieves Loan Charge according to the Loan ID and Charge IDExample Requests:\n\n/loans/1/charges/1\n\n\n/loans/1/charges/1?fields=name,amountOrPercentage", - "operationId": "retrieveLoanCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdChargesChargeIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Loan Charges" - ], - "summary": "Pay Loan Charge", - "description": "Loan Charge will be paid if the loan is linked with a savings account", - "operationId": "executeLoanCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdChargesChargeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdChargesChargeIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Loan Charges" - ], - "summary": "Update a Loan Charge", - "description": "Currently Loan Charges may be updated only if the Loan is not yet approved", - "operationId": "updateLoanCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutLoansLoanIdChargesChargeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutLoansLoanIdChargesChargeIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Loan Charges" - ], - "summary": "Delete a Loan Charge", - "description": "Note: Currently, A Loan Charge may only be removed from Loans that are not yet approved.", - "operationId": "deleteLoanCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteLoansLoanIdChargesChargeIdResponse" - } - } - } - } - }, - "/loans/{loanId}/charges": { - "get": { - "tags": [ - "Loan Charges" - ], - "summary": "List Loan Charges", - "description": "It lists all the Loan Charges specific to a Loan \n\nExample Requests:\n\nloans/1/charges\n\n\nloans/1/charges?fields=name,amountOrPercentage", - "operationId": "retrieveAllLoanCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetLoansLoanIdChargesChargeIdResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Loan Charges" - ], - "summary": "Create a Loan Charge", - "description": "It Creates a Loan Charge", - "operationId": "executeLoanCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdChargesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdChargesResponse" - } - } - } - } - }, - "/loans/{loanId}/charges/template": { - "get": { - "tags": [ - "Loan Charges" - ], - "summary": "Retrieve Loan Charges Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nloans/1/charges/template\n\n", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdChargesTemplateResponse" - } - } - } - } - }, - "/loans/{loanId}/schedule": { - "post": { - "tags": [ - "Loan Rescheduling" - ], - "summary": "Calculate loan repayment schedule based on Loan term variations | Updates loan repayment schedule based on Loan term variations | Updates loan repayment schedule by removing Loan term variations", - "description": "Calculate loan repayment schedule based on Loan term variations:\n\nMandatory Fields: exceptions,locale,dateFormat\n\nUpdates loan repayment schedule based on Loan term variations:\n\nMandatory Fields: exceptions,locale,dateFormat\n\nUpdates loan repayment schedule by removing Loan term variations:\n\nIt updates the loan repayment schedule by removing Loan term variations\n\nShowing request/response for 'Updates loan repayment schedule by removing Loan term variations'", - "operationId": "calculateLoanScheduleOrSubmitVariableSchedule", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdScheduleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdScheduleResponse" - } - } - } - } - }, - "/loans/{loanId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Loan Transactions" - ], - "summary": "Retrieve a Transaction Details", - "description": "Retrieves a Transaction Details\n\nExample Request:\n\nloans/5/transactions/3", - "operationId": "retrieveTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdTransactionsTransactionIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Loan Transactions" - ], - "summary": "Adjust a Transaction", - "description": "Note: there is no need to specify command={transactionType} parameter.\n\nMandatory Fields: transactionDate, transactionAmount", - "operationId": "adjustLoanTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdTransactionsTransactionIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdTransactionsTransactionIdResponse" - } - } - } - } - }, - "/loans/{loanId}/transactions/template": { - "get": { - "tags": [ - "Loan Transactions" - ], - "summary": "Retrieve Loan Transaction Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Request:\n\nloans/1/transactions/template?command=repayment", - "operationId": "retrieveTransactionTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "query", - "description": "dateFormat", - "required": false, - "type": "string" - }, - { - "name": "transactionDate", - "in": "query", - "description": "transactionDate", - "required": false, - "type": "string" - }, - { - "name": "locale", - "in": "query", - "description": "locale", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdTransactionsTemplateResponse" - } - } - } - } - }, - "/loans/{loanId}/transactions": { - "post": { - "tags": [ - "Loan Transactions" - ], - "summary": "Make a Repayment | Make a Refund of an Active Loan by Cash | Foreclosure of an Active Loan | Waive Interest | Write-off Loan | Make Recovery Payment | Undo Loan Write-off Transaction", - "description": "Make Recovery Payment:\n\nThis API allows collecting recovery payments for written-off loans", - "operationId": "executeLoanTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdTransactionsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdTransactionsResponse" - } - } - } - } - }, - "/loans/{loanId}/template": { - "get": { - "tags": [ - "Loans" - ], - "operationId": "retrieveApprovalTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "templateType", - "in": "query", - "description": "templateType", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/loans/{loanId}": { - "get": { - "tags": [ - "Loans" - ], - "summary": "Retrieve a Loan", - "description": "Note: template=true parameter doesn't apply to this resource.Example Requests:\n\nloans/1\n\n\nloans/1?fields=id,principal,annualInterestRate\n\n\nloans/1?associations=all\n\nloans/1?associations=all&exclude=guarantors\n\n\nloans/1?fields=id,principal,annualInterestRate&associations=repaymentSchedule,transactions", - "operationId": "retrieveLoan", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansLoanIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Loans" - ], - "summary": "Approve Loan Application | Recover Loan Guarantee | Undo Loan Application Approval | Assign a Loan Officer | Unassign a Loan Officer | Reject Loan Application | Applicant Withdraws from Loan Application | Disburse Loan Disburse Loan To Savings Account | Undo Loan Disbursal", - "description": "Approve Loan Application:\nMandatory Fields: approvedOnDate\nOptional Fields: approvedLoanAmount and expectedDisbursementDate\nApproves the loan application\n\nRecover Loan Guarantee:\nRecovers the loan guarantee\n\nUndo Loan Application Approval:\nUndoes the Loan Application Approval\n\nAssign a Loan Officer:\nAllows you to assign Loan Officer for existing Loan.\n\nUnassign a Loan Officer:\nAllows you to unassign the Loan Officer.\n\nReject Loan Application:\nMandatory Fields: rejectedOnDate\nAllows you to reject the loan application\n\nApplicant Withdraws from Loan Application:\nMandatory Fields: withdrawnOnDate\nAllows the applicant to withdraw the loan application\n\nDisburse Loan:\nMandatory Fields: actualDisbursementDate\nOptional Fields: transactionAmount and fixedEmiAmount\nDisburses the Loan\n\nDisburse Loan To Savings Account:\nMandatory Fields: actualDisbursementDate\nOptional Fields: transactionAmount and fixedEmiAmount\nDisburses the loan to Saving Account\n\nUndo Loan Disbursal:\nUndoes the Loan Disbursal\nShowing request and response for Assign a Loan Officer", - "operationId": "stateTransitions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansLoanIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansLoanIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Loans" - ], - "summary": "Modify a loan application", - "description": "Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.", - "operationId": "modifyLoanApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutLoansLoanIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutLoansLoanIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Loans" - ], - "summary": "Delete a Loan Application", - "description": "Note: Only loans in \"Submitted and awaiting approval\" status can be deleted.", - "operationId": "deleteLoanApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteLoansLoanIdResponse" - } - } - } - } - }, - "/loans": { - "get": { - "tags": [ - "Loans" - ], - "summary": "List Loans", - "description": "The list capability of loans can support pagination and sorting.\nExample Requests:\n\nloans\n\nloans?fields=accountNo\n\nloans?offset=10&limit=50\n\nloans?orderBy=accountNo&sortOrder=DESC", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - }, - { - "name": "accountNo", - "in": "query", - "description": "accountNo", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansResponse" - } - } - } - }, - "post": { - "tags": [ - "Loans" - ], - "summary": "Calculate loan repayment schedule | Submit a new Loan Application", - "description": "It calculates the loan repayment Schedule\nSubmits a new loan application\nMandatory Fields: clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, loanType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, expectedDisbursementDate, submittedOnDate, loanType\nOptional Fields: graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, linkAccountId, allowPartialPeriodInterestCalcualtion, fixedEmiAmount, maxOutstandingLoanBalance, disbursementData, graceOnArrearsAgeing, createStandingInstructionAtDisbursement (requires linkedAccountId if set to true)\nAdditional Mandatory Fields if interest recalculation is enabled for product and Rest frequency not same as repayment period: recalculationRestFrequencyDate\nAdditional Mandatory Fields if interest recalculation with interest/fee compounding is enabled for product and compounding frequency not same as repayment period: recalculationCompoundingFrequencyDate\nAdditional Mandatory Field if Entity-Datatable Check is enabled for the entity of type loan: datatables", - "operationId": "calculateLoanScheduleOrSubmitLoanApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoansRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoansResponse" - } - } - } - } - }, - "/loans/downloadtemplate": { - "get": { - "tags": [ - "Loans" - ], - "operationId": "getLoansTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/loans/repayments/downloadtemplate": { - "get": { - "tags": [ - "Loans" - ], - "operationId": "getLoanRepaymentTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/loans/uploadtemplate": { - "post": { - "tags": [ - "Loans" - ], - "operationId": "postLoanTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/loans/repayments/uploadtemplate": { - "post": { - "tags": [ - "Loans" - ], - "operationId": "postLoanRepaymentTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/loans/template": { - "get": { - "tags": [ - "Loans" - ], - "summary": "Retrieve Loan Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Requests:\n\nloans/template?templateType=individual&clientId=1\n\n\nloans/template?templateType=individual&clientId=1&productId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "groupId", - "in": "query", - "description": "groupId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "templateType", - "in": "query", - "description": "templateType", - "required": false, - "type": "string" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "activeOnly", - "in": "query", - "description": "activeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoansTemplateResponse" - } - } - } - } - }, - "/loanproducts/{productId}": { - "get": { - "tags": [ - "Loan Products" - ], - "summary": "Retrieve a Loan Product", - "description": "Retrieves a Loan Product\n\nExample Requests:\n\nloanproducts/1\n\n\nloanproducts/1?template=true\n\n\nloanproducts/1?fields=name,description,numberOfRepayments", - "operationId": "retrieveLoanProductDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoanProductsProductIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Loan Products" - ], - "summary": "Update a Loan Product", - "description": "Updates a Loan Product", - "operationId": "updateLoanProduct", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutLoanProductsProductIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutLoanProductsProductIdResponse" - } - } - } - } - }, - "/loanproducts": { - "get": { - "tags": [ - "Loan Products" - ], - "summary": "List Loan Products", - "description": "Lists Loan Products\n\nExample Requests:\n\nloanproducts\n\n\nloanproducts?fields=name,description,interestRateFrequencyType,amortizationType", - "operationId": "retrieveAllLoanProducts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetLoanProductsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Loan Products" - ], - "summary": "Create a Loan Product", - "description": "Depending of the Accounting Rule (accountingRule) selected, additional fields with details of the appropriate Ledger Account identifiers would need to be passed in.\n\nRefer MifosX Accounting Specs Draft for more details regarding the significance of the selected accounting rule\n\nMandatory Fields: name, shortName, currencyCode, digitsAfterDecimal, inMultiplesOf, principal, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, accountingRule, isInterestRecalculationEnabled, daysInYearType, daysInMonthType\n\nOptional Fields: inArrearsTolerance, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, graceOnArrearsAgeing, charges, paymentChannelToFundSourceMappings, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, includeInBorrowerCycle, useBorrowerCycle,principalVariationsForBorrowerCycle, numberOfRepaymentVariationsForBorrowerCycle, interestRateVariationsForBorrowerCycle, multiDisburseLoan,maxTrancheCount, outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, installmentAmountInMultiplesOf, allowAttributeOverrides, allowPartialPeriodInterestCalcualtion\n\nAdditional Mandatory Fields for Cash(2) based accounting: fundSourceAccountId, loanPortfolioAccountId, interestOnLoanAccountId, incomeFromFeeAccountId, incomeFromPenaltyAccountId, writeOffAccountId, transfersInSuspenseAccountId, overpaymentLiabilityAccountId\n\nAdditional Mandatory Fields for periodic (3) and upfront (4)accrual accounting: fundSourceAccountId, loanPortfolioAccountId, interestOnLoanAccountId, incomeFromFeeAccountId, incomeFromPenaltyAccountId, writeOffAccountId, receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId, transfersInSuspenseAccountId, overpaymentLiabilityAccountId\n\nAdditional Mandatory Fields if interest recalculation is enabled(true): interestRecalculationCompoundingMethod, rescheduleStrategyMethod, recalculationRestFrequencyType\n\nAdditional Optional Fields if interest recalculation is enabled(true): isArrearsBasedOnOriginalSchedule, preClosureInterestCalculationStrategy\n\nAdditional Optional Fields if interest recalculation is enabled(true) and recalculationRestFrequencyType is not same as repayment period: recalculationRestFrequencyInterval, recalculationRestFrequencyDate\n\nAdditional Optional Fields if interest recalculation is enabled(true) and interestRecalculationCompoundingMethod is enabled: recalculationCompoundingFrequencyType\n\nAdditional Optional Fields if interest recalculation is enabled(true) and interestRecalculationCompoundingMethod is enabled and recalculationCompoundingFrequencyType is not same as repayment period: recalculationCompoundingFrequencyInterval, recalculationCompoundingFrequencyDate\n\nAdditional Mandatory Fields if Hold Guarantee funds is enabled(true): mandatoryGuarantee\n\nAdditional Optional Fields if Hold Guarantee funds is enabled(true): minimumGuaranteeFromOwnFunds,minimumGuaranteeFromGuarantor", - "operationId": "createLoanProduct", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostLoanProductsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLoanProductsResponse" - } - } - } - } - }, - "/loanproducts/template": { - "get": { - "tags": [ - "Loan Products" - ], - "summary": "Retrieve Loan Product Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nloanproducts/template", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "isProductMixTemplate", - "in": "query", - "description": "isProductMixTemplate", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetLoanProductsTemplateResponse" - } - } - } - } - }, - "/{resourceType}/{resourceId}/notes": { - "get": { - "tags": [ - "Notes" - ], - "summary": "Retrieve a Resource's Notes", - "description": "Retrieves a Resource's Notes\n\nNote: Notes are returned in descending createOn order.\n\nExample Requests:\n\nclients/2/notes\n\n\ngroups/2/notes?fields=note,createdOn,createdByUsername", - "operationId": "retrieveNotesByResource", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceType", - "in": "path", - "description": "resourceType", - "required": true, - "type": "string" - }, - { - "name": "resourceId", - "in": "path", - "description": "resourceId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetResourceTypeResourceIdNotesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Notes" - ], - "summary": "Add a Resource Note", - "description": "Adds a new note to a supported resource.\n\nExample Requests:\n\nclients/1/notes\n\n\ngroups/1/notes", - "operationId": "addNewNote", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceType", - "in": "path", - "description": "resourceType", - "required": true, - "type": "string" - }, - { - "name": "resourceId", - "in": "path", - "description": "resourceId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostResourceTypeResourceIdNotesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostResourceTypeResourceIdNotesResponse" - } - } - } - } - }, - "/{resourceType}/{resourceId}/notes/{noteId}": { - "get": { - "tags": [ - "Notes" - ], - "summary": "Retrieve a Resource Note", - "description": "Retrieves a Resource Note\n\nExample Requests:\n\nclients/1/notes/76\n\n\ngroups/1/notes/20\n\n\nclients/1/notes/76?fields=note,createdOn,createdByUsername\n\n\ngroups/1/notes/20?fields=note,createdOn,createdByUsername", - "operationId": "retrieveNote", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceType", - "in": "path", - "description": "resourceType", - "required": true, - "type": "string" - }, - { - "name": "resourceId", - "in": "path", - "description": "resourceId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "noteId", - "in": "path", - "description": "noteId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetResourceTypeResourceIdNotesNoteIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Notes" - ], - "summary": "Update a Resource Note", - "description": "Updates a Resource Note", - "operationId": "updateNote", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceType", - "in": "path", - "description": "resourceType", - "required": true, - "type": "string" - }, - { - "name": "resourceId", - "in": "path", - "description": "resourceId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "noteId", - "in": "path", - "description": "noteId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutResourceTypeResourceIdNotesNoteIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutResourceTypeResourceIdNotesNoteIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Notes" - ], - "summary": "Delete a Resource Note", - "description": "Deletes a Resource Note", - "operationId": "deleteNote", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "resourceType", - "in": "path", - "description": "resourceType", - "required": true, - "type": "string" - }, - { - "name": "resourceId", - "in": "path", - "description": "resourceId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "noteId", - "in": "path", - "description": "noteId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteResourceTypeResourceIdNotesNoteIdResponse" - } - } - } - } - }, - "/paymenttypes/{paymentTypeId}": { - "get": { - "tags": [ - "Payment Type" - ], - "summary": "Retrieve a Payment Type", - "description": "Retrieves a payment type", - "operationId": "retrieveOnePaymentType", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "paymentTypeId", - "in": "path", - "description": "paymentTypeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetPaymentTypesPaymentTypeIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Payment Type" - ], - "summary": "Update a Payment Type", - "description": "Updates a Payment Type", - "operationId": "updatePaymentType", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "paymentTypeId", - "in": "path", - "description": "paymentTypeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutPaymentTypesPaymentTypeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutPaymentTypesPaymentTypeIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Payment Type" - ], - "summary": "Delete a Payment Type", - "description": "Deletes payment type", - "operationId": "deleteCode", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "paymentTypeId", - "in": "path", - "description": "paymentTypeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeletePaymentTypesPaymentTypeIdResponse" - } - } - } - } - }, - "/paymenttypes": { - "get": { - "tags": [ - "Payment Type" - ], - "summary": "Retrieve all Payment Types", - "description": "Retrieve list of payment types", - "operationId": "getAllPaymentTypes", - "consumes": [ - "text/html", - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetPaymentTypesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Payment Type" - ], - "summary": "Create a Payment Type", - "description": "Creates a new Payment type\n\nMandatory Fields: name\n\nOptional Fields: Description, isCashPayment,Position", - "operationId": "createPaymentType", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostPaymentTypesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostPaymentTypesResponse" - } - } - } - } - }, - "/products/{type}/{productId}": { - "get": { - "tags": [ - "Products" - ], - "summary": "Retrieve a Share Product", - "description": "Retrieves a Share Product\n\nExample Requests:\n\nproducts/share/1\n\n\nproducts/share/1?template=true", - "operationId": "retrieveProduct", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetProductsTypeProductIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Products" - ], - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "Products" - ], - "summary": "Update a Share Product", - "description": "Updates a Share Product", - "operationId": "updateProduct", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutProductsTypeProductIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutProductsTypeProductIdResponse" - } - } - } - } - }, - "/products/{type}": { - "get": { - "tags": [ - "Products" - ], - "summary": "List Share Products", - "description": "Lists Share Products\n\nMandatory Fields: limit, offset\n\nExample Requests:\n\nshareproducts", - "operationId": "retrieveAllProducts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetProductsTypeResponse" - } - } - } - }, - "post": { - "tags": [ - "Products" - ], - "summary": "Create a Share Product", - "description": "Creates a Share Product\n\nMandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, locale, totalShares, unitPrice, nominalShares,allowDividendCalculationForInactiveClients,accountingRule\n\nMandatory Fields for Cash based accounting (accountingRule = 2): shareReferenceId, shareSuspenseId, shareEquityId, incomeFromFeeAccountId\n\nOptional Fields: sharesIssued, minimumShares, maximumShares, minimumActivePeriodForDividends, minimumactiveperiodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType, marketPricePeriods, chargesSelected", - "operationId": "createProduct", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostProductsTypeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostProductsTypeResponse" - } - } - } - } - }, - "/products/{type}/template": { - "get": { - "tags": [ - "Products" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "path", - "description": "type", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/fixeddepositaccounts/{accountId}": { - "get": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "Retrieve a fixed deposit application/account", - "description": "Retrieves a fixed deposit application/account\n\nExample Requests :\n\n\n\nfixeddepositaccounts/1\n\nfixeddepositaccounts/1?associations=all", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetFixedDepositAccountsAccountIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "Approve fixed deposit application | Undo approval fixed deposit application | Reject fixed deposit application | Withdraw fixed deposit application | Activate a fixed deposit account | Close a fixed deposit account | Premature Close a fixed deposit account | Calculate Premature amount on Fixed deposit account | Calculate Interest on Fixed Deposit Account | Post Interest on Fixed Deposit Account", - "description": "Approve fixed deposit application:\n\nApproves fixed deposit application so long as its in 'Submitted and pending approval' state.\n\nUndo approval fixed deposit application:\n\nWill move 'approved' fixed deposit application back to 'Submitted and pending approval' state.\n\nReject fixed deposit application:\n\nRejects fixed deposit application so long as its in 'Submitted and pending approval' state.\n\nWithdraw fixed deposit application:\n\nUsed when an applicant withdraws from the fixed deposit application. It must be in 'Submitted and pending approval' state.\n\nClose a fixed deposit account:\n\nResults in a Matured fixed deposit account being converted into a 'closed' fixed deposit account.\n\nPremature Close a fixed deposit account:\n\nResults in an Active fixed deposit account being converted into a 'Premature Closed' fixed deposit account with options to withdraw prematured amount. (premature amount is calculated using interest rate chart applicable along with penal interest if any.)\n\nCalculate Premature amount on Fixed deposit account:\n\nCalculate premature amount on fixed deposit account till premature close date. Premature amount is calculated based on interest chart and penal interest applicable.\n\nCalculate Interest on Fixed Deposit Account:\n\nCalculates interest earned on a fixed deposit account based on todays date. It does not attempt to post or credit the interest on the account. That is responsibility of the Post Interest API that will likely be called by overnight process.\n\nPost Interest on Fixed Deposit Account:\n\nCalculates and Posts interest earned on a fixed deposit account based on today's date and whether an interest posting or crediting event is due.\n\nShowing request/response for Calculate Interest on Fixed Deposit Account", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostFixedDepositAccountsAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostFixedDepositAccountsAccountIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "Modify a fixed deposit application", - "description": "Fixed deposit application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutFixedDepositAccountsAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutFixedDepositAccountsAccountIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "Delete a fixed deposit application", - "description": "At present we support hard delete of fixed deposit application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the fixed deposit account.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteFixedDepositAccountsAccountIdResponse" - } - } - } - } - }, - "/fixeddepositaccounts": { - "get": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "List Fixed deposit applications/accounts", - "description": "Lists Fixed Deposit Accounts\n\nExample Requests:\n\n\n\nfixeddepositaccounts\n\n\n\nfixeddepositaccounts?fields=name", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "paged", - "in": "query", - "description": "paged", - "required": false, - "type": "boolean" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetFixedDepositAccountsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "Submit new fixed deposit application", - "description": "Submits a new fixed deposit applicationMandatory Fields: clientId or groupId, productId, submittedOnDate, depositAmount, depositPeriod, depositPeriodFrequencyId\n\nOptional Fields: accountNo, externalId, fieldOfficerId,linkAccountId(if provided initial deposit amount will be collected from this account),transferInterestToSavings(By enabling this flag all interest postings will be transferred to linked saving account )", - "operationId": "submitApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostFixedDepositAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostFixedDepositAccountsResponse" - } - } - } - } - }, - "/fixeddepositaccounts/{accountId}/template": { - "get": { - "tags": [ - "Fixed Deposit Account" - ], - "operationId": "accountClosureTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/fixeddepositaccounts/downloadtemplate": { - "get": { - "tags": [ - "Fixed Deposit Account" - ], - "operationId": "getFixedDepositTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/fixeddepositaccounts/uploadtemplate": { - "post": { - "tags": [ - "Fixed Deposit Account" - ], - "operationId": "postFixedDepositTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/fixeddepositaccounts/transaction/downloadtemplate": { - "get": { - "tags": [ - "Fixed Deposit Account" - ], - "operationId": "getFixedDepositTransactionTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/fixeddepositaccounts/transaction/uploadtemplate": { - "post": { - "tags": [ - "Fixed Deposit Account" - ], - "operationId": "postFixedDepositTransactionTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/fixeddepositaccounts/template": { - "get": { - "tags": [ - "Fixed Deposit Account" - ], - "summary": "Retrieve Fixed Deposit Account Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for fixed deposit applications. The template data returned consists of any or all of:\n\n\n\nField Defaults\n\nAllowed Value ListsExample Requests:\n\n\n\nfixeddepositaccounts/template?clientId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "groupId", - "in": "query", - "description": "groupId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetFixedDepositAccountsTemplateResponse" - } - } - } - } - }, - "/fixeddepositproducts": { - "get": { - "tags": [ - "Fixed Deposit Product" - ], - "summary": "List Fixed Deposit Products", - "description": "Lists Fixed Deposit Products\n\nExample Requests:\n\nfixeddepositproducts\n\n\nfixeddepositproducts?fields=name", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetFixedDepositProductsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Fixed Deposit Product" - ], - "summary": "Create a Fixed Deposit Product", - "description": "Creates a Fixed Deposit Product\n\nMandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, accountingRule\n\nOptional Fields: lockinPeriodFrequency, lockinPeriodFrequencyType, maxDepositTerm, maxDepositTermTypeId, inMultiplesOfDepositTerm, inMultiplesOfDepositTermTypeId, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, charts, , withHoldTax, taxGroupId\n\n\nMandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostFixedDepositProductsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostFixedDepositProductsResponse" - } - } - } - } - }, - "/fixeddepositproducts/{productId}": { - "get": { - "tags": [ - "Fixed Deposit Product" - ], - "summary": "Retrieve a Fixed Deposit Product", - "description": "Retrieves a Fixed Deposit Product\n\nExample Requests:\n\nfixeddepositproducts/1\n\n\nfixeddepositproducts/1?template=true\n\n\nfixeddepositproducts/1?fields=name,description", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Fixed Deposit Product" - ], - "summary": "Update a Fixed Deposit Product", - "description": "Updates a Fixed Deposit Product", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutFixedDepositProductsProductIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutFixedDepositProductsProductIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Fixed Deposit Product" - ], - "summary": "Delete a Fixed Deposit Product", - "description": "Deletes a Fixed Deposit Product", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteFixedDepositProductsProductIdResponse" - } - } - } - } - }, - "/fixeddepositproducts/template": { - "get": { - "tags": [ - "Fixed Deposit Product" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/recurringdepositaccounts/{recurringDepositAccountId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Recurring Deposit Account Transactions" - ], - "summary": "Retrieve Recurring Deposit Account Transaction", - "description": "Retrieves Recurring Deposit Account Transaction\n\nExample Requests:\n\nrecurringdepositaccounts/1/transactions/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "recurringDepositAccountId", - "in": "path", - "description": "recurringDepositAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Recurring Deposit Account Transactions" - ], - "summary": "Adjust Transaction | Undo transaction", - "description": "Adjust Transaction:\n\nThis command modifies the given transaction.\n\nUndo transaction:\n\nThis command reverses the given transaction.\n\nShowing request/response for 'Adjust Transaction'", - "operationId": "handleTransactionCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "recurringDepositAccountId", - "in": "path", - "description": "recurringDepositAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse" - } - } - } - } - }, - "/recurringdepositaccounts/{recurringDepositAccountId}/transactions": { - "post": { - "tags": [ - "Recurring Deposit Account Transactions" - ], - "summary": "Deposit Transaction | Withdrawal Transaction", - "description": "Deposit Transaction:\n\nUsed for a deposit transaction\n\nWithdrawal Transaction:\n\nUsed for a Withdrawal Transaction\n\nShowing request/response for Deposit Transaction", - "operationId": "transaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "recurringDepositAccountId", - "in": "path", - "description": "recurringDepositAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse" - } - } - } - } - }, - "/recurringdepositaccounts/{recurringDepositAccountId}/transactions/template": { - "get": { - "tags": [ - "Recurring Deposit Account Transactions" - ], - "summary": "Retrieve Recurring Deposit Account Transaction Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Requests:\n\nrecurringdepositaccounts/1/transactions/template?command=deposit\n\nrecurringdepositaccounts/1/transactions/template?command=withdrawal", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "recurringDepositAccountId", - "in": "path", - "description": "recurringDepositAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse" - } - } - } - } - }, - "/recurringdepositaccounts/{accountId}": { - "get": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "Retrieve a recurring deposit application/account", - "description": "Retrieves a recurring deposit application/account\n\nExample Requests :\n\nrecurringdepositaccounts/1\n\n\nrecurringdepositaccounts/1?associations=all", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRecurringDepositAccountsAccountIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "Approve recurring deposit application | Undo approval recurring deposit application | Reject recurring deposit application | Withdraw recurring deposit application | Activate a recurring deposit account | Update the recommended deposit amount for a recurring deposit account | Close a recurring deposit account | Premature Close a recurring deposit account | Calculate Premature amount on Recurring deposit account | Calculate Interest on recurring Deposit Account | Post Interest on recurring Deposit Account", - "description": "Approve recurring deposit application:\n\nApproves recurring deposit application so long as its in 'Submitted and pending approval' state.\n\nUndo approval recurring deposit application:\n\nWill move 'approved' recurring deposit application back to 'Submitted and pending approval' state.\n\nReject recurring deposit application\n\nRejects recurring deposit application so long as its in 'Submitted and pending approval' state.\n\nWithdraw recurring deposit application:\n\nUsed when an applicant withdraws from the recurring deposit application. It must be in 'Submitted and pending approval' state.\n\nActivate a recurring deposit account:\n\nResults in an approved recurring deposit application being converted into an 'active' recurring deposit account.\n\nUpdate the recommended deposit amount for a recurring deposit account:\n\nUpdates the recommended deposit amount for a RD account as on the effective date.\n\nClose a recurring deposit account\n\nResults in a Matured recurring deposit account being converted into a 'closed' recurring deposit account.\n\nOn account close allowed actions are.Premature Close a recurring deposit account:\n\nResults in an Active recurring deposit account being converted into a 'Premature Closed' recurring deposit account with options to withdraw prematured amount. (premature amount is calculated using interest rate chart applicable along with penal interest if any.)\n\nOn account premature closure allowed actions are.\n\nCalculate Premature amount on Recurring deposit account:\n\nCalculate premature amount on recurring deposit till premature close date. Premature amount is calculated based on interest chart and penal interest applicable if any.\n\nCalculate Interest on recurring Deposit Account:\n\nCalculates interest earned on a recurring deposit account based on todays date. It does not attempt to post or credit the interest on the account. That is responsibility of the Post Interest API that will likely be called by overnight process.\n\nPost Interest on recurring Deposit Account:\n\nCalculates and Posts interest earned on a recurring deposit account based on todays date and whether an interest posting or crediting event is due.\n\nShowing request/response for 'Post Interest on recurring Deposit Account'", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsAccountIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "Modify a recurring deposit application", - "description": "Recurring deposit application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutRecurringDepositAccountsAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutRecurringDepositAccountsAccountIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "Delete a recurring deposit application", - "description": "At present we support hard delete of recurring deposit application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the recurring deposit account.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteRecurringDepositAccountsResponse" - } - } - } - } - }, - "/recurringdepositaccounts": { - "get": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "List Recurring deposit applications/accounts", - "description": "Lists Recurring deposit applications/accounts\n\nExample Requests:\n\nrecurringdepositaccounts\n\n\nrecurringdepositaccounts?fields=name", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "paged", - "in": "query", - "description": "paged", - "required": false, - "type": "boolean" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetRecurringDepositAccountsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "Submit new recurring deposit application", - "description": "Submits new recurring deposit application\n\nMandatory Fields: clientId or groupId, productId, submittedOnDate, depositAmount, depositPeriod, depositPeriodFrequencyId\n\nOptional Fields: accountNo, externalId, fieldOfficerId,linkAccountId(if provided initial deposit amount will be collected from this account),transferInterestToSavings(By enabling this flag all interest postings will be transferred to linked saving account )\n\nInherited from Product (if not provided): interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, lockinPeriodFrequency, lockinPeriodFrequencyType, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, charts, withHoldTax", - "operationId": "submitApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostRecurringDepositAccountsResponse" - } - } - } - } - }, - "/recurringdepositaccounts/{accountId}/template": { - "get": { - "tags": [ - "Recurring Deposit Account" - ], - "operationId": "accountClosureTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/recurringdepositaccounts/downloadtemplate": { - "get": { - "tags": [ - "Recurring Deposit Account" - ], - "operationId": "getRecurringDepositTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/recurringdepositaccounts/uploadtemplate": { - "post": { - "tags": [ - "Recurring Deposit Account" - ], - "operationId": "postRecurringDepositTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/recurringdepositaccounts/transactions/downloadtemplate": { - "get": { - "tags": [ - "Recurring Deposit Account" - ], - "operationId": "getRecurringDepositTransactionTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/recurringdepositaccounts/transactions/uploadtemplate": { - "post": { - "tags": [ - "Recurring Deposit Account" - ], - "operationId": "postRecurringDepositTransactionsTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/recurringdepositaccounts/template": { - "get": { - "tags": [ - "Recurring Deposit Account" - ], - "summary": "Retrieve recurring Deposit Account Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for recurring deposit applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Requests:\n\nrecurringdepositaccounts/template?clientId=1\n\n\nrecurringdepositaccounts/template?clientId=1&productId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "groupId", - "in": "query", - "description": "groupId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRecurringDepositAccountsTemplateResponse" - } - } - } - } - }, - "/recurringdepositproducts": { - "get": { - "tags": [ - "Recurring Deposit Product" - ], - "summary": "List Recuring Deposit Products", - "description": "Lists Recuring Deposit Products\n\nExample Requests:\n\nrecurringdepositproducts\n\n\nrecurringdepositproducts?fields=name", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetRecurringDepositProductsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Recurring Deposit Product" - ], - "summary": "Create a Recurring Deposit Product", - "description": "Creates a Recurring Deposit Product\n\nMandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, recurringDepositFrequency, recurringDepositFrequencyTypeId, accountingRule, depositAmount\n\nMandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId\n\nOptional Fields: lockinPeriodFrequency, lockinPeriodFrequencyType, maxDepositTerm, maxDepositTermTypeId, inMultiplesOfDepositTerm, inMultiplesOfDepositTermTypeId, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, charts, minDepositAmount, maxDepositAmount, withHoldTax, taxGroupId", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRecurringDepositProductsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostRecurringDepositProductsResponse" - } - } - } - } - }, - "/recurringdepositproducts/{productId}": { - "get": { - "tags": [ - "Recurring Deposit Product" - ], - "summary": "Retrieve a Recurring Deposit Product", - "description": "Retrieves a Recurring Deposit Product\n\nExample Requests:\n\nrecurringdepositproducts/1\n\n\nrecurringdepositproducts/1?template=true\n\n\nrecurringdepositproducts/1?fields=name,description", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Recurring Deposit Product" - ], - "summary": "Update a Recurring Deposit Product", - "description": "Updates a Recurring Deposit Product", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutRecurringDepositProductsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutRecurringDepositProductsResponse" - } - } - } - }, - "delete": { - "tags": [ - "Recurring Deposit Product" - ], - "summary": "Delete a Recurring Deposit Product", - "description": "Deletes a Recurring Deposit Product", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteRecurringDepositProductsProductIdResponse" - } - } - } - } - }, - "/recurringdepositproducts/template": { - "get": { - "tags": [ - "Recurring Deposit Product" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/savingsaccounts/{savingsAccountId}/charges": { - "get": { - "tags": [ - "Savings Charges" - ], - "summary": "List Savings Charges", - "description": "Lists Savings Charges\n\nExample Requests:\n\nsavingsaccounts/1/charges\n\nsavingsaccounts/1/charges?chargeStatus=all\n\nsavingsaccounts/1/charges?chargeStatus=inactive\n\nsavingsaccounts/1/charges?chargeStatus=active\n\nsavingsaccounts/1/charges?fields=name,amountOrPercentage", - "operationId": "retrieveAllSavingsAccountCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetSavingsAccountsSavingsAccountIdChargesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Savings Charges" - ], - "summary": "Create a Savings account Charge", - "description": "Creates a Savings account Charge\n\nMandatory Fields for Savings account Charges: chargeId, amount\n\nchargeId, amount, dueDate, dateFormat, locale\n\nchargeId, amount, feeOnMonthDay, monthDayFormat, locale", - "operationId": "addSavingsAccountCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSavingsAccountsSavingsAccountIdChargesRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSavingsAccountsSavingsAccountIdChargesResponse" - } - } - } - } - }, - "/savingsaccounts/{savingsAccountId}/charges/{savingsAccountChargeId}": { - "get": { - "tags": [ - "Savings Charges" - ], - "summary": "Retrieve a Savings account Charge", - "description": "Retrieves a Savings account Charge\n\nExample Requests:\n\n/savingsaccounts/1/charges/5\n\n\n/savingsaccounts/1/charges/5?fields=name,amountOrPercentage", - "operationId": "retrieveSavingsAccountCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "savingsAccountChargeId", - "in": "path", - "description": "savingsAccountChargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Savings Charges" - ], - "summary": "Pay a Savings account Charge | Waive off a Savings account Charge | Inactivate a Savings account Charge", - "description": "Pay a Savings account Charge:\n\nAn active charge will be paid when savings account is active and having sufficient balance.\n\nWaive off a Savings account Charge:\n\nOutstanding charge amount will be waived off.\n\nInactivate a Savings account Charge:\n\nA charge will be allowed to inactivate when savings account is active and not having any dues as of today. If charge is overpaid, corresponding charge payment transactions will be reversed.\n\nShowing request/response for 'Pay a Savings account Charge'", - "operationId": "payOrWaiveSavingsAccountCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "savingsAccountChargeId", - "in": "path", - "description": "savingsAccountChargeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Savings Charges" - ], - "summary": "Update a Savings account Charge", - "description": "Currently Savings account Charges may be updated only if the Savings account is not yet approved.", - "operationId": "updateSavingsAccountCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "savingsAccountChargeId", - "in": "path", - "description": "savingsAccountChargeId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Savings Charges" - ], - "summary": "Delete a Savings account Charge", - "description": "Note: Currently, A Savings account Charge may only be removed from Savings that are not yet approved.", - "operationId": "deleteSavingsAccountCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "savingsAccountChargeId", - "in": "path", - "description": "savingsAccountChargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse" - } - } - } - } - }, - "/savingsaccounts/{savingsAccountId}/charges/template": { - "get": { - "tags": [ - "Savings Charges" - ], - "summary": "Retrieve Savings Charges Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nsavingsaccounts/1/charges/template", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "savingsAccountId", - "in": "path", - "description": "savingsAccountId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsAccountsSavingsAccountIdChargesTemplateResponse" - } - } - } - } - }, - "/savingsaccounts/{accountId}": { - "get": { - "tags": [ - "Savings Account" - ], - "summary": "Retrieve a savings application/account", - "description": "Retrieves a savings application/account\n\nExample Requests :\n\nsavingsaccounts/1\n\n\nsavingsaccounts/1?associations=all", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsAccountsAccountIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Savings Account" - ], - "summary": "Approve savings application | Undo approval savings application | Assign Savings Officer | Unassign Savings Officer | Reject savings application | Withdraw savings application | Activate a savings account | Close a savings account | Calculate Interest on Savings Account | Post Interest on Savings Account | Block Savings Account | Unblock Savings Account | Block Savings Account Credit transactions | Unblock Savings Account Credit transactions | Block Savings Account Debit transactions | Unblock Savings Account debit transactions", - "description": "Approve savings application:\n\nApproves savings application so long as its in 'Submitted and pending approval' state.\n\nUndo approval savings application:\n\nWill move 'approved' savings application back to 'Submitted and pending approval' state.\n\nAssign Savings Officer:\n\nAllows you to assign Savings Officer for existing Savings Account.\n\nUnassign Savings Officer:\n\nAllows you to unassign the Savings Officer.\n\nReject savings application:\n\nRejects savings application so long as its in 'Submitted and pending approval' state.\n\nWithdraw savings application:\n\nUsed when an applicant withdraws from the savings application. It must be in 'Submitted and pending approval' state.\n\nActivate a savings account:\n\nResults in an approved savings application being converted into an 'active' savings account.\n\nClose a savings account:\n\nResults in an Activated savings application being converted into an 'closed' savings account.\n\nclosedOnDate is closure date of savings account\n\nwithdrawBalance is a boolean value, true value of this field performs a withdrawal transaction with account's running balance.\n\nMandatory Fields: dateFormat,locale,closedOnDate\n\nOptional Fields: note, withdrawBalance, paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber\n\nCalculate Interest on Savings Account:\n\nCalculates interest earned on a savings account based on todays date. It does not attempt to post or credit the interest on the account. That is responsibility of the Post Interest API that will likely be called by overnight process.\n\nPost Interest on Savings Account:\n\nCalculates and Posts interest earned on a savings account based on today's date and whether an interest posting or crediting event is due.\n\nBlock Savings Account:\n\nBlocks Savings account from all types of credit and debit transactions\n\nUnblock Savings Account:\n\nUnblock a blocked account. On unblocking account, user can perform debit and credit transactions\n\nBlock Savings Account Credit transactions:\n\nSavings account will be blocked from all types of credit transactions.\n\nUnblock Savings Account Credit transactions:\n\nIt unblocks the Saving account's credit operations. Now all types of credits can be transacted to Savings account\n\nBlock Savings Account Debit transactions:\n\nAll types of debit operations from Savings account wil be blocked\n\nUnblock Savings Account debit transactions:\n\nIt unblocks the Saving account's debit operations. Now all types of debits can be transacted from Savings account\n\nShowing request/response for 'Unassign Savings Officer'", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSavingsAccountsAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSavingsAccountsAccountIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Savings Account" - ], - "summary": "Modify a savings application | Modify savings account withhold tax applicability", - "description": "Modify a savings application:\n\nSavings application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method. Specific api endpoints will be created to allow change of interest detail such as rate, compounding period, posting period etc\n\nModify savings account withhold tax applicability:\n\nSavings application's withhold tax can be modified when in 'Active' state. Once the application is activated, can modify the account withhold tax to post tax or vice-versaShowing request/response for 'Modify a savings application'", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutSavingsAccountsAccountIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutSavingsAccountsAccountIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Savings Account" - ], - "summary": "Delete a savings application", - "description": "At present we support hard delete of savings application so long as its in 'Submitted and pending approval' state. One the application is moves past this state, it is not possible to do a 'hard' delete of the application or the account. An API endpoint will be added to close/de-activate the savings account.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteSavingsAccountsAccountIdResponse" - } - } - } - } - }, - "/savingsaccounts": { - "get": { - "tags": [ - "Savings Account" - ], - "summary": "List savings applications/accounts", - "description": "Lists savings applications/accounts\n\nExample Requests:\n\nsavingsaccounts\n\n\nsavingsaccounts?fields=name", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "sqlSearch", - "in": "query", - "description": "sqlSearch", - "required": false, - "type": "string" - }, - { - "name": "externalId", - "in": "query", - "description": "externalId", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsAccountsResponse" - } - } - } - }, - "post": { - "tags": [ - "Savings Account" - ], - "summary": "Submit new savings application", - "description": "Submits new savings application\n\nMandatory Fields: clientId or groupId, productId, submittedOnDate\n\nOptional Fields: accountNo, externalId, fieldOfficerId\n\nInherited from Product (if not provided): nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, withdrawalFeeForTransfers, allowOverdraft, overdraftLimit, withHoldTax\n\nAdditional Mandatory Field if Entity-Datatable Check is enabled for the entity of type Savings: datatables", - "operationId": "submitApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSavingsAccountsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSavingsAccountsResponse" - } - } - } - } - }, - "/savingsaccounts/downloadtemplate": { - "get": { - "tags": [ - "Savings Account" - ], - "operationId": "getSavingsTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/savingsaccounts/uploadtemplate": { - "post": { - "tags": [ - "Savings Account" - ], - "operationId": "postSavingsTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/savingsaccounts/transactions/downloadtemplate": { - "get": { - "tags": [ - "Savings Account" - ], - "operationId": "getSavingsTransactionTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/savingsaccounts/transactions/uploadtemplate": { - "post": { - "tags": [ - "Savings Account" - ], - "operationId": "postSavingsTransactionTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/savingsaccounts/template": { - "get": { - "tags": [ - "Savings Account" - ], - "summary": "Retrieve Savings Account Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Requests:\n\nsavingsaccounts/template?clientId=1\n\n\nsavingsaccounts/template?clientId=1&productId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "groupId", - "in": "query", - "description": "groupId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffInSelectedOfficeOnly", - "in": "query", - "description": "staffInSelectedOfficeOnly", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsAccountsTemplateResponse" - } - } - } - } - }, - "/savingsproducts": { - "get": { - "tags": [ - "Savings Product" - ], - "summary": "List Savings Products", - "description": "Lists Savings Products\n\nExample Requests:\n\nsavingsproducts\n\nsavingsproducts?fields=name", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetSavingsProductsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Savings Product" - ], - "summary": "Create a Savings Product", - "description": "Creates a Savings Product\n\nMandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, nominalAnnualInterestRate, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType,accountingRule\n\nMandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId\n\nOptional Fields: minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, withdrawalFeeForTransfers, paymentChannelToFundSourceMappings, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, allowOverdraft, overdraftLimit, minBalanceForInterestCalculation,withHoldTax,taxGroupId", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSavingsProductsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSavingsProductsResponse" - } - } - } - } - }, - "/savingsproducts/{productId}": { - "get": { - "tags": [ - "Savings Product" - ], - "summary": "Retrieve a Savings Product", - "description": "Retrieves a Savings Product\n\nExample Requests:\n\nsavingsproducts/1\n\nsavingsproducts/1?template=true\n\nsavingsproducts/1?fields=name,description", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsProductsProductIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Savings Product" - ], - "summary": "Update a Savings Product", - "description": "Updates a Savings Product", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutSavingsProductsProductIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutSavingsProductsProductIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Savings Product" - ], - "summary": "Delete a Savings Product", - "description": "Deletes a Savings Product", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "description": "productId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteSavingsProductsProductIdResponse" - } - } - } - } - }, - "/savingsproducts/template": { - "get": { - "tags": [ - "Savings Product" - ], - "summary": "Retrieve Savings Product Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nsavingsproducts/template", - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSavingsProductsTemplateResponse" - } - } - } - } - }, - "/search/template": { - "get": { - "tags": [ - "Search API" - ], - "summary": "Retrive Adhoc Search query template", - "description": "Mandatory Fields\n\nsearch?query=000000001\n", - "operationId": "retrieveAdHocSearchQueryTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetSearchResponse" - } - } - } - } - }, - "/search/advance": { - "post": { - "tags": [ - "Search API" - ], - "summary": "Adhoc query search", - "description": "AdHocQuery search has more search options, it is a POST request, it uses request body to send search parameters\n\n\nMandatory fields:entities\n\nOptional fields:loanStatus, loanProducts, offices, loanDateOption, loanFromDate, loanToDate, \nincludeOutStandingAmountPercentage, outStandingAmountPercentageCondition, \nminOutStandingAmountPercentage and maxOutStandingAmountPercentage OR outStandingAmountPercentage, \nincludeOutstandingAmount, outstandingAmountCondition, \nminOutstandingAmount and maxOutstandingAmount OR outstandingAmount", - "operationId": "advancedSearch", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostAdhocQuerySearchRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostAdhocQuerySearchResponse" - } - } - } - } - }, - "/search": { - "get": { - "tags": [ - "Search API" - ], - "summary": "Search Resources", - "description": "Example Requests:\n\nsearch?query=000000001\n\n\nsearch?query=Petra&resource=clients,groups\n\n\nsearch?query=Petra&resource=clients,groups&exactMatch=true", - "operationId": "searchData", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "query", - "in": "query", - "description": "query", - "required": false, - "type": "string" - }, - { - "name": "resource", - "in": "query", - "description": "resource", - "required": false, - "type": "string" - }, - { - "name": "exactMatch", - "in": "query", - "description": "exactMatch", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetSearchResponse" - } - } - } - } - }, - "/self/accounttransfers/template": { - "get": { - "tags": [ - "Self Account Transfer" - ], - "summary": "Retrieve Account Transfer Template", - "description": "Returns list of loan/savings accounts that can be used for account transfer\n\n\nExample Requests:\n\nself/accounttransfers/template\n", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "type", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetAccountTransferTemplateResponse" - } - } - } - } - } - }, - "/self/accounttransfers": { - "post": { - "tags": [ - "Self Account Transfer" - ], - "summary": "Create new Transfer", - "description": "Ability to create new transfer of monetary funds from one account to another.\n\n\nExample Requests:\n\n self/accounttransfers/\n", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "type", - "in": "query", - "description": "type", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PostNewTransferResponse" - } - } - } - } - } - }, - "/self/beneficiaries/tpt": { - "get": { - "tags": [ - "Self Third Party Transfer" - ], - "summary": "Get All TPT Beneficiary", - "description": "Api to get all third party beneficiary linked to current user.\n\nExample Requests:\n\n/self/beneficiaries/tpt", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetSelfBeneficiariesTPTResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Self Third Party Transfer" - ], - "summary": "Add TPT Beneficiary", - "description": "Api to add third party beneficiary linked to current user.\n\nParameter Definitions\n\nname : Nick name for beneficiary, should be unique for an self service user\n\nofficeName : Office Name of beneficiary(not id)\n\naccountNumber : Account Number of beneficiary(not id)\n\ntransferLimit : Each transfer initiated to this account will not exceed this amount\n\nExample Requests:\n\n/self/beneficiaries/tpt\n\nMandatory Fields: name, officeName, accountNumber, accountType\n\nOptional Fields: transferLimit", - "operationId": "add", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSelfBeneficiariesTPTRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSelfBeneficiariesTPTResponse" - } - } - } - } - }, - "/self/beneficiaries/tpt/template": { - "get": { - "tags": [ - "Self Third Party Transfer" - ], - "summary": "Beneficiary Third Party Transfer Template", - "description": "Returns Account Type enumerations. Self User is expected to know office name and account number to be able to add beneficiary.\n\nExample Requests:\n\n/self/beneficiaries/tpt/template", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfBeneficiariesTPTTemplateResponse" - } - } - } - } - }, - "/self/beneficiaries/tpt/{beneficiaryId}": { - "put": { - "tags": [ - "Self Third Party Transfer" - ], - "summary": "Update TPT Beneficiary", - "description": "Api to update third party beneficiary linked to current user.\n\nExample Requests:\n\n/self/beneficiaries/tpt/{beneficiaryId}\n\nOptional Fields: name, transferLimit", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "beneficiaryId", - "in": "path", - "description": "beneficiaryId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutSelfBeneficiariesTPTBeneficiaryIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutSelfBeneficiariesTPTBeneficiaryIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Self Third Party Transfer" - ], - "summary": "Delete TPT Beneficiary", - "description": "Api to delete third party beneficiary linked to current user.\n\nExample Requests:\n\n/self/beneficiaries/tpt/{beneficiaryId}", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "beneficiaryId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DeleteSelfBeneficiariesTPTBeneficiaryIdResponse" - } - } - } - } - }, - "/self/clients/{clientId}/images": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "Retrieve Client Image", - "description": "Optional arguments are identical to those of Get Image associated with an Entity (Binary file)\n\nExample Requests:\n\nself/clients/1/images", - "operationId": "retrieveImage", - "consumes": [ - "text/plain", - "text/html", - "application/json" - ], - "produces": [ - "text/plain" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "maxWidth", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "x-example": "maxWidth" - }, - { - "name": "maxHeight", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "x-example": "maxHeight" - }, - { - "name": "output", - "in": "query", - "required": false, - "type": "string", - "x-example": "output" - } - ], - "responses": { - "200": { - "description": "OK" - } - } - }, - "post": { - "tags": [ - "Self Client" - ], - "operationId": "addNewClientImage", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "Content-Length", - "in": "header", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "Self Client" - ], - "operationId": "deleteClientImage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/clients/{clientId}/charges": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "List Client Charges", - "description": "The list capability of client charges supports pagination.\n\nExample Requests:\n\nself/clients/1/charges\n\nself/clients/1/charges?offset=0&limit=5", - "operationId": "retrieveAllClientCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - }, - { - "name": "pendingPayment", - "in": "query", - "description": "pendingPayment", - "required": false, - "type": "boolean" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsClientIdChargesResponse" - } - } - } - } - }, - "/self/clients/{clientId}/charges/{chargeId}": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "Retrieve a Client Charge", - "description": "Retrieves a Client Charge\n\nExample Requests:\n\nself/clients/1/charges/1\n\n\nself/clients/1/charges/1?fields=name,id", - "operationId": "retrieveClientCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsClientIdChargesChargeIdResponse" - } - } - } - } - }, - "/self/clients/{clientId}/transactions": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "List Client Transactions", - "description": "The list capability of client transaction can support pagination.\n\nExample Requests:\n\nself/clients/189/transactions\n\nself/clients/189/transactions?offset=10&limit=50", - "operationId": "retrieveAllClientTransactions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsClientIdTransactionsResponse" - } - } - } - } - }, - "/self/clients/{clientId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "Retrieve a Client Transaction", - "description": "Retrieves a Client TransactionExample Requests:\n\nself/clients/1/transactions/1\n\n\nself/clients/1/transactions/1?fields=id,officeName", - "operationId": "retrieveClientTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsClientIdTransactionsTransactionIdResponse" - } - } - } - } - }, - "/self/clients/{clientId}/accounts": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "Retrieve client accounts overview", - "description": "An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application.\nIt is quite reasonable to add resources like this to simplify User Interface development.\n\nExample Requests:\n\nself/clients/1/accounts\n\n\nself/clients/1/accounts?fields=loanAccounts,savingsAccounts", - "operationId": "retrieveAssociatedAccounts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsClientIdAccountsResponse" - } - } - } - } - }, - "/self/clients/{clientId}/obligeedetails": { - "get": { - "tags": [ - "Self Client" - ], - "operationId": "retrieveObligeeDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/clients": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "List Clients associated to the user", - "description": "The list capability of clients can support pagination and sorting.\n\nExample Requests:\n\nself/clients\n\nself/clients?fields=displayName,officeName\n\nself/clients?offset=10&limit=50\n\nself/clients?orderBy=displayName&sortOrder=DESC", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "displayName", - "in": "query", - "description": "displayName", - "required": false, - "type": "string" - }, - { - "name": "firstName", - "in": "query", - "description": "firstName", - "required": false, - "type": "string" - }, - { - "name": "lastName", - "in": "query", - "description": "lastName", - "required": false, - "type": "string" - }, - { - "name": "offset", - "in": "query", - "description": "offset", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "description": "limit", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "description": "orderBy", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "description": "sortOrder", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsResponse" - } - } - } - } - }, - "/self/clients/{clientId}": { - "get": { - "tags": [ - "Self Client" - ], - "summary": "Retrieve a Client", - "description": "Retrieves a Client\n\nExample Requests:\n\nself/clients/1\n\nself/clients/1?fields=id,displayName,officeName", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "description": "clientId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfClientsClientIdResponse" - } - } - } - } - }, - "/self/loans/{loanId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Self Loans" - ], - "summary": "Retrieve a Loan Transaction Details", - "description": "Retrieves a Loan Transaction DetailsExample Request:\n\nself/loans/5/transactions/3", - "operationId": "retrieveTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfLoansLoanIdTransactionsTransactionIdResponse" - } - } - } - } - }, - "/self/loans/{loanId}/charges": { - "get": { - "tags": [ - "Self Loans" - ], - "summary": "List Loan Charges", - "description": "Lists loan Charges\n\nExample Requests:\n\nself/loans/1/charges\n\n\nself/loans/1/charges?fields=name,amountOrPercentage", - "operationId": "retrieveAllLoanCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetSelfLoansLoanIdChargesResponse" - } - } - } - } - } - }, - "/self/loans/{loanId}/charges/{chargeId}": { - "get": { - "tags": [ - "Self Loans" - ], - "summary": "Retrieve a Loan Charge", - "description": "Retrieves a Loan Charge\n\nExample Requests:\n\nself/loans/1/charges/1\n\n\nself/loans/1/charges/1?fields=name,amountOrPercentage", - "operationId": "retrieveLoanCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeId", - "in": "path", - "description": "chargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfLoansLoanIdChargesResponse" - } - } - } - } - }, - "/self/loans/{loanId}": { - "get": { - "tags": [ - "Self Loans" - ], - "summary": "Retrieve a Loan", - "description": "Retrieves a Loan\n\nExample Requests:\n\nself/loans/1\n\n\nself/loans/1?fields=id,principal,annualInterestRate\n\n\nself/loans/1?fields=id,principal,annualInterestRate&associations=repaymentSchedule,transactions", - "operationId": "retrieveLoan", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfLoansLoanIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Self Loans" - ], - "summary": "Applicant Withdraws from Loan Application", - "description": "Applicant Withdraws from Loan Application\n\nMandatory Fields: withdrawnOnDate", - "operationId": "stateTransitions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSelfLoansLoanIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSelfLoansLoanIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Self Loans" - ], - "summary": "Update a Loan Application", - "description": "Loan application can only be modified when in 'Submitted and pending approval' state. Once the application is approved, the details cannot be changed using this method.", - "operationId": "modifyLoanApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "description": "loanId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutSelfLoansLoanIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutSelfLoansLoanIdResponse" - } - } - } - } - }, - "/self/loans": { - "post": { - "tags": [ - "Self Loans" - ], - "summary": "Calculate Loan Repayment Schedule | Submit a new Loan Application", - "description": "Calculate Loan Repayment Schedule:\n\nCalculates Loan Repayment Schedule\n\nMandatory Fields: productId, principal, loanTermFrequency, loanTermFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, expectedDisbursementDate, transactionProcessingStrategyId\n\nSubmit a new Loan Application:\n\nMandatory Fields: clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, loanType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, expectedDisbursementDate, submittedOnDate, loanType\n\nAdditional Mandatory Fields if interest recalculation is enabled for product and Rest frequency not same as repayment period: recalculationRestFrequencyDate\n\nAdditional Mandatory Fields if interest recalculation with interest/fee compounding is enabled for product and compounding frequency not same as repayment period: recalculationCompoundingFrequencyDate\n\nAdditional Mandatory Field if Entity-Datatable Check is enabled for the entity of type loan: datatables\n\nOptional Fields: graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, linkAccountId, allowPartialPeriodInterestCalcualtion, fixedEmiAmount, maxOutstandingLoanBalance, disbursementData, graceOnArrearsAgeing, createStandingInstructionAtDisbursement (requires linkedAccountId if set to true)\n\nShowing request/response for 'Submit a new Loan Application'", - "operationId": "calculateLoanScheduleOrSubmitLoanApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostSelfLoansRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSelfLoansResponse" - } - } - } - } - }, - "/self/loans/{loanId}/guarantors": { - "get": { - "tags": [ - "Self Loans" - ], - "operationId": "retrieveGuarantorDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "loanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/loans/template": { - "get": { - "tags": [ - "Self Loans" - ], - "summary": "Retrieve Loan Details Template", - "description": "Retrieves Loan Details Template\n\nThis is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\n\nExample Requests:\n\nself/loans/template?templateType=individual&clientId=1\n\n\nself/loans/template?templateType=individual&clientId=1&productId=1", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "templateType", - "in": "query", - "description": "templateType", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfLoansTemplateResponse" - } - } - } - } - }, - "/self/pockets": { - "get": { - "tags": [ - "Pocket" - ], - "summary": "Retrieve accounts linked to pocket", - "description": "All linked loan\n\nExample Requests:\n\n\nself/pockets", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetAccountsLinkedToPocketResponse" - } - } - } - }, - "post": { - "tags": [ - "Pocket" - ], - "summary": "Link/delink accounts to/from pocket", - "description": "Pockets behave as favourites. An user can link his/her Loan, Savings and Share accounts to pocket for faster access. In a similar way linked accounts can be delinked from the pocket.\n\nExample Requests:\n\nself/pockets?command=linkAccounts\n\nself/pockets?command=delinkAccounts", - "operationId": "handleCommands", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostLinkDelinkAccountsToFromPocketResponse" - } - } - } - } - }, - "/self/loanproducts/{productId}": { - "get": { - "tags": [ - "Self Loan Products" - ], - "operationId": "retrieveLoanProductDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/loanproducts": { - "get": { - "tags": [ - "Self Loan Products" - ], - "operationId": "retrieveAllLoanProducts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/registration": { - "post": { - "tags": [ - "Self Service Registration" - ], - "operationId": "createSelfServiceRegistrationRequest", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/registration/user": { - "post": { - "tags": [ - "Self Service Registration" - ], - "operationId": "createSelfServiceUser", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/runreports/{reportName}": { - "get": { - "tags": [ - "Self Run Report " - ], - "summary": "Running A Report", - "description": "Example Requests:\n\n\nself/runreports/Client%20Details?R_officeId=1\n\n\nself/runreports/Client%20Details?R_officeId=1&exportCSV=true", - "operationId": "runReport", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json", - "text/csv", - "application/vnd.ms-excel", - "application/pdf", - "text/html" - ], - "parameters": [ - { - "name": "reportName", - "in": "path", - "description": "reportName", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetRunReportResponse" - } - } - } - } - }, - "/self/savingsaccounts/{accountId}/transactions/{transactionId}": { - "get": { - "tags": [ - "Self Savings Account" - ], - "summary": "Retrieve Savings Account Transaction", - "description": "Retrieves Savings Account Transaction\n\nExample Requests:\n\nself/savingsaccounts/1/transactions/1", - "operationId": "retrieveSavingsTransaction", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "transactionId", - "in": "path", - "description": "transactionId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse" - } - } - } - } - }, - "/self/savingsaccounts/{accountId}/charges": { - "get": { - "tags": [ - "Self Savings Account" - ], - "summary": "List Savings Charges", - "description": "Lists Savings Charges\n\nExample Requests:\n\nself/savingsaccounts/1/charges\n\nself/savingsaccounts/1/charges?chargeStatus=inactive\n\nself/savingsaccounts/1/charges?fields=name,amountOrPercentage", - "operationId": "retrieveAllSavingsAccountCharges", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetSelfSavingsAccountsAccountIdChargesResponse" - } - } - } - } - } - }, - "/self/savingsaccounts/{accountId}/charges/{savingsAccountChargeId}": { - "get": { - "tags": [ - "Self Savings Account" - ], - "summary": "Retrieve a Savings account Charge", - "description": "Retrieves a Savings account Charge\n\nExample Requests:\n\nself/savingsaccounts/1/charges/5\n\n\nself/savingsaccounts/1/charges/5?fields=name,amountOrPercentage", - "operationId": "retrieveSavingsAccountCharge", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "savingsAccountChargeId", - "in": "path", - "description": "savingsAccountChargeId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse" - } - } - } - } - }, - "/self/savingsaccounts/{accountId}": { - "get": { - "tags": [ - "Self Savings Account" - ], - "summary": "Retrieve a savings account", - "description": "Retrieves a savings account\n\nExample Requests :\n\nself/savingsaccounts/1\n\n\nself/savingsaccounts/1?associations=transactions", - "operationId": "retrieveSavings", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "accountId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "chargeStatus", - "in": "query", - "description": "chargeStatus", - "required": false, - "type": "string", - "default": "all" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfSavingsAccountsResponse" - } - } - } - }, - "put": { - "tags": [ - "Self Savings Account" - ], - "operationId": "modifySavingsAccountApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/savingsaccounts": { - "post": { - "tags": [ - "Self Savings Account" - ], - "operationId": "submitSavingsAccountApplication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "command", - "in": "query", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/savingsaccounts/template": { - "get": { - "tags": [ - "Self Savings Account" - ], - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/authentication": { - "post": { - "tags": [ - "Self Authentication" - ], - "summary": "Verify authentication", - "description": "Authenticates the credentials provided and returns the set roles and permissions allowed.\n\nPlease visit this link for more info - https://demo.openmf.org/api-docs/apiLive.htm#selfbasicauth", - "operationId": "authenticate", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "username", - "in": "query", - "description": "username", - "required": false, - "type": "string" - }, - { - "name": "password", - "in": "query", - "description": "password", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostSelfAuthenticationResponse" - } - } - } - } - }, - "/self/user": { - "put": { - "tags": [ - "Self User" - ], - "summary": "Update User", - "description": "This API can be used by Self Service user to update their own user information. Currently, \"password\" and \"repeatPassword\" are the only parameters accepted.", - "operationId": "update", - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutSelfUserRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutSelfUserResponse" - } - } - } - } - }, - "/self/userdetails": { - "get": { - "tags": [ - "Self User Details" - ], - "summary": "Fetch authenticated user details", - "description": "Checks the Authentication and returns the set roles and permissions allowed\n\nFor more info visit this link - https://demo.openmf.org/api-docs/apiLive.htm#selfoauth", - "operationId": "fetchAuthenticatedUserData", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "access_token", - "in": "query", - "description": "äccess_token", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetSelfUserDetailsResponse" - } - } - } - } - }, - "/self/shareaccounts": { - "post": { - "tags": [ - "Self Share Accounts" - ], - "summary": "Submit new share application", - "description": "Mandatory fields:\n\nclientId, productId, submittedDate, savingsAccountId, requestedShares, applicationDate\n\n\nOptional Fields\n\naccountNo, externalId\n\n\nInherited from Product (if not provided)\n\nminimumActivePeriod, minimumActivePeriodFrequencyType, lockinPeriodFrequency, lockinPeriodFrequencyType.", - "operationId": "createAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PostNewShareApplicationResponse" - } - } - } - } - } - }, - "/self/shareaccounts/{accountId}": { - "get": { - "tags": [ - "Self Share Accounts" - ], - "operationId": "retrieveShareAccount", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "accountId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/self/shareaccounts/template": { - "get": { - "tags": [ - "Self Share Accounts" - ], - "summary": "Retrieve Share Account Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\nField Defaults\n\nAllowed Value Lists\n\n\nArguments\n\nclientId:Integer mandatory\nproductId:Integer optionalIf entered, productId, productName and selectedProduct fields are returned.\nExample Requests:\n\nself/shareaccounts/template?clientId=14\n\nself/shareaccounts/template?clientId=14&productId=3\n", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "description": "clientId", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "productId", - "in": "query", - "description": "productId", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetShareAccountsClientIdProductIdResponse" - } - } - } - } - } - }, - "/self/surveys/scorecards/{surveyId}": { - "post": { - "tags": [ - "Self Score Card" - ], - "operationId": "createScorecard", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ScorecardData" - } - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/self/surveys/scorecards/clients/{clientId}": { - "get": { - "tags": [ - "Self Score Card" - ], - "operationId": "findByClient", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ScorecardData" - } - }, - "headers": {} - } - } - } - }, - "/self/surveys": { - "get": { - "tags": [ - "Self Spm" - ], - "operationId": "fetchAllSurveys", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/SurveyData" - } - }, - "headers": {} - } - } - } - }, - "/shareproduct/{productId}/dividend/{dividendId}": { - "get": { - "tags": [ - "Self Dividend" - ], - "operationId": "retrieveDividendDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "dividendId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "accountNo", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "Self Dividend" - ], - "operationId": "updateDividendDetail", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "dividendId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "required": false, - "type": "string" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "delete": { - "tags": [ - "Self Dividend" - ], - "operationId": "deleteDividendDetail", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "dividendId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/shareproduct/{productId}/dividend": { - "get": { - "tags": [ - "Self Dividend" - ], - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "orderBy", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sortOrder", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "status", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "post": { - "tags": [ - "Self Dividend" - ], - "operationId": "createDividendDetail", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "productId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/taxes/component": { - "get": { - "tags": [ - "Tax Components" - ], - "summary": "List Tax Components", - "description": "List Tax Components", - "operationId": "retrieveAllTaxComponents", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetTaxesComponentsResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Tax Components" - ], - "summary": "Create a new Tax Component", - "description": "Creates a new Tax Component\n\nMandatory Fields: name, percentage\n\nOptional Fields: debitAccountType, debitAcountId, creditAccountType, creditAcountId, startDate", - "operationId": "createTaxCompoent", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTaxesComponentsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostTaxesComponentsResponse" - } - } - } - } - }, - "/taxes/component/{taxComponentId}": { - "get": { - "tags": [ - "Tax Components" - ], - "summary": "Retrieve Tax Component", - "description": "Retrieve Tax Component", - "operationId": "retrieveTaxComponent", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "taxComponentId", - "in": "path", - "description": "taxComponentId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetTaxesComponentsResponse" - } - } - } - }, - "put": { - "tags": [ - "Tax Components" - ], - "summary": "Update Tax Component", - "description": "Updates Tax component. Debit and credit account details cannot be modified. All the future tax components would be replaced with the new percentage.", - "operationId": "updateTaxCompoent", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "taxComponentId", - "in": "path", - "description": "taxComponentId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutTaxesComponentsTaxComponentIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutTaxesComponentsTaxComponentIdResponse" - } - } - } - } - }, - "/taxes/component/template": { - "get": { - "tags": [ - "Tax Components" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/taxes/group/{taxGroupId}": { - "get": { - "tags": [ - "Tax Group" - ], - "summary": "Retrieve Tax Group", - "description": "Retrieve Tax Group", - "operationId": "retrieveTaxGroup", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "taxGroupId", - "in": "path", - "description": "taxGroupId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/GetTaxesGroupResponse" - } - } - } - }, - "put": { - "tags": [ - "Tax Group" - ], - "summary": "Update Tax Group", - "description": "Updates Tax Group. Only end date can be up-datable and can insert new tax components.", - "operationId": "updateTaxGroup", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "taxGroupId", - "in": "path", - "description": "taxGroupId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutTaxesGroupTaxGroupIdRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PutTaxesGroupTaxGroupIdResponse" - } - } - } - } - }, - "/taxes/group": { - "get": { - "tags": [ - "Tax Group" - ], - "summary": "List Tax Group", - "description": "List Tax Group", - "operationId": "retrieveAllTaxGroups", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetTaxesGroupResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Tax Group" - ], - "summary": "Create a new Tax Group", - "description": "Create a new Tax Group\nMandatory Fields: name and taxComponents\nMandatory Fields in taxComponents: taxComponentId\nOptional Fields in taxComponents: id, startDate and endDate", - "operationId": "createTaxGroup", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTaxesGroupRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/PostTaxesGroupResponse" - } - } - } - } - }, - "/taxes/group/template": { - "get": { - "tags": [ - "Tax Group" - ], - "operationId": "retrieveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/surveys/{surveyId}/lookuptables/{key}": { - "get": { - "tags": [ - "SPM API - LookUp Table" - ], - "summary": "Retrieve a Lookup Table entry", - "description": "Retrieve a Lookup Table entry for a survey.", - "operationId": "findLookupTable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "description": "Enter surveyId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "key", - "in": "path", - "description": "Enter key", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/LookupTableData" - } - } - } - } - }, - "/surveys/{surveyId}/lookuptables": { - "get": { - "tags": [ - "SPM API - LookUp Table" - ], - "summary": "List all Lookup Table entries", - "description": "List all Lookup Table entries for a survey.", - "operationId": "fetchLookupTables", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "description": "Enter surveyId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/LookupTableData" - } - } - } - } - }, - "post": { - "tags": [ - "SPM API - LookUp Table" - ], - "summary": "Create a Lookup Table entry", - "description": "Add a new entry to a survey.\n\nMandatory Fields\nkey, score, validFrom, validTo", - "operationId": "createLookupTable", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "description": "Enter surveyId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/LookupTableData" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/surveys/scorecards/{surveyId}": { - "get": { - "tags": [ - "Score Card" - ], - "summary": "List all Scorecard entries", - "description": "List all Scorecard entries for a survey.", - "operationId": "findBySurvey", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "description": "Enter surveyId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Scorecard" - } - } - } - } - }, - "post": { - "tags": [ - "Score Card" - ], - "summary": "Create a Scorecard entry", - "description": "Add a new entry to a survey.\n\nMandatory Fields\nclientId, createdOn, questionId, responseId, staffId", - "operationId": "createScorecard", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "description": "Enter surveyId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ScorecardData" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/surveys/scorecards/clients/{clientId}": { - "get": { - "tags": [ - "Score Card" - ], - "operationId": "findByClient", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ScorecardData" - } - }, - "headers": {} - } - } - } - }, - "/surveys/scorecards/{surveyId}/clients/{clientId}": { - "get": { - "tags": [ - "Score Card" - ], - "operationId": "findBySurveyAndClient", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "surveyId", - "in": "path", - "description": "Enter surveyId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "clientId", - "in": "path", - "description": "Enter clientId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ScorecardData" - } - }, - "headers": {} - } - } - } - }, - "/surveys": { - "get": { - "tags": [ - "Spm-Surveys" - ], - "summary": "List all Surveys", - "description": "", - "operationId": "fetchAllSurveys", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "isActive", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/SurveyData" - } - } - } - } - }, - "post": { - "tags": [ - "Spm-Surveys" - ], - "summary": "Create a Survey", - "description": "Adds a new survey to collect client related data.\n\nMandatory Fields\n\ncountryCode, key, name, questions, responses, sequenceNo, text, value", - "operationId": "createSurvey", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "Create survey", - "required": false, - "schema": { - "$ref": "#/definitions/SurveyData" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/surveys/{id}": { - "get": { - "tags": [ - "Spm-Surveys" - ], - "summary": "Retrieve a Survey", - "description": "", - "operationId": "findSurvey", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Enter id", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/SurveyData" - } - } - } - }, - "post": { - "tags": [ - "Spm-Surveys" - ], - "summary": "Deactivate Survey", - "description": "", - "operationId": "activateOrDeactivateSurvey", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK" - } - } - }, - "put": { - "tags": [ - "Spm-Surveys" - ], - "operationId": "editSurvey", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SurveyData" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/templates": { - "get": { - "tags": [ - "User Generated Documents" - ], - "summary": "Retrieve all UGDs", - "description": "Example Requests:\n\ntemplates\n\nIt is also possible to get specific UGDs by entity and type:\n\ntemplates?type=0&entity=0\n[Entity: Id]\n\n\n\n\n\nclient: 0, loan: 1\n\n[Type: Id]\n\n\n\nDocument: 0, E-Mail (not yet): 1, SMS: 2", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "typeId", - "in": "query", - "description": "typeId", - "required": false, - "type": "integer", - "default": -1, - "format": "int32" - }, - { - "name": "entityId", - "in": "query", - "description": "entityId", - "required": false, - "type": "integer", - "default": -1, - "format": "int32" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTemplatesResponse" - } - } - } - }, - "post": { - "tags": [ - "User Generated Documents" - ], - "summary": "Add a UGD", - "description": "Adds a new UGD.\n\nMandatory Fields\nname\n\n\n\nExample Requests:\n\ntemplates/1", - "operationId": "createTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostTemplatesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostTemplatesResponse" - } - } - } - } - }, - "/templates/{templateId}/template": { - "get": { - "tags": [ - "User Generated Documents" - ], - "operationId": "getTemplateByTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "templateId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/templates/{templateId}": { - "get": { - "tags": [ - "User Generated Documents" - ], - "summary": "Retrieve a UGD", - "description": "Example Requests:\n\ntemplates/1", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "templateId", - "in": "path", - "description": "templateId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTemplatesTemplateIdResponse" - } - } - } - }, - "post": { - "tags": [ - "User Generated Documents" - ], - "operationId": "mergeTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "text/html" - ], - "parameters": [ - { - "name": "templateId", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - }, - "put": { - "tags": [ - "User Generated Documents" - ], - "summary": "Update a UGD", - "description": "", - "operationId": "saveTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "templateId", - "in": "path", - "description": "templateId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutTemplatesTemplateIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutTemplatesTemplateIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "User Generated Documents" - ], - "summary": "Delete a UGD", - "description": "", - "operationId": "deleteTemplate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "templateId", - "in": "path", - "description": "templateId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteTemplatesTemplateIdResponse" - } - } - } - } - }, - "/templates/template": { - "get": { - "tags": [ - "User Generated Documents" - ], - "summary": "Retrieve UGD Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for UGDs. The UGD data returned consists of any or all of:\n\nARGUMENTS\nname String entity String type String text String optional mappers Mapper optional\nExample Request:\n\ntemplates/template", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetTemplatesTemplateResponse" - } - } - } - } - }, - "/passwordpreferences/template": { - "get": { - "tags": [ - "Password preferences" - ], - "summary": "List Application Password validation policies", - "description": "ARGUMENTS\nExample Requests:\n\npasswordpreferences", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetPasswordPreferencesTemplateResponse" - } - } - } - } - } - }, - "/passwordpreferences": { - "get": { - "tags": [ - "Password preferences" - ], - "operationId": "retrieve", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetPasswordPreferencesTemplateResponse" - } - } - } - }, - "put": { - "tags": [ - "Password preferences" - ], - "summary": "Update password preferences", - "description": "", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutPasswordPreferencesTemplateRequest" - } - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/permissions": { - "get": { - "tags": [ - "Permissions" - ], - "summary": "List Application Permissions", - "description": "ARGUMENTS\nmakerCheckerableoptional, Values are true, false. Default is false.\nIf makerCheckerable=false or not supplied then a list of application permissions is returned. The \"selected\" attribute is always true in this case.\n\nIf makerCheckerable=true then the \"selected\" attribute shows whether the permission is enabled for Maker Check functionality.\n\nNote: Each Apache Fineract transaction is associated with a permission.\n\nExample Requests:\n\npermissions\n\n\npermissions?makerCheckerable=true\n\n\npermissions?fields=grouping,code", - "operationId": "retrieveAllPermissions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetPermissionsResponse" - } - } - } - } - }, - "put": { - "tags": [ - "Permissions" - ], - "summary": "Enable/Disable Permissions for Maker Checker", - "description": "", - "operationId": "updatePermissionsDetails", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutPermissionsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/CommandProcessingResult" - } - } - } - } - }, - "/roles": { - "get": { - "tags": [ - "Roles" - ], - "summary": "List Roles", - "description": "Example Requests:\n\nroles\n\n\nroles?fields=name", - "operationId": "retrieveAllRoles", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetRolesResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Roles" - ], - "summary": "Create a New Role", - "description": "Mandatory Fields\nname, description", - "operationId": "createRole", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostRolesRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostRolesResponse" - } - } - } - } - }, - "/roles/{roleId}": { - "get": { - "tags": [ - "Roles" - ], - "summary": "Retrieve a Role", - "description": "Example Requests:\n\nroles/1\n\n\nroles/1?fields=name", - "operationId": "retrieveRole", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "roleId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetRolesRoleIdResponse" - } - } - } - }, - "post": { - "tags": [ - "Roles" - ], - "summary": "Enable Role | Disable Role", - "description": "Description : Enable role in case role is disabled. | Disable the role in case role is not associated with any users.\n\n\n\n\n\nExample Request: https://DomainName/api/v1/roles/{roleId}?command=enable\n\n\n\n\n\nhttps://DomainName/api/v1/roles/{roleId}?command=disable", - "operationId": "actionsOnRoles", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "roleId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "command", - "in": "query", - "description": "command", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostRolesRoleIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Roles" - ], - "summary": "Update a Role", - "description": "", - "operationId": "updateRole", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "roleId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutRolesRoleIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutRolesRoleIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Roles" - ], - "summary": "Delete a Role", - "description": "Description : Delete the role in case role is not associated with any users.", - "operationId": "deleteRole", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "roleId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteRolesRoleIdResponse" - } - } - } - } - }, - "/roles/{roleId}/permissions": { - "get": { - "tags": [ - "Roles" - ], - "summary": "Retrieve a Role's Permissions", - "description": "Example Requests:\n\nroles/1/permissions", - "operationId": "retrieveRolePermissions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "roleId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetRolesRoleIdPermissionsResponse" - } - } - } - }, - "put": { - "tags": [ - "Roles" - ], - "summary": "Update a Role's Permissions", - "description": "", - "operationId": "updateRolePermissions", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "roleId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutRolesRoleIdPermissionsRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutRolesRoleIdPermissionsResponse" - } - } - } - } - }, - "/users/downloadtemplate": { - "get": { - "tags": [ - "Users" - ], - "operationId": "getUserTemplate", - "produces": [ - "application/vnd.ms-excel" - ], - "parameters": [ - { - "name": "officeId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "staffId", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "dateFormat", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/users/uploadtemplate": { - "post": { - "tags": [ - "Users" - ], - "operationId": "postUsersTemplate", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "name": "file", - "in": "formData", - "required": false, - "type": "file" - }, - { - "name": "locale", - "in": "formData", - "required": false, - "type": "string" - }, - { - "name": "dateFormat", - "in": "formData", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "successful operation", - "schema": { - "type": "string" - }, - "headers": {} - } - } - } - }, - "/users": { - "get": { - "tags": [ - "Users" - ], - "summary": "Retrieve list of users", - "description": "Example Requests:\n\nusers\n\n\nusers?fields=id,username,email,officeName", - "operationId": "retrieveAll", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GetUsersResponse" - } - } - } - } - }, - "post": { - "tags": [ - "Users" - ], - "summary": "Create a User", - "description": "Adds new application user.\n\nNote: Password information is not required (or processed). Password details at present are auto-generated and then sent to the email account given (which is why it can take a few seconds to complete).\n\nMandatory Fields: \nusername, firstname, lastname, email, officeId, roles, sendPasswordToEmail\n\nOptional Fields: \nstaffId,passwordNeverExpires,isSelfServiceUser,clients", - "operationId": "create", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostUsersRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PostUsersResponse" - } - } - } - } - }, - "/users/{userId}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Retrieve a User", - "description": "Example Requests:\n\nusers/1\n\n\nusers/1?template=true\n\n\nusers/1?fields=username,officeName", - "operationId": "retrieveOne", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "userId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetUsersUserIdResponse" - } - } - } - }, - "put": { - "tags": [ - "Users" - ], - "summary": "Update a User", - "description": "When updating a password you must provide the repeatPassword parameter also.", - "operationId": "update", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "userId", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "body", - "name": "body", - "description": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PutUsersUserIdRequest" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/PutUsersUserIdResponse" - } - } - } - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Delete a User", - "description": "Removes the user and the associated roles and permissions.", - "operationId": "delete", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "userId", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/DeleteUsersUserIdResponse" - } - } - } - } - }, - "/users/template": { - "get": { - "tags": [ - "Users" - ], - "summary": "Retrieve User Details Template", - "description": "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n\nField Defaults\nAllowed Value Lists\nExample Request:\n\nusers/template", - "operationId": "template", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/GetUsersTemplateResponse" - } - } - } - } - } - }, - "definitions": { - "runaccrualsRequest": { - "type": "object", - "required": [ - "tillDate" - ], - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "tillDate": { - "type": "string", - "example": "04 June 2014" - } - } - }, - "GetGLClosureResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 7 - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "closingDate": { - "type": "string", - "format": "date", - "example": "2013,1,2" - }, - "deleted": { - "type": "boolean", - "example": false - }, - "createdDate": { - "type": "string", - "format": "date", - "example": "2013,1,3" - }, - "lastUpdatedDate": { - "type": "string", - "format": "date", - "example": "2013,1,3" - }, - "createdByUserId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "createdByUsername": { - "type": "string", - "example": "mifos" - }, - "lastUpdatedByUserId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "lastUpdatedByUsername": { - "type": "string", - "example": "mifos" - }, - "comments": { - "type": "string", - "example": "closed" - } - } - }, - "PostGlClosuresResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 9 - } - } - }, - "PostGLCLosuresRequest": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "closingDate": { - "type": "string", - "format": "date", - "example": "06 December 2012" - }, - "comments": { - "type": "string", - "example": "The accountants are heading for a carribean vacation" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - } - } - }, - "PutGlClosuresResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 9 - }, - "comments": { - "type": "string", - "example": "All transactions verified by Johnny Cash" - } - } - }, - "PutGlClosuresRequest": { - "type": "object", - "properties": { - "comments": { - "type": "string", - "example": "All transactions verified by Johnny Cash" - } - } - }, - "DeleteGlClosuresResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 9 - } - } - }, - "CodeValueData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "active": { - "type": "boolean" - }, - "mandatory": { - "type": "boolean" - } - } - }, - "EnumOptionData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "code": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "FinancialActivityData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - }, - "mappedGLAccountType": { - "type": "string", - "enum": [ - "ASSET", - "LIABILITY", - "EQUITY", - "INCOME", - "EXPENSE" - ] - } - } - }, - "GLAccountData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "glCode": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/EnumOptionData" - }, - "tagId": { - "$ref": "#/definitions/CodeValueData" - }, - "rowIndex": { - "type": "integer", - "format": "int32" - }, - "typeId": { - "type": "integer", - "format": "int32" - } - } - }, - "GetFinancialActivityAccountsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "financialActivityData": { - "$ref": "#/definitions/FinancialActivityData" - }, - "glAccountData": { - "$ref": "#/definitions/GLAccountData" - } - } - }, - "PutFinancialActivityAccountsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "comments": { - "$ref": "#/definitions/PutFinancialActivityAccountscommentsSwagger" - } - } - }, - "PutFinancialActivityAccountscommentsSwagger": { - "type": "object", - "properties": { - "glAccountId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostFinancialActivityAccountsRequest": { - "type": "object", - "properties": { - "financialActivityId": { - "type": "integer", - "format": "int64", - "example": 200 - }, - "glAccountId": { - "type": "integer", - "format": "int64", - "example": 2 - } - } - }, - "PostFinancialActivityAccountsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "DeleteFinancialActivityAccountsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetGLAccountsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 16 - }, - "name": { - "type": "string", - "example": "Cash" - }, - "parentId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "glCode": { - "type": "string", - "example": "100001" - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/EnumOptionData" - }, - "usage": { - "$ref": "#/definitions/EnumOptionData" - }, - "description": { - "type": "string", - "example": "Desc" - }, - "nameDecorated": { - "type": "string", - "example": "....Cash" - }, - "tagId": { - "$ref": "#/definitions/CodeValueData" - }, - "organizationRunningBalance": { - "type": "integer", - "format": "int64", - "example": 118437 - } - } - }, - "PutGLAccountsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutGLAccountsResponsechangesSwagger" - } - } - }, - "PutGLAccountsResponsechangesSwagger": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Cash at Bangalore" - } - } - }, - "PutGLAccountsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Cash at Bangalore" - } - } - }, - "PostGLAccountsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 22 - } - } - }, - "PostGLAccountsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Cash at Bangalore" - }, - "glCode": { - "type": "string", - "example": "100001" - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "type": "string", - "example": "1" - }, - "tagId": { - "type": "string", - "example": "10" - }, - "parentId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "usage": { - "example": "1", - "$ref": "#/definitions/EnumOptionData" - }, - "description": { - "type": "string", - "example": "Desc" - } - } - }, - "DeleteGLAccountsRequest": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetGLAccountsTemplateResponse": { - "type": "object", - "properties": { - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/EnumOptionData" - }, - "usage": { - "$ref": "#/definitions/EnumOptionData" - }, - "accountTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "usageOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "assetHeaderAccountOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/GLAccountData" - } - }, - "liabilityHeaderAccountOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/GLAccountData" - } - }, - "equityHeaderAccountOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/GLAccountData" - } - }, - "expenseHeaderAccountOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/GLAccountData" - } - }, - "allowedAssetsTagOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CodeValueData" - } - }, - "allowedLiabilitiesTagOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CodeValueData" - } - }, - "allowedEquityTagOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CodeValueData" - } - }, - "allowedIncomeTagOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CodeValueData" - } - }, - "allowedExpensesTagOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CodeValueData" - } - } - } - }, - "JournalEntryData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "officeId": { - "type": "integer", - "format": "int64" - }, - "glAccountId": { - "type": "integer", - "format": "int64" - }, - "glAccountType": { - "$ref": "#/definitions/EnumOptionData" - }, - "transactionDate": { - "type": "string", - "format": "date" - }, - "entryType": { - "$ref": "#/definitions/EnumOptionData" - }, - "amount": { - "type": "number" - }, - "transactionId": { - "type": "string" - }, - "rowIndex": { - "type": "integer", - "format": "int32" - } - } - }, - "PostJournalEntriesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "description": "1" - }, - "transactionId": { - "type": "string", - "description": "RS9MCISID4WK1ZM" - } - } - }, - "JournalEntryCommand": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "transactionDate": { - "type": "string", - "format": "date" - }, - "comments": { - "type": "string" - }, - "referenceNumber": { - "type": "string" - }, - "accountingRuleId": { - "type": "integer", - "format": "int64" - }, - "credits": { - "type": "array", - "items": { - "$ref": "#/definitions/SingleDebitOrCreditEntryCommand" - } - }, - "debits": { - "type": "array", - "items": { - "$ref": "#/definitions/SingleDebitOrCreditEntryCommand" - } - } - } - }, - "SingleDebitOrCreditEntryCommand": { - "type": "object", - "properties": { - "glAccountId": { - "type": "integer", - "format": "int64" - }, - "amount": { - "type": "number" - }, - "comments": { - "type": "string" - }, - "parametersPassedInRequest": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - }, - "glAccountIdChanged": { - "type": "boolean" - }, - "glAmountChanged": { - "type": "boolean" - }, - "commentsChanged": { - "type": "boolean" - } - } - }, - "PostJournalEntriesTransactionIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "description": "1" - } - } - }, - "PostJournalEntriesTransactionIdRequest": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "description": "1" - } - } - }, - "PostProvisioningEntriesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostProvisioningEntriesRequest": { - "type": "object", - "properties": { - "date": { - "type": "string", - "example": "16 October 2015" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "createjournalentries": { - "type": "string", - "example": "true" - }, - "provisioningentry": { - "type": "string" - }, - "entries": { - "type": "string" - } - } - }, - "PutProvisioningEntriesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PutProvisioningEntriesRequest": { - "type": "object", - "properties": { - "command": { - "type": "string", - "example": "recreateprovisioningentry" - } - } - }, - "ProvisioningEntryData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdDate": { - "type": "string", - "format": "date-time" - } - } - }, - "LoanProductProvisioningEntryData": { - "type": "object", - "properties": { - "historyId": { - "type": "integer", - "format": "int64" - }, - "officeId": { - "type": "integer", - "format": "int64" - }, - "currencyCode": { - "type": "string" - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "categoryId": { - "type": "integer", - "format": "int64" - }, - "overdueInDays": { - "type": "integer", - "format": "int64" - }, - "percentage": { - "type": "number" - }, - "liablityAccount": { - "type": "integer", - "format": "int64" - }, - "expenseAccount": { - "type": "integer", - "format": "int64" - }, - "criteriaId": { - "type": "integer", - "format": "int64" - }, - "outstandingBalance": { - "type": "number" - } - } - }, - "AccountingTagRuleData": { - "type": "object", - "properties": { - "tag": { - "$ref": "#/definitions/CodeValueData" - } - } - }, - "GetAccountRulesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "officeId": { - "type": "integer", - "format": "int64" - }, - "officeName": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "systemDefined": { - "type": "boolean" - }, - "allowMultipleDebitEntries": { - "type": "boolean" - }, - "allowMultipleCreditEntries": { - "type": "boolean" - }, - "creditTags": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountingTagRuleData" - } - }, - "debitTags": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountingTagRuleData" - } - } - } - }, - "AccountingRuleData": { - "type": "object", - "properties": { - "creditTags": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountingTagRuleData" - } - }, - "debitTags": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountingTagRuleData" - } - } - } - }, - "PostAccountingRulesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostAccountingRulesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "test" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountToDebit": { - "type": "integer", - "format": "int64", - "example": 21 - }, - "accountToCredit": { - "type": "integer", - "format": "int64", - "example": 9 - }, - "description": { - "type": "string", - "example": "Employee salary" - } - } - }, - "PutAccountingRulesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutAccountingRulesResponsechangesSwagger" - } - } - }, - "PutAccountingRulesResponsechangesSwagger": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Employee Salary posting rule" - } - } - }, - "PutAccountingRulesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Employee Salary posting rule" - } - } - }, - "DeleteAccountingRulesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetAccountRulesTemplateResponse": { - "type": "object", - "properties": { - "systemDefined": { - "type": "boolean", - "example": false - }, - "allowedOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeData" - } - }, - "allowedAccounts": { - "type": "array", - "items": { - "$ref": "#/definitions/GLAccountData" - } - } - } - }, - "OfficeData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "openingDate": { - "type": "string", - "format": "date" - }, - "hierarchy": { - "type": "string" - }, - "rowIndex": { - "type": "integer", - "format": "int32" - } - } - }, - "BatchResponse": { - "type": "object", - "properties": { - "requestId": { - "type": "integer", - "format": "int64" - }, - "statusCode": { - "type": "integer", - "format": "int32" - }, - "headers": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/Header" - } - }, - "body": { - "type": "string" - } - } - }, - "Header": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "PostBatchesRequest": { - "type": "object", - "properties": { - "requestId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "relativeUrl": { - "type": "string", - "example": "clients" - }, - "method": { - "type": "string", - "example": "POST" - }, - "headers": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/Header" - } - }, - "reference": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "body": { - "$ref": "#/definitions/PostBodyRequestSwagger" - } - } - }, - "PostBodyRequestSwagger": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "firstname": { - "type": "string", - "example": "\"Petra\"" - }, - "lastname": { - "type": "string", - "example": "\"Yton\"" - }, - "externalId": { - "type": "string", - "example": "\"ex_externalId1\"" - }, - "dateFormat": { - "type": "string", - "example": "\"dd MMMM yyyy\"" - }, - "locale": { - "type": "string", - "example": "\"en\"" - }, - "active": { - "type": "boolean", - "example": true - }, - "activationDate": { - "type": "string", - "example": "\"04 March 2009\"" - }, - "submittedOnDate": { - "type": "string", - "example": "\"04 March 2009\"" - } - } - }, - "GetMakerCheckerResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "actionName": { - "type": "string" - }, - "entityName": { - "type": "string" - }, - "resourceId": { - "type": "integer", - "format": "int64" - }, - "subresourceId": { - "type": "integer", - "format": "int64" - }, - "maker": { - "type": "string" - }, - "madeOnDate": { - "type": "string", - "format": "date-time" - }, - "checker": { - "type": "string" - }, - "checkedOnDate": { - "type": "string", - "format": "date-time" - }, - "processingResult": { - "type": "string" - }, - "commandAsJson": { - "type": "string" - }, - "officeName": { - "type": "string" - }, - "groupLevelName": { - "type": "string" - }, - "groupName": { - "type": "string" - }, - "clientName": { - "type": "string" - }, - "loanAccountNo": { - "type": "string" - }, - "savingsAccountNo": { - "type": "string" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "url": { - "type": "string" - } - } - }, - "AppUserData": { - "type": "object", - "properties": { - "rowIndex": { - "type": "integer", - "format": "int32" - }, - "selfServiceUser": { - "type": "boolean" - } - } - }, - "GetMakerCheckersSearchTemplateResponse": { - "type": "object", - "properties": { - "appUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/AppUserData" - } - }, - "actionNames": { - "type": "array", - "items": { - "type": "string" - } - }, - "entityNames": { - "type": "array", - "items": { - "type": "string" - } - }, - "processingResults": { - "type": "array", - "items": { - "$ref": "#/definitions/ProcessingResultLookup" - } - } - } - }, - "ProcessingResultLookup": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "processingResult": { - "type": "string" - } - } - }, - "PostMakerCheckersResponse": { - "type": "object", - "properties": { - "auditId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetAccountNumberFormatsIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "accountType": { - "$ref": "#/definitions/EnumOptionData" - }, - "prefixType": { - "$ref": "#/definitions/EnumOptionData" - } - } - }, - "GetAccountNumberFormatsResponseTemplate": { - "type": "object", - "properties": { - "accountTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "prefixTypeOptions": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - } - } - } - }, - "PutAccountNumberFormatsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "changes": { - "$ref": "#/definitions/PutAccountNumberFormatschangesSwagger" - } - } - }, - "PutAccountNumberFormatschangesSwagger": { - "type": "object", - "properties": { - "prefixType": { - "type": "integer", - "format": "int64", - "example": "OFFICE_NAME" - } - } - }, - "PutAccountNumberFormatsRequest": { - "type": "object", - "properties": { - "prefixType": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "DeleteAccountNumberFormatsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 2 - } - } - }, - "PostAccountNumberFormatsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PostAccountNumberFormatsRequest": { - "type": "object", - "properties": { - "accountType": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "prefixType": { - "type": "integer", - "format": "int64", - "example": 101 - } - } - }, - "PutCachechangesSwagger": { - "type": "object", - "properties": { - "cacheType": { - "type": "integer", - "format": "int64", - "example": 2 - } - } - }, - "PutCachesResponse": { - "type": "object", - "properties": { - "cacheType": { - "$ref": "#/definitions/PutCachechangesSwagger" - } - } - }, - "PutCachesRequest": { - "type": "object", - "properties": { - "cacheType": { - "type": "integer", - "format": "int64", - "example": 2 - } - } - }, - "GetCachesResponse": { - "type": "object", - "properties": { - "cacheType": { - "$ref": "#/definitions/EnumOptionData" - }, - "enabled": { - "type": "boolean" - } - } - }, - "CommandWrapper": { - "type": "object", - "properties": { - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "entityName": { - "type": "string" - }, - "taskPermissionName": { - "type": "string" - }, - "entityId": { - "type": "integer", - "format": "int64" - }, - "subentityId": { - "type": "integer", - "format": "int64" - }, - "href": { - "type": "string" - }, - "json": { - "type": "string" - }, - "transactionId": { - "type": "string" - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "creditBureauId": { - "type": "integer", - "format": "int64" - }, - "organisationCreditBureauId": { - "type": "integer", - "format": "int64" - }, - "create": { - "type": "boolean" - }, - "createDatatable": { - "type": "boolean" - }, - "deleteDatatable": { - "type": "boolean" - }, - "updateDatatable": { - "type": "boolean" - }, - "datatableResource": { - "type": "boolean" - }, - "deleteOneToOne": { - "type": "boolean" - }, - "deleteMultiple": { - "type": "boolean" - }, - "updateOneToOne": { - "type": "boolean" - }, - "updateMultiple": { - "type": "boolean" - }, - "registerDatatable": { - "type": "boolean" - }, - "noteResource": { - "type": "boolean" - }, - "update": { - "type": "boolean" - }, - "cacheResource": { - "type": "boolean" - }, - "updateOperation": { - "type": "boolean" - }, - "delete": { - "type": "boolean" - }, - "deleteOperation": { - "type": "boolean" - }, - "surveyResource": { - "type": "boolean" - }, - "registerSurvey": { - "type": "boolean" - }, - "fullFilSurvey": { - "type": "boolean" - }, - "workingDaysResource": { - "type": "boolean" - }, - "passwordPreferencesResource": { - "type": "boolean" - }, - "permissionResource": { - "type": "boolean" - }, - "userResource": { - "type": "boolean" - }, - "currencyResource": { - "type": "boolean" - }, - "loanDisburseDetailResource": { - "type": "boolean" - }, - "updateDisbursementDate": { - "type": "boolean" - } - } - }, - "PostCodeValueDataResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PostCodeValuesDataRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Passport" - }, - "description": { - "type": "string", - "example": "Passport information" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "DeleteCodeValueDataResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PutCodeValueDataResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - }, - "changes": { - "$ref": "#/definitions/PutCodeValuechangesSwagger" - } - } - }, - "PutCodeValuechangesSwagger": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Passport" - }, - "description": { - "type": "string", - "example": "Passport information" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "PutCodeValuesDataRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Passport" - }, - "description": { - "type": "string", - "example": "Passport information" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetCodeValuesDataResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passport" - }, - "description": { - "type": "string", - "example": "Passport information" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetCodesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Education" - }, - "systemDefined": { - "type": "boolean", - "example": true - } - } - }, - "PostCodesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PostCodesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "MyNewCode" - } - } - }, - "PutCodesApichangesSwagger": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "MyNewCode(changed)" - } - } - }, - "PutCodesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - }, - "changes": { - "$ref": "#/definitions/PutCodesApichangesSwagger" - } - } - }, - "PutCodesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "MyNewCode(changed)" - } - } - }, - "DeleteCodesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PutExternalServiceRequest": { - "type": "object", - "properties": { - "username": { - "type": "string", - "example": "test@mifos.org" - }, - "password": { - "type": "string", - "example": "XXXX" - } - } - }, - "ExternalServicesPropertiesData": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "PutGlobalConfigurationsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - }, - "changes": { - "$ref": "#/definitions/PutGlobalConfigurationsResponsechangesSwagger" - } - } - }, - "PutGlobalConfigurationsResponsechangesSwagger": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "example": true - } - } - }, - "PutGlobalConfigurationsRequest": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "example": true - }, - "value": { - "type": "integer", - "format": "int64", - "example": 2 - } - } - }, - "GetGlobalConfigurationsResponse": { - "type": "object", - "properties": { - "globalConfiguration": { - "type": "array", - "items": { - "$ref": "#/definitions/GlobalConfigurationPropertyData" - } - } - } - }, - "GlobalConfigurationPropertyData": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "value": { - "type": "integer", - "format": "int64" - }, - "dateValue": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "description": { - "type": "string" - }, - "trapDoor": { - "type": "boolean" - } - } - }, - "GetDataTablesResponse": { - "type": "object", - "properties": { - "appTableName": { - "type": "string", - "example": "m_client" - }, - "datatableName": { - "type": "string", - "example": "extra_client_details" - }, - "column": { - "type": "array", - "items": { - "$ref": "#/definitions/ResultsetColumnHeaderData" - } - } - } - }, - "ResultsetColumnHeaderData": { - "type": "object", - "properties": { - "columnName": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "columnLength": { - "type": "integer", - "format": "int64" - }, - "columnDisplayType": { - "type": "string" - }, - "columnCode": { - "type": "string" - }, - "dateDisplayType": { - "type": "boolean" - }, - "dateTimeDisplayType": { - "type": "boolean" - }, - "integerDisplayType": { - "type": "boolean" - }, - "decimalDisplayType": { - "type": "boolean" - }, - "booleanDisplayType": { - "type": "boolean" - }, - "codeValueDisplayType": { - "type": "boolean" - }, - "codeLookupDisplayType": { - "type": "boolean" - }, - "string": { - "type": "boolean" - }, - "mandatory": { - "type": "boolean" - }, - "optional": { - "type": "boolean" - } - } - }, - "PutDataTablesResponse": { - "type": "object", - "properties": { - "resourceIdentifier": { - "type": "string", - "example": "extra_client_details" - } - } - }, - "PostDataTablesRegisterDatatableAppTable": { - "type": "object" - }, - "PutDataTablesRequest": { - "type": "object", - "properties": { - "appTableName": { - "type": "string", - "example": "m_client" - }, - "dropColumns": { - "type": "array", - "items": { - "$ref": "#/definitions/PutDataTablesRequestDropColumns" - } - }, - "addColumns": { - "type": "array", - "items": { - "$ref": "#/definitions/PutDataTablesRequestAddColumns" - } - }, - "ChangeColumns": { - "type": "array", - "items": { - "$ref": "#/definitions/PutDataTablesRequestChangeColumns" - } - } - } - }, - "PutDataTablesRequestAddColumns": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Question" - }, - "type": { - "type": "string", - "example": "Dropdown" - }, - "code": { - "type": "string", - "example": "Gender" - }, - "mandatory": { - "type": "boolean", - "example": true - } - } - }, - "PutDataTablesRequestChangeColumns": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Question" - }, - "newName": { - "type": "string", - "example": "Question 2" - }, - "code": { - "type": "string", - "example": "Gender" - }, - "newCode": { - "type": "string", - "example": "Gender2" - }, - "mandatory": { - "type": "boolean", - "example": true - } - } - }, - "PutDataTablesRequestDropColumns": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Gender_cd_Question" - } - } - }, - "PostDataTablesAppTableIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostDataTablesAppTableIdRequest": { - "type": "object", - "properties": { - "BusinessDescription": { - "type": "string", - "example": "Livestock sales" - }, - "Comment": { - "type": "string", - "example": "First comment made" - }, - "Education_cv": { - "type": "string", - "example": "Primary" - }, - "Gender_cd": { - "type": "integer", - "format": "int64", - "example": 6 - }, - "HighestRatePaid": { - "type": "number", - "format": "double", - "example": 8.5 - }, - "NextVisit": { - "type": "string", - "example": "01 October 2012" - }, - "YearsinBusiness": { - "type": "integer", - "format": "int64", - "example": 5 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutDataTablesAppTableIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutDataTablesAppTableIdResponseChanges" - } - } - }, - "PutDataTablesAppTableIdResponseChanges": { - "type": "object", - "properties": { - "BusinessDescription": { - "type": "string", - "example": "Livestock sales updated" - } - } - }, - "PutDataTablesAppTableIdRequest": { - "type": "object", - "properties": { - "BusinessDescription": { - "type": "string", - "example": "Livestock sales updated" - } - } - }, - "PutDataTablesAppTableIdDatatableIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PutDataTablesAppTableIdDatatableIdRequest": { - "type": "object", - "properties": { - "DateOfBirth": { - "type": "string", - "example": "01 June 1982" - }, - "Education_cdHighest": { - "type": "integer", - "format": "int64", - "example": 5 - }, - "Name": { - "type": "string", - "example": "June" - }, - "OtherNotes": { - "type": "string", - "example": "More notes" - }, - "PointsScore": { - "type": "integer", - "format": "int64", - "example": 20 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "DeleteDataTablesDatatableAppTableIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "DeleteDataTablesDatatableAppTableIdDatatableIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetDataTablesAppTableIdResponse": { - "type": "object", - "properties": { - "columnHeaders": { - "type": "array", - "items": { - "$ref": "#/definitions/ResultsetColumnHeaderData" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/ResultsetRowData" - } - } - } - }, - "ResultsetRowData": { - "type": "object", - "properties": { - "row": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "DeleteDataTablesResponse": { - "type": "object", - "properties": { - "resourceIdentifier": { - "type": "string", - "example": "extra_client_details" - } - } - }, - "PostDataTablesResponse": { - "type": "object", - "properties": { - "resourceIdentifier": { - "type": "string", - "example": "extra_client_details" - } - } - }, - "PostDataTablesRequest": { - "type": "object", - "properties": { - "applicationTableName": { - "type": "string", - "example": "m_client" - }, - "registeredTableName": { - "type": "string", - "example": "extra_client_details" - }, - "multiRow": { - "type": "boolean", - "example": true - }, - "columnHeaderData": { - "type": "array", - "items": { - "$ref": "#/definitions/ResultsetColumnHeaderData" - } - } - } - }, - "DeleteEntityDatatableChecksTemplateResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostEntityDatatableChecksTemplateResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostEntityDatatableChecksTemplateRequest": { - "type": "object", - "properties": { - "entity": { - "type": "string", - "example": "m_loan" - }, - "status": { - "type": "integer", - "format": "int64", - "example": 100 - }, - "datatableName": { - "type": "string", - "example": "Additional Details" - }, - "productId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetEntityDatatableChecksResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "entity": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/EnumOptionData" - }, - "datatableName": { - "type": "string" - }, - "systemDefined": { - "type": "boolean" - }, - "order": { - "type": "integer", - "format": "int64" - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "productName": { - "type": "string" - } - } - }, - "AppUser": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "email": { - "type": "string" - }, - "username": { - "type": "string" - }, - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "password": { - "type": "string" - }, - "accountNonExpired": { - "type": "boolean" - }, - "accountNonLocked": { - "type": "boolean" - }, - "credentialsNonExpired": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" - }, - "deleted": { - "type": "boolean" - }, - "office": { - "$ref": "#/definitions/Office" - }, - "staff": { - "$ref": "#/definitions/Staff" - }, - "roles": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/Role" - } - }, - "lastTimePasswordUpdated": { - "type": "string", - "format": "date-time" - }, - "passwordNeverExpires": { - "type": "boolean" - }, - "appUserClientMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/AppUserClientMapping" - } - }, - "selfServiceUser": { - "type": "boolean" - }, - "staffId": { - "type": "integer", - "format": "int64" - }, - "staffDisplayName": { - "type": "string" - }, - "notEnabled": { - "type": "boolean" - }, - "authorities": { - "type": "array", - "items": { - "$ref": "#/definitions/GrantedAuthority" - } - }, - "new": { - "type": "boolean" - } - } - }, - "AppUserClientMapping": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "client": { - "$ref": "#/definitions/Client" - }, - "new": { - "type": "boolean" - } - } - }, - "Charge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "amount": { - "type": "number" - }, - "currencyCode": { - "type": "string" - }, - "chargeTimeType": { - "type": "integer", - "format": "int32" - }, - "chargeCalculation": { - "type": "integer", - "format": "int32" - }, - "chargePaymentMode": { - "type": "integer", - "format": "int32" - }, - "feeInterval": { - "type": "integer", - "format": "int32" - }, - "penalty": { - "type": "boolean" - }, - "active": { - "type": "boolean" - }, - "deleted": { - "type": "boolean" - }, - "minCap": { - "type": "number" - }, - "maxCap": { - "type": "number" - }, - "account": { - "$ref": "#/definitions/GLAccount" - }, - "taxGroup": { - "$ref": "#/definitions/TaxGroup" - }, - "savingsCharge": { - "type": "boolean" - }, - "feeOnMonthDay": { - "$ref": "#/definitions/MonthDay" - }, - "annualFee": { - "type": "boolean" - }, - "monthlyFee": { - "type": "boolean" - }, - "overdueInstallment": { - "type": "boolean" - }, - "allowedLoanChargeTime": { - "type": "boolean" - }, - "allowedClientChargeTime": { - "type": "boolean" - }, - "allowedSavingsChargeTime": { - "type": "boolean" - }, - "loanCharge": { - "type": "boolean" - }, - "clientCharge": { - "type": "boolean" - }, - "allowedSavingsChargeCalculationType": { - "type": "boolean" - }, - "allowedClientChargeCalculationType": { - "type": "boolean" - }, - "percentageOfApprovedAmount": { - "type": "boolean" - }, - "percentageOfDisbursementAmount": { - "type": "boolean" - }, - "disbursementCharge": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "ChargeData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "penalty": { - "type": "boolean" - }, - "currency": { - "$ref": "#/definitions/CurrencyData" - }, - "overdueInstallmentCharge": { - "type": "boolean" - } - } - }, - "Chronology": { - "type": "object", - "properties": { - "zone": { - "$ref": "#/definitions/DateTimeZone" - } - } - }, - "Client": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "office": { - "$ref": "#/definitions/Office" - }, - "transferToOffice": { - "$ref": "#/definitions/Office" - }, - "image": { - "$ref": "#/definitions/Image" - }, - "status": { - "type": "integer", - "format": "int32" - }, - "firstname": { - "type": "string" - }, - "middlename": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "externalId": { - "type": "string" - }, - "staff": { - "$ref": "#/definitions/Staff" - }, - "groups": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/Group" - } - }, - "accountNumberRequiresAutoGeneration": { - "type": "boolean" - }, - "closureDate": { - "type": "string", - "format": "date" - }, - "withdrawalDate": { - "type": "string", - "format": "date" - }, - "submittedOnDate": { - "type": "string", - "format": "date" - }, - "legalForm": { - "type": "integer", - "format": "int32" - }, - "reopenedDate": { - "type": "string", - "format": "date" - }, - "proposedTransferDate": { - "type": "string", - "format": "date-time" - }, - "notActive": { - "type": "boolean" - }, - "transferOnHold": { - "type": "boolean" - }, - "transferInProgress": { - "type": "boolean" - }, - "activationLocalDate": { - "type": "string", - "format": "date" - }, - "officeJoiningLocalDate": { - "type": "string", - "format": "date" - }, - "withdrawn": { - "type": "boolean" - }, - "notPending": { - "type": "boolean" - }, - "transferInProgressOrOnHold": { - "type": "boolean" - }, - "notStaff": { - "type": "boolean" - }, - "rejectedDate": { - "type": "string", - "format": "date" - }, - "active": { - "type": "boolean" - }, - "rejected": { - "type": "boolean" - }, - "pending": { - "type": "boolean" - }, - "closed": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "CurrencyData": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "DatatableCheckStatusData": { - "type": "object" - }, - "DatatableChecksData": { - "type": "object" - }, - "DateTimeField": { - "type": "object", - "properties": { - "durationField": { - "$ref": "#/definitions/DurationField" - }, - "rangeDurationField": { - "$ref": "#/definitions/DurationField" - }, - "leapDurationField": { - "$ref": "#/definitions/DurationField" - }, - "minimumValue": { - "type": "integer", - "format": "int32" - }, - "maximumValue": { - "type": "integer", - "format": "int32" - }, - "lenient": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/DateTimeFieldType" - }, - "supported": { - "type": "boolean" - } - } - }, - "DateTimeFieldType": { - "type": "object", - "properties": { - "rangeDurationType": { - "$ref": "#/definitions/DurationFieldType" - }, - "durationType": { - "$ref": "#/definitions/DurationFieldType" - }, - "name": { - "type": "string" - } - } - }, - "DateTimeZone": { - "type": "object", - "properties": { - "fixed": { - "type": "boolean" - }, - "id": { - "type": "string" - } - } - }, - "DurationField": { - "type": "object", - "properties": { - "precise": { - "type": "boolean" - }, - "unitMillis": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/DurationFieldType" - }, - "supported": { - "type": "boolean" - } - } - }, - "DurationFieldType": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "FloatingRate": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "floatingRatePeriods": { - "type": "array", - "items": { - "$ref": "#/definitions/FloatingRatePeriod" - } - }, - "createdBy": { - "$ref": "#/definitions/AppUser" - }, - "modifiedBy": { - "$ref": "#/definitions/AppUser" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "modifiedOn": { - "type": "string", - "format": "date-time" - }, - "baseLendingRate": { - "type": "boolean" - }, - "active": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "FloatingRatePeriod": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "fromDate": { - "type": "string", - "format": "date-time" - }, - "interestRate": { - "type": "number" - }, - "createdBy": { - "$ref": "#/definitions/AppUser" - }, - "modifiedBy": { - "$ref": "#/definitions/AppUser" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "modifiedOn": { - "type": "string", - "format": "date-time" - }, - "differentialToBaseLendingRate": { - "type": "boolean" - }, - "floatingRatesId": { - "$ref": "#/definitions/FloatingRate" - }, - "active": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "FundData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - } - } - }, - "GLAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/GLAccount" - } - }, - "name": { - "type": "string" - }, - "glCode": { - "type": "string" - }, - "disabled": { - "type": "boolean" - }, - "manualEntriesAllowed": { - "type": "boolean" - }, - "type": { - "type": "integer", - "format": "int32" - }, - "usage": { - "type": "integer", - "format": "int32" - }, - "headerAccount": { - "type": "boolean" - }, - "detailAccount": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "GetEntityDatatableChecksTemplateResponse": { - "type": "object", - "properties": { - "entities": { - "type": "array", - "items": { - "type": "string" - } - }, - "statusClient": { - "type": "array", - "items": { - "$ref": "#/definitions/DatatableCheckStatusData" - } - }, - "statusGroup": { - "type": "array", - "items": { - "$ref": "#/definitions/DatatableCheckStatusData" - } - }, - "statusSavings": { - "type": "array", - "items": { - "$ref": "#/definitions/DatatableCheckStatusData" - } - }, - "statusLoans": { - "type": "array", - "items": { - "$ref": "#/definitions/DatatableCheckStatusData" - } - }, - "datatables": { - "type": "array", - "items": { - "$ref": "#/definitions/DatatableChecksData" - } - }, - "loanProductDatas": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductData" - } - }, - "savingsProductDatas": { - "type": "array", - "items": { - "$ref": "#/definitions/SavingsProductData" - } - } - } - }, - "GrantedAuthority": { - "type": "object", - "properties": { - "authority": { - "type": "string" - } - } - }, - "Group": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "office": { - "$ref": "#/definitions/Office" - }, - "staff": { - "$ref": "#/definitions/Staff" - }, - "parent": { - "$ref": "#/definitions/Group" - }, - "groupLevel": { - "$ref": "#/definitions/GroupLevel" - }, - "clientMembers": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/Client" - } - }, - "submittedOnDate": { - "type": "string", - "format": "date" - }, - "accountNumberRequiresAutoGeneration": { - "type": "boolean" - }, - "notActive": { - "type": "boolean" - }, - "center": { - "type": "boolean" - }, - "group": { - "type": "boolean" - }, - "transferOnHold": { - "type": "boolean" - }, - "transferInProgress": { - "type": "boolean" - }, - "activationLocalDate": { - "type": "string", - "format": "date" - }, - "notPending": { - "type": "boolean" - }, - "transferInProgressOrOnHold": { - "type": "boolean" - }, - "childGroup": { - "type": "boolean" - }, - "activeClientMembers": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/Client" - } - }, - "active": { - "type": "boolean" - }, - "pending": { - "type": "boolean" - }, - "closed": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "GroupLevel": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "parentId": { - "type": "integer", - "format": "int64" - }, - "superParent": { - "type": "boolean" - }, - "levelName": { - "type": "string" - }, - "recursable": { - "type": "boolean" - }, - "center": { - "type": "boolean" - }, - "group": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "Image": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "location": { - "type": "string" - }, - "storageType": { - "type": "integer", - "format": "int32" - }, - "new": { - "type": "boolean" - } - } - }, - "LoanProduct": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "shortName": { - "type": "string" - }, - "loanProductRelatedDetail": { - "$ref": "#/definitions/LoanProductRelatedDetail" - }, - "includeInBorrowerCycle": { - "type": "boolean" - }, - "startDate": { - "type": "string", - "format": "date" - }, - "closeDate": { - "type": "string", - "format": "date" - }, - "externalId": { - "type": "string" - }, - "minimumDaysBetweenDisbursalAndFirstRepayment": { - "type": "integer", - "format": "int32" - }, - "productInterestRecalculationDetails": { - "$ref": "#/definitions/LoanProductInterestRecalculationDetails" - }, - "loanProductGuaranteeDetails": { - "$ref": "#/definitions/LoanProductGuaranteeDetails" - }, - "principalThresholdForLastInstallment": { - "type": "number" - }, - "installmentAmountInMultiplesOf": { - "type": "integer", - "format": "int32" - }, - "floatingRates": { - "$ref": "#/definitions/LoanProductFloatingRates" - }, - "accountingType": { - "type": "integer", - "format": "int32" - }, - "cashBasedAccountingEnabled": { - "type": "boolean" - }, - "accrualBasedAccountingEnabled": { - "type": "boolean" - }, - "linkedToFloatingInterestRate": { - "type": "boolean" - }, - "equalAmortization": { - "type": "boolean" - }, - "interestRecalculationEnabled": { - "type": "boolean" - }, - "repaymentStrategy": { - "$ref": "#/definitions/LoanTransactionProcessingStrategy" - }, - "loanProductCharges": { - "type": "array", - "items": { - "$ref": "#/definitions/Charge" - } - }, - "loanProductConfigurableAttributes": { - "$ref": "#/definitions/LoanProductConfigurableAttributes" - }, - "accountingDisabled": { - "type": "boolean" - }, - "upfrontAccrualAccountingEnabled": { - "type": "boolean" - }, - "periodicAccrualAccountingEnabled": { - "type": "boolean" - }, - "principalAmount": { - "$ref": "#/definitions/Money" - }, - "minPrincipalAmount": { - "$ref": "#/definitions/Money" - }, - "maxPrincipalAmount": { - "$ref": "#/definitions/Money" - }, - "nominalInterestRatePerPeriod": { - "type": "number" - }, - "interestPeriodFrequencyType": { - "type": "string", - "enum": [ - "DAYS", - "WEEKS", - "MONTHS", - "YEARS", - "WHOLE_TERM", - "INVALID" - ] - }, - "minNominalInterestRatePerPeriod": { - "type": "number" - }, - "maxNominalInterestRatePerPeriod": { - "type": "number" - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "minNumberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "maxNumberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "multiDisburseLoan": { - "type": "boolean" - }, - "holdGuaranteeFundsEnabled": { - "type": "boolean" - }, - "arrearsBasedOnOriginalSchedule": { - "type": "boolean" - }, - "currency": { - "$ref": "#/definitions/MonetaryCurrency" - }, - "new": { - "type": "boolean" - } - } - }, - "LoanProductBorrowerCycleVariationData": { - "type": "object", - "properties": { - "borrowerCycleNumber": { - "type": "integer", - "format": "int32" - }, - "paramType": { - "type": "string", - "enum": [ - "INVALID", - "PRINCIPAL", - "INTERESTRATE", - "REPAYMENT" - ] - }, - "valueConditionType": { - "type": "string", - "enum": [ - "INVALID", - "EQUAL", - "GREATERTHAN" - ] - }, - "defaultValue": { - "type": "number" - } - } - }, - "LoanProductConfigurableAttributes": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "loanProduct": { - "$ref": "#/definitions/LoanProduct" - }, - "amortizationBoolean": { - "type": "boolean" - }, - "interestMethodBoolean": { - "type": "boolean" - }, - "transactionProcessingStrategyBoolean": { - "type": "boolean" - }, - "interestCalcPeriodBoolean": { - "type": "boolean" - }, - "arrearsToleranceBoolean": { - "type": "boolean" - }, - "repaymentEveryBoolean": { - "type": "boolean" - }, - "graceOnPrincipalAndInterestPaymentBoolean": { - "type": "boolean" - }, - "graceOnArrearsAgingBoolean": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "LoanProductData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "fundId": { - "type": "integer", - "format": "int64" - }, - "fundName": { - "type": "string" - }, - "startDate": { - "type": "string", - "format": "date" - }, - "closeDate": { - "type": "string", - "format": "date" - }, - "currency": { - "$ref": "#/definitions/CurrencyData" - }, - "principal": { - "type": "number" - }, - "minPrincipal": { - "type": "number" - }, - "maxPrincipal": { - "type": "number" - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "minNumberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "maxNumberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "repaymentEvery": { - "type": "integer", - "format": "int32" - }, - "repaymentFrequencyType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestRatePerPeriod": { - "type": "number" - }, - "minInterestRatePerPeriod": { - "type": "number" - }, - "maxInterestRatePerPeriod": { - "type": "number" - }, - "interestRateFrequencyType": { - "$ref": "#/definitions/EnumOptionData" - }, - "annualInterestRate": { - "type": "number" - }, - "interestRateDifferential": { - "type": "number" - }, - "minDifferentialLendingRate": { - "type": "number" - }, - "defaultDifferentialLendingRate": { - "type": "number" - }, - "maxDifferentialLendingRate": { - "type": "number" - }, - "amortizationType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestCalculationPeriodType": { - "$ref": "#/definitions/EnumOptionData" - }, - "allowPartialPeriodInterestCalcualtion": { - "type": "boolean" - }, - "inArrearsTolerance": { - "type": "number" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int64" - }, - "transactionProcessingStrategyName": { - "type": "string" - }, - "graceOnPrincipalPayment": { - "type": "integer", - "format": "int32" - }, - "recurringMoratoriumOnPrincipalPeriods": { - "type": "integer", - "format": "int32" - }, - "graceOnInterestPayment": { - "type": "integer", - "format": "int32" - }, - "graceOnInterestCharged": { - "type": "integer", - "format": "int32" - }, - "graceOnArrearsAgeing": { - "type": "integer", - "format": "int32" - }, - "daysInMonthType": { - "$ref": "#/definitions/EnumOptionData" - }, - "daysInYearType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestRecalculationData": { - "$ref": "#/definitions/LoanProductInterestRecalculationData" - }, - "principalVariationsForBorrowerCycle": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductBorrowerCycleVariationData" - } - }, - "interestRateVariationsForBorrowerCycle": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductBorrowerCycleVariationData" - } - }, - "numberOfRepaymentVariationsForBorrowerCycle": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductBorrowerCycleVariationData" - } - }, - "fundOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/FundData" - } - }, - "repaymentFrequencyTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "interestRateFrequencyTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "amortizationTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "interestTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "interestCalculationPeriodTypeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "chargeOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/ChargeData" - } - }, - "multiDisburseLoan": { - "type": "boolean" - }, - "outstandingLoanBalance": { - "type": "number" - }, - "minimumGapBetweenInstallments": { - "type": "integer", - "format": "int32" - }, - "maximumGapBetweenInstallments": { - "type": "integer", - "format": "int32" - }, - "getloanProductConfigurableAttributes": { - "$ref": "#/definitions/LoanProductConfigurableAttributes" - }, - "equalAmortization": { - "type": "boolean" - }, - "floatingInterestRateCalculationAllowed": { - "type": "boolean" - }, - "linkedToFloatingInterestRates": { - "type": "boolean" - }, - "variableInstallmentsAllowed": { - "type": "boolean" - }, - "interestRecalculationEnabled": { - "type": "boolean" - }, - "compoundingToBePostedAsTransaction": { - "type": "boolean" - } - } - }, - "LoanProductFloatingRates": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "loanProduct": { - "$ref": "#/definitions/LoanProduct" - }, - "floatingRate": { - "$ref": "#/definitions/FloatingRate" - }, - "interestRateDifferential": { - "type": "number" - }, - "minDifferentialLendingRate": { - "type": "number" - }, - "defaultDifferentialLendingRate": { - "type": "number" - }, - "maxDifferentialLendingRate": { - "type": "number" - }, - "floatingInterestRateCalculationAllowed": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "LoanProductGuaranteeDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "mandatoryGuarantee": { - "type": "number" - }, - "minimumGuaranteeFromOwnFunds": { - "type": "number" - }, - "minimumGuaranteeFromGuarantor": { - "type": "number" - }, - "new": { - "type": "boolean" - } - } - }, - "LoanProductInterestRecalculationData": { - "type": "object", - "properties": { - "interestRecalculationCompoundingType": { - "$ref": "#/definitions/EnumOptionData" - }, - "rescheduleStrategyType": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationRestFrequencyType": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationRestFrequencyInterval": { - "type": "integer", - "format": "int32" - }, - "recalculationRestFrequencyNthDay": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationRestFrequencyWeekday": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationRestFrequencyOnDay": { - "type": "integer", - "format": "int32" - }, - "recalculationCompoundingFrequencyType": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationCompoundingFrequencyInterval": { - "type": "integer", - "format": "int32" - }, - "recalculationCompoundingFrequencyNthDay": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationCompoundingFrequencyWeekday": { - "$ref": "#/definitions/EnumOptionData" - }, - "recalculationCompoundingFrequencyOnDay": { - "type": "integer", - "format": "int32" - }, - "compoundingToBePostedAsTransaction": { - "type": "boolean" - } - } - }, - "LoanProductInterestRecalculationDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "interestRecalculationCompoundingMethod": { - "type": "integer", - "format": "int32" - }, - "rescheduleStrategyMethod": { - "type": "integer", - "format": "int32" - }, - "restFrequencyType": { - "type": "string", - "enum": [ - "INVALID", - "SAME_AS_REPAYMENT_PERIOD", - "DAILY", - "WEEKLY", - "MONTHLY" - ] - }, - "restInterval": { - "type": "integer", - "format": "int32" - }, - "restFrequencyNthDay": { - "type": "integer", - "format": "int32" - }, - "restFrequencyWeekday": { - "type": "integer", - "format": "int32" - }, - "restFrequencyOnDay": { - "type": "integer", - "format": "int32" - }, - "compoundingFrequencyType": { - "type": "string", - "enum": [ - "INVALID", - "SAME_AS_REPAYMENT_PERIOD", - "DAILY", - "WEEKLY", - "MONTHLY" - ] - }, - "compoundingInterval": { - "type": "integer", - "format": "int32" - }, - "compoundingFrequencyNthDay": { - "type": "integer", - "format": "int32" - }, - "compoundingFrequencyWeekday": { - "type": "integer", - "format": "int32" - }, - "compoundingFrequencyOnDay": { - "type": "integer", - "format": "int32" - }, - "isCompoundingToBePostedAsTransaction": { - "type": "boolean" - }, - "arrearsBasedOnOriginalSchedule": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "LoanProductRelatedDetail": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/MonetaryCurrency" - }, - "principal": { - "$ref": "#/definitions/Money" - }, - "nominalInterestRatePerPeriod": { - "type": "number" - }, - "interestPeriodFrequencyType": { - "type": "string", - "enum": [ - "DAYS", - "WEEKS", - "MONTHS", - "YEARS", - "WHOLE_TERM", - "INVALID" - ] - }, - "annualNominalInterestRate": { - "type": "number" - }, - "interestMethod": { - "type": "string", - "enum": [ - "DECLINING_BALANCE", - "FLAT", - "INVALID" - ] - }, - "interestCalculationPeriodMethod": { - "type": "string", - "enum": [ - "DAILY", - "SAME_AS_REPAYMENT_PERIOD", - "INVALID" - ] - }, - "allowPartialPeriodInterestCalcualtion": { - "type": "boolean" - }, - "repayEvery": { - "type": "integer", - "format": "int32" - }, - "repaymentPeriodFrequencyType": { - "type": "string", - "enum": [ - "DAYS", - "WEEKS", - "MONTHS", - "YEARS", - "WHOLE_TERM", - "INVALID" - ] - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32" - }, - "graceOnPrincipalPayment": { - "type": "integer", - "format": "int32" - }, - "graceOnInterestPayment": { - "type": "integer", - "format": "int32" - }, - "amortizationMethod": { - "type": "string", - "enum": [ - "EQUAL_PRINCIPAL", - "EQUAL_INSTALLMENTS", - "INVALID" - ] - }, - "inArrearsTolerance": { - "$ref": "#/definitions/Money" - }, - "graceOnArrearsAgeing": { - "type": "integer", - "format": "int32" - }, - "equalAmortization": { - "type": "boolean" - }, - "graceOnDueDate": { - "type": "integer", - "format": "int32" - }, - "arrearsTolerance": { - "type": "number" - }, - "interestRecalculationEnabled": { - "type": "boolean" - } - } - }, - "LoanTransactionProcessingStrategy": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "standardStrategy": { - "type": "boolean" - }, - "heavensfamilyStrategy": { - "type": "boolean" - }, - "earlyPaymentStrategy": { - "type": "boolean" - }, - "creocoreStrategy": { - "type": "boolean" - }, - "indianRBIStrategy": { - "type": "boolean" - }, - "principalInterestPenaltiesFeesOrderStrategy": { - "type": "boolean" - }, - "interestPrincipalPenaltiesFeesOrderStrategy": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "MonetaryCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32" - }, - "currencyInMultiplesOf": { - "type": "integer", - "format": "int32" - } - } - }, - "Money": { - "type": "object", - "properties": { - "currencyCode": { - "type": "string" - }, - "currencyDigitsAfterDecimal": { - "type": "integer", - "format": "int32" - }, - "amount": { - "type": "number" - }, - "currencyInMultiplesOf": { - "type": "integer", - "format": "int32" - }, - "greaterThanZero": { - "type": "boolean" - }, - "lessThanZero": { - "type": "boolean" - }, - "amountDefaultedToNullIfZero": { - "type": "number" - }, - "zero": { - "type": "boolean" - }, - "currency": { - "$ref": "#/definitions/MonetaryCurrency" - } - } - }, - "MonthDay": { - "type": "object", - "properties": { - "fieldTypes": { - "type": "array", - "items": { - "$ref": "#/definitions/DateTimeFieldType" - } - }, - "monthOfYear": { - "type": "integer", - "format": "int32" - }, - "dayOfMonth": { - "type": "integer", - "format": "int32" - }, - "chronology": { - "$ref": "#/definitions/Chronology" - }, - "values": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/definitions/DateTimeField" - } - } - } - }, - "Office": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "parent": { - "$ref": "#/definitions/Office" - }, - "name": { - "type": "string" - }, - "hierarchy": { - "type": "string" - }, - "openingLocalDate": { - "type": "string", - "format": "date" - }, - "new": { - "type": "boolean" - } - } - }, - "Permission": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "grouping": { - "type": "string" - }, - "code": { - "type": "string" - }, - "new": { - "type": "boolean" - } - } - }, - "Role": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "disabled": { - "type": "boolean" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/Permission" - } - }, - "enabled": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "SavingsProductData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "currency": { - "$ref": "#/definitions/CurrencyData" - }, - "nominalAnnualInterestRate": { - "type": "number" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestCalculationType": { - "$ref": "#/definitions/EnumOptionData" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/EnumOptionData" - }, - "minRequiredOpeningBalance": { - "type": "number" - }, - "lockinPeriodFrequency": { - "type": "integer", - "format": "int32" - }, - "lockinPeriodFrequencyType": { - "$ref": "#/definitions/EnumOptionData" - }, - "withdrawalFeeForTransfers": { - "type": "boolean" - }, - "allowOverdraft": { - "type": "boolean" - }, - "overdraftLimit": { - "type": "number" - }, - "minRequiredBalance": { - "type": "number" - }, - "depositAccountType": { - "type": "string" - } - } - }, - "Staff": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "loanOfficer": { - "type": "boolean" - }, - "active": { - "type": "boolean" - }, - "image": { - "$ref": "#/definitions/Image" - }, - "notLoanOfficer": { - "type": "boolean" - }, - "notActive": { - "type": "boolean" - }, - "new": { - "type": "boolean" - } - } - }, - "TaxComponent": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "$ref": "#/definitions/AppUser" - }, - "createdDate": { - "type": "integer", - "format": "int64" - }, - "lastModifiedBy": { - "$ref": "#/definitions/AppUser" - }, - "lastModifiedDate": { - "type": "integer", - "format": "int64" - }, - "percentage": { - "type": "number" - }, - "debitAccountType": { - "type": "integer", - "format": "int32" - }, - "debitAcount": { - "$ref": "#/definitions/GLAccount" - }, - "creditAccountType": { - "type": "integer", - "format": "int32" - }, - "creditAcount": { - "$ref": "#/definitions/GLAccount" - }, - "taxComponentHistories": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/TaxComponentHistory" - } - }, - "taxGroupMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/TaxGroupMappings" - } - }, - "new": { - "type": "boolean" - } - } - }, - "TaxComponentHistory": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "$ref": "#/definitions/AppUser" - }, - "createdDate": { - "type": "integer", - "format": "int64" - }, - "lastModifiedBy": { - "$ref": "#/definitions/AppUser" - }, - "lastModifiedDate": { - "type": "integer", - "format": "int64" - }, - "percentage": { - "type": "number" - }, - "new": { - "type": "boolean" - } - } - }, - "TaxGroup": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "$ref": "#/definitions/AppUser" - }, - "createdDate": { - "type": "integer", - "format": "int64" - }, - "lastModifiedBy": { - "$ref": "#/definitions/AppUser" - }, - "lastModifiedDate": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "taxGroupMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/TaxGroupMappings" - } - }, - "new": { - "type": "boolean" - } - } - }, - "TaxGroupMappings": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "$ref": "#/definitions/AppUser" - }, - "createdDate": { - "type": "integer", - "format": "int64" - }, - "lastModifiedBy": { - "$ref": "#/definitions/AppUser" - }, - "lastModifiedDate": { - "type": "integer", - "format": "int64" - }, - "taxComponent": { - "$ref": "#/definitions/TaxComponent" - }, - "endDate": { - "type": "string", - "format": "date-time" - }, - "new": { - "type": "boolean" - } - } - }, - "PutReportResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 132 - }, - "changes": { - "$ref": "#/definitions/PutReportResponseChanges" - } - } - }, - "PutReportResponseChanges": { - "type": "object", - "properties": { - "reportName": { - "type": "string", - "example": "Changed New Report" - }, - "reportParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportParameterData" - } - } - } - }, - "ReportParameterData": { - "type": "object" - }, - "PutReportRequest": { - "type": "object", - "properties": { - "reportName": { - "type": "string", - "example": "Completely New Report" - }, - "reportParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportParameterData" - } - } - } - }, - "GetReportsTemplateResponse": { - "type": "object", - "properties": { - "allowedReportTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "allowedReportSubTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "allowedParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportParameterData" - } - } - } - }, - "DeleteReportsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 132 - } - } - }, - "GetReportsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "reportName": { - "type": "string", - "example": "Client Listing" - }, - "reportType": { - "type": "string", - "example": "Table" - }, - "reportSubType": { - "type": "string" - }, - "reportCategory": { - "type": "string", - "example": "Client" - }, - "description": { - "type": "string", - "example": "Individual Client Report Lists the small number of defined fields on the client table. Would expect to copy this report and add any one to one additional data for specific tenant needs. Can be run for any size MFI but you expect it only to be run within a branch for larger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesnt have that client browser/memory impact)." - }, - "reportSql": { - "type": "string" - }, - "coreReport": { - "type": "boolean", - "example": true - }, - "useReport": { - "type": "boolean", - "example": true - }, - "reportParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportParameterData" - } - } - } - }, - "PostReportsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 132 - } - } - }, - "PostRepostRequest": { - "type": "object", - "properties": { - "reportName": { - "type": "string", - "example": "Completely New Report" - }, - "reportType": { - "type": "string", - "example": "Table" - }, - "reportSubType": { - "type": "string" - }, - "reportCategory": { - "type": "string", - "example": "Loan" - }, - "description": { - "type": "string", - "example": "Just An Example" - }, - "reportSql": { - "type": "string", - "example": "select 'very good sql' as AComment" - }, - "reportParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportParameterData" - } - } - } - }, - "GetReportNameResponse": { - "type": "object", - "properties": { - "columnHeaders": { - "$ref": "#/definitions/ResultsetColumnHeaderData" - }, - "row": { - "$ref": "#/definitions/ResultsetRowData" - } - } - }, - "GetEntityTypeEntityIdDocumentsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "parentEntityType": { - "type": "string", - "example": "clients" - }, - "parentEntityId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Client Details Form" - }, - "fileName": { - "type": "string", - "example": "CGAP.pdf" - }, - "size": { - "type": "integer", - "format": "int64", - "example": 5246719 - }, - "type": { - "type": "string", - "example": "application/pdf" - }, - "description": { - "type": "string", - "example": "A signed form signed by new member" - }, - "location": { - "type": "string" - }, - "storageType": { - "type": "integer", - "format": "int32" - } - } - }, - "PutEntityTypeEntityIdDocumentsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "changes": { - "$ref": "#/definitions/PutEntityTypeEntityIdDocumentsResponseChangesSwagger" - }, - "resourceIdentifier": { - "type": "string", - "example": "3" - } - } - }, - "PutEntityTypeEntityIdDocumentsResponseChangesSwagger": { - "type": "object" - }, - "DeleteEntityTypeEntityIdDocumentsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "changes": { - "$ref": "#/definitions/PutEntityTypeEntityIdDocumentsResponseChangesSwagger" - }, - "resourceIdentifier": { - "type": "string", - "example": "3" - } - } - }, - "PostEntityTypeEntityIdDocumentsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "resourceIdentifier": { - "type": "string", - "example": "3" - } - } - }, - "Event": { - "type": "object", - "properties": { - "actionName": { - "type": "string" - }, - "entityName": { - "type": "string" - } - } - }, - "Field": { - "type": "object", - "properties": { - "fieldName": { - "type": "string" - }, - "fieldValue": { - "type": "string" - }, - "fieldType": { - "type": "string" - } - } - }, - "PutHookResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - }, - "changes": { - "$ref": "#/definitions/PutHookResponseChangesSwagger" - } - } - }, - "PutHookResponseChangesSwagger": { - "type": "object", - "properties": { - "displayName": { - "type": "string", - "example": "Kremlin" - }, - "events": { - "type": "array", - "example": "1", - "items": { - "$ref": "#/definitions/Event" - } - }, - "config": { - "type": "array", - "items": { - "$ref": "#/definitions/Field" - } - } - } - }, - "PutHookRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Web" - }, - "isActive": { - "type": "boolean", - "example": true - }, - "displayName": { - "type": "string", - "example": "Kremlin" - }, - "templateId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - } - }, - "config": { - "type": "array", - "items": { - "$ref": "#/definitions/Field" - } - } - } - }, - "DeleteHookResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PostHookResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PostHookRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Web" - }, - "isActive": { - "type": "boolean", - "example": true - }, - "displayName": { - "type": "string", - "example": "Kremlin" - }, - "templateId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - } - }, - "config": { - "type": "array", - "items": { - "$ref": "#/definitions/Field" - } - } - } - }, - "GetHookResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Web" - }, - "displayName": { - "type": "string", - "example": "Kremlin" - }, - "isActive": { - "type": "boolean", - "example": true - }, - "createdAt": { - "type": "string", - "format": "date", - "example": "[2014, 9, 16]" - }, - "updatedAt": { - "type": "string", - "format": "date", - "example": "[2014, 9, 16]" - }, - "templateId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "templateName": { - "type": "string", - "example": "My UGD" - }, - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - } - }, - "config": { - "type": "array", - "items": { - "$ref": "#/definitions/Field" - } - } - } - }, - "GetHookTemplateResponse": { - "type": "object", - "properties": { - "templates": { - "type": "array", - "items": { - "$ref": "#/definitions/HookTemplateData" - } - }, - "groupings": { - "type": "array", - "items": { - "$ref": "#/definitions/Grouping" - } - } - } - }, - "Grouping": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "HookTemplateData": { - "type": "object", - "properties": { - "serviceId": { - "type": "integer", - "format": "int64" - } - } - }, - "GetSchedulerResponse": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "example": true - } - } - }, - "GetJobsJobIDJobRunHistoryResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "pageItems": { - "type": "array", - "items": { - "$ref": "#/definitions/JobDetailHistoryDataSwagger" - } - } - } - }, - "JobDetailHistoryDataSwagger": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "jobRunStartTime": { - "type": "string", - "format": "date-time", - "example": "Jul 16, 2013 12:00:00 PM" - }, - "jobRunEndTime": { - "type": "string", - "format": "date-time", - "example": "Jul 16, 2013 12:00:00 PM" - }, - "status": { - "type": "string", - "example": "success" - }, - "triggerType": { - "type": "string", - "example": "cron" - } - } - }, - "PutJobsJobsIDRequest": { - "type": "object", - "properties": { - "displayName": { - "type": "string", - "example": "Update loan Summary" - }, - "cronExpression": { - "type": "string", - "example": "0 0 22 1/1 * ? *" - }, - "active": { - "type": "boolean", - "example": false - } - } - }, - "GetJobsResponse": { - "type": "object", - "properties": { - "jobId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Update loan Summary" - }, - "nextRunTime": { - "type": "string", - "format": "date-time" - }, - "initializingError": { - "type": "string" - }, - "cronExpression": { - "type": "string", - "example": "0 0 22 1/1 * ? *" - }, - "active": { - "type": "boolean", - "example": false - }, - "currentlyRunning": { - "type": "boolean", - "example": false - }, - "lastRunHistory": { - "$ref": "#/definitions/JobDetailHistoryData" - } - } - }, - "JobDetailHistoryData": { - "type": "object" - }, - "PostReportMailingJobsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostReportMailingJobsRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en_GB" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy HH:mm:ss" - }, - "name": { - "type": "string", - "example": "Client Numbers Report" - }, - "description": { - "type": "string", - "example": "Client Numbers Report" - }, - "startDateTime": { - "type": "string", - "format": "date-time", - "example": "1469627093000" - }, - "stretchyReportId": { - "type": "integer", - "format": "int64", - "example": 120 - }, - "emailRecipients": { - "type": "string", - "example": "info@musonisystem.com" - }, - "emailSubject": { - "type": "string", - "example": "Client Numbers Report" - }, - "emailMessage": { - "type": "string", - "example": "Client Numbers Report" - }, - "recurrence": { - "type": "string", - "example": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR" - }, - "isActive": { - "type": "boolean", - "example": true - }, - "stretchyReportParamMap": { - "type": "string", - "example": "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}" - } - } - }, - "PutReportMailingJobsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutReportMailingJobsResponseChanges" - } - } - }, - "PutReportMailingJobsResponseChanges": { - "type": "object", - "properties": { - "startDateTime": { - "type": "string", - "format": "date-time", - "example": "10-08-2016 23:30:00" - } - } - }, - "PutReportMailingJobsRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en_GB" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy HH:mm:ss" - }, - "startDateTime": { - "type": "string", - "format": "date-time", - "example": "10-08-2016 23:30:00" - } - } - }, - "DeleteReportMailingJobsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "DeleteReportMailingJobsRequest": { - "type": "object" - }, - "GetReportMailingJobsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Client Numbers Report" - }, - "description": { - "type": "string", - "example": "Client Numbers Report" - }, - "startDateTime": { - "type": "string", - "format": "date-time", - "example": "1469627093000" - }, - "recurrence": { - "type": "string" - }, - "timeline": { - "$ref": "#/definitions/ReportMailingJobTimelineData" - }, - "emailRecipients": { - "type": "string", - "example": "info@musonisystem.com" - }, - "emailSubject": { - "type": "string", - "example": "Client Numbers Report" - }, - "emailMessage": { - "type": "string", - "example": "Client Numbers Report" - }, - "emailAttachmentFileFormat": { - "$ref": "#/definitions/EnumOptionData" - }, - "stretchyReport": { - "$ref": "#/definitions/ReportData" - }, - "stretchyReportParamMap": { - "type": "string", - "example": "{\"startDate\":\"2016-07-01\",\"endDate\":\"2016-08-02\",\"selectOffice\":\"1\",\"environementUrl\":\"environementUrl\"}" - }, - "nextRunDateTime": { - "type": "string", - "format": "date-time", - "example": "1469627093000" - }, - "numberOfRuns": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "isActive": { - "type": "boolean", - "example": true - }, - "runAsUserId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "ReportData": { - "type": "object" - }, - "ReportMailingJobTimelineData": { - "type": "object" - }, - "GetReportMailingJobsTemplate": { - "type": "object", - "properties": { - "isActive": { - "type": "boolean", - "example": true - }, - "emailAttachmentFileFormatOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - }, - "stretchyReportParamDateOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - } - } - }, - "ReportMailingJobRunHistoryData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "reportMailingJobId": { - "type": "integer", - "format": "int64" - }, - "startDateTime": { - "type": "string", - "format": "date-time" - }, - "endDateTime": { - "type": "string", - "format": "date-time" - }, - "status": { - "type": "string" - }, - "errorMessage": { - "type": "string" - }, - "errorLog": { - "type": "string" - } - } - }, - "PostAuthenticationResponse": { - "type": "object", - "properties": { - "username": { - "type": "string", - "example": "mifos" - }, - "userId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "base64EncodedAuthenticationKey": { - "type": "string", - "example": "bWlmb3M6cGFzc3dvcmQ=" - }, - "authenticated": { - "type": "boolean", - "example": true - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "staffId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "staffDisplayName": { - "type": "string", - "example": "Director, Program" - }, - "organisationalRole": { - "$ref": "#/definitions/EnumOptionData" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - }, - "permissions": { - "type": "array", - "example": "ALL_FUNCTIONS", - "items": { - "type": "string" - } - } - } - }, - "RoleData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - } - } - }, - "GetUserDetailsResponse": { - "type": "object", - "properties": { - "username": { - "type": "string", - "example": "mifos" - }, - "userId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accessToken": { - "type": "string", - "example": "bWlmb3M6cGFzc3dvcmQ=" - }, - "authenticated": { - "type": "boolean", - "example": true - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "staffId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "staffDisplayName": { - "type": "string", - "example": "mifosStaffDisplayName" - }, - "organisationalRole": { - "$ref": "#/definitions/EnumOptionData" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - }, - "permissions": { - "type": "array", - "example": "ALL_FUNCTIONS", - "items": { - "type": "string" - } - } - } - }, - "PostSurveySurveyNameApptableIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int64", - "example": 87 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 87 - } - } - }, - "PostSurveySurveyNameApptableIdRequest": { - "type": "object", - "properties": { - "ppi_household_members_cd_q1_householdmembers": { - "type": "integer", - "format": "int64", - "example": 167 - }, - "ppi_highestschool_cd_q2_highestschool": { - "type": "integer", - "format": "int64", - "example": 174 - }, - "ppi_businessoccupation_cd_q3_businessoccupation": { - "type": "integer", - "format": "int64", - "example": 180 - }, - "ppi_habitablerooms_cd_q4_habitablerooms": { - "type": "integer", - "format": "int64", - "example": 184 - }, - "ppi_floortype_cd_q5_floortype": { - "type": "integer", - "format": "int64", - "example": 188 - }, - "ppi_lightingsource_cd_q6_lightingsource": { - "type": "integer", - "format": "int64", - "example": 190 - }, - "ppi_irons_cd_q7_irons": { - "type": "integer", - "format": "int64", - "example": 193 - }, - "ppi_mosquitonets_cd_q8_mosquitonets": { - "type": "integer", - "format": "int64", - "example": 195 - }, - "ppi_towels_cd_q9_towels": { - "type": "integer", - "format": "int64", - "example": 198 - }, - "ppi_fryingpans_cd_q10_fryingpans": { - "type": "integer", - "format": "int64", - "example": 201 - }, - "Date": { - "type": "string", - "format": "date-time", - "example": "2014-12-02 20:30:00" - }, - "dateFormat": { - "type": "string", - "format": "date-time", - "example": "Y-m-d H:i:s" - }, - "locale": { - "type": "string", - "example": "en_GB" - } - } - }, - "GetSurveyResponse": { - "type": "object", - "properties": { - "datatableData": { - "$ref": "#/definitions/GetSurveyResponseDatatableData" - }, - "enabled": { - "type": "boolean", - "example": false - } - } - }, - "GetSurveyResponseDatatableData": { - "type": "object", - "properties": { - "applicationTableName": { - "type": "string", - "example": "m_client" - }, - "registeredTableName": { - "type": "string", - "example": "ppi_kenya_2005" - }, - "columnHeaderData": { - "type": "array", - "items": { - "$ref": "#/definitions/ResultsetColumnHeaderData" - } - } - } - }, - "InteropAccountData": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - } - } - }, - "InteropTransactionsData": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - } - } - }, - "InteropIdentifiersResponseData": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - } - } - }, - "InteropIdentifierAccountResponseData": { - "type": "object", - "required": [ - "accountId" - ], - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - }, - "accountId": { - "type": "string" - } - } - }, - "InteropIdentifierRequestData": { - "type": "object", - "properties": { - "idType": { - "type": "string", - "enum": [ - "MSISDN", - "EMAIL", - "PERSONAL_ID", - "BUSINESS", - "DEVICE", - "ACCOUNT_ID", - "IBAN", - "ALIAS" - ] - }, - "idValue": { - "type": "string" - }, - "subIdOrType": { - "type": "string" - }, - "accountId": { - "type": "string" - } - } - }, - "ExtensionData": { - "type": "object", - "required": [ - "key" - ], - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "InteropTransactionRequestResponseData": { - "type": "object", - "required": [ - "requestCode", - "state", - "transactionCode" - ], - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - }, - "transactionCode": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "ACCEPTED", - "REJECTED" - ] - }, - "expiration": { - "type": "string" - }, - "extensionList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtensionData" - } - }, - "requestCode": { - "type": "string" - } - } - }, - "GeoCodeData": { - "type": "object", - "required": [ - "latitude", - "longitude" - ], - "properties": { - "latitude": { - "type": "string" - }, - "longitude": { - "type": "string" - } - } - }, - "InteropTransactionRequestData": { - "type": "object", - "required": [ - "accountId", - "amount", - "transactionCode", - "transactionRole" - ], - "properties": { - "transactionCode": { - "type": "string" - }, - "requestCode": { - "type": "string" - }, - "accountId": { - "type": "string" - }, - "amount": { - "$ref": "#/definitions/MoneyData" - }, - "transactionRole": { - "type": "string", - "enum": [ - "PAYER", - "PAYEE" - ] - }, - "transactionType": { - "$ref": "#/definitions/InteropTransactionTypeData" - }, - "note": { - "type": "string" - }, - "geoCode": { - "$ref": "#/definitions/GeoCodeData" - }, - "expiration": { - "$ref": "#/definitions/LocalDateTime" - }, - "extensionList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtensionData" - } - }, - "expirationLocalDate": { - "type": "string", - "format": "date" - } - } - }, - "InteropTransactionTypeData": { - "type": "object", - "required": [ - "initiator", - "initiatorType", - "scenario" - ], - "properties": { - "scenario": { - "type": "string", - "enum": [ - "DEPOSIT", - "WITHDRAWAL", - "TRANSFER", - "PAYMENT", - "REFUND" - ] - }, - "subScenario": { - "type": "string" - }, - "initiator": { - "type": "string", - "enum": [ - "PAYER", - "PAYEE" - ] - }, - "initiatorType": { - "type": "string", - "enum": [ - "CONSUMER", - "AGENT", - "BUSINESS", - "DEVICE" - ] - } - } - }, - "LocalDateTime": { - "type": "object", - "properties": { - "monthOfYear": { - "type": "integer", - "format": "int32" - }, - "centuryOfEra": { - "type": "integer", - "format": "int32" - }, - "yearOfCentury": { - "type": "integer", - "format": "int32" - }, - "weekyear": { - "type": "integer", - "format": "int32" - }, - "weekOfWeekyear": { - "type": "integer", - "format": "int32" - }, - "minuteOfHour": { - "type": "integer", - "format": "int32" - }, - "hourOfDay": { - "type": "integer", - "format": "int32" - }, - "millisOfDay": { - "type": "integer", - "format": "int32" - }, - "secondOfMinute": { - "type": "integer", - "format": "int32" - }, - "millisOfSecond": { - "type": "integer", - "format": "int32" - }, - "yearOfEra": { - "type": "integer", - "format": "int32" - }, - "year": { - "type": "integer", - "format": "int32" - }, - "dayOfMonth": { - "type": "integer", - "format": "int32" - }, - "era": { - "type": "integer", - "format": "int32" - }, - "dayOfYear": { - "type": "integer", - "format": "int32" - }, - "dayOfWeek": { - "type": "integer", - "format": "int32" - }, - "chronology": { - "$ref": "#/definitions/Chronology" - }, - "fieldTypes": { - "type": "array", - "items": { - "$ref": "#/definitions/DateTimeFieldType" - } - }, - "values": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/definitions/DateTimeField" - } - } - } - }, - "MoneyData": { - "type": "object", - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "type": "number" - }, - "currency": { - "type": "string" - } - } - }, - "InteropQuoteResponseData": { - "type": "object", - "required": [ - "quoteCode", - "state", - "transactionCode" - ], - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - }, - "transactionCode": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "ACCEPTED", - "REJECTED" - ] - }, - "expiration": { - "type": "string" - }, - "extensionList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtensionData" - } - }, - "quoteCode": { - "type": "string" - }, - "fspFee": { - "$ref": "#/definitions/MoneyData" - }, - "fspCommission": { - "$ref": "#/definitions/MoneyData" - } - } - }, - "InteropQuoteRequestData": { - "type": "object", - "required": [ - "accountId", - "amount", - "amountType", - "quoteCode", - "transactionCode", - "transactionRole" - ], - "properties": { - "transactionCode": { - "type": "string" - }, - "requestCode": { - "type": "string" - }, - "accountId": { - "type": "string" - }, - "amount": { - "$ref": "#/definitions/MoneyData" - }, - "transactionRole": { - "type": "string", - "enum": [ - "PAYER", - "PAYEE" - ] - }, - "transactionType": { - "$ref": "#/definitions/InteropTransactionTypeData" - }, - "note": { - "type": "string" - }, - "geoCode": { - "$ref": "#/definitions/GeoCodeData" - }, - "expiration": { - "$ref": "#/definitions/LocalDateTime" - }, - "extensionList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtensionData" - } - }, - "quoteCode": { - "type": "string" - }, - "amountType": { - "type": "string", - "enum": [ - "SEND", - "RECEIVE" - ] - }, - "fees": { - "$ref": "#/definitions/MoneyData" - }, - "expirationLocalDate": { - "type": "string", - "format": "date" - } - } - }, - "InteropTransferResponseData": { - "type": "object", - "required": [ - "state", - "transactionCode", - "transferCode" - ], - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - }, - "transactionCode": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "ACCEPTED", - "REJECTED" - ] - }, - "expiration": { - "type": "string" - }, - "extensionList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtensionData" - } - }, - "transferCode": { - "type": "string" - }, - "completedTimestamp": { - "type": "string" - } - } - }, - "InteropTransferRequestData": { - "type": "object", - "required": [ - "accountId", - "amount", - "transactionCode", - "transactionRole", - "transferCode" - ], - "properties": { - "transactionCode": { - "type": "string" - }, - "requestCode": { - "type": "string" - }, - "accountId": { - "type": "string" - }, - "amount": { - "$ref": "#/definitions/MoneyData" - }, - "transactionRole": { - "type": "string", - "enum": [ - "PAYER", - "PAYEE" - ] - }, - "transactionType": { - "$ref": "#/definitions/InteropTransactionTypeData" - }, - "note": { - "type": "string" - }, - "geoCode": { - "$ref": "#/definitions/GeoCodeData" - }, - "expiration": { - "$ref": "#/definitions/LocalDateTime" - }, - "extensionList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtensionData" - } - }, - "transferCode": { - "type": "string" - }, - "fspFee": { - "$ref": "#/definitions/MoneyData" - }, - "fspCommission": { - "$ref": "#/definitions/MoneyData" - }, - "expirationLocalDate": { - "type": "string", - "format": "date" - } - } - }, - "PostHolidaysHolidayIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostHolidaysHolidayIdRequest": { - "type": "object" - }, - "PostHolidaysResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostHolidaysRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Good Friday" - }, - "description": { - "type": "string", - "example": "Good Friday" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "25 October 2013" - }, - "toDate": { - "type": "string", - "format": "date", - "example": "25 October 2013" - }, - "repaymentsRescheduledTo": { - "type": "string", - "format": "date", - "example": "26 October 2013" - }, - "offices": { - "type": "array", - "items": { - "$ref": "#/definitions/PostHolidaysRequestOffices" - } - } - } - }, - "PostHolidaysRequestOffices": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetHolidaysResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Good Friday" - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "[2013, 10, 26]" - }, - "toDate": { - "type": "string", - "format": "date", - "example": "[2013, 10, 26]" - }, - "repaymentsRescheduledTo": { - "type": "string", - "format": "date", - "example": "[2013, 10, 27]" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "status": { - "$ref": "#/definitions/EnumOptionData" - } - } - }, - "PutHolidaysHolidayIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutHolidaysHolidayIdResponseChanges" - } - } - }, - "PutHolidaysHolidayIdResponseChanges": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Independence day" - }, - "description": { - "type": "string", - "example": "Holiday for Independence day celebration" - } - } - }, - "PutHolidaysHolidayIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Independence day" - }, - "description": { - "type": "string", - "example": "Holiday for Independence day celebration" - } - } - }, - "DeleteHolidaysHolidayIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetCurrenciesResponse": { - "type": "object", - "properties": { - "selectedCurrencyOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CurrencyData" - } - }, - "currencyOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CurrencyData" - } - } - } - }, - "PutCurrenciesResponse": { - "type": "object", - "properties": { - "currencies": { - "type": "string", - "example": "[\"KES\",\n \"BND\",\n \"LBP\",\n \"GHC\",\n \"USD\",\n \"XOF\",\n \"AED\",\n \"AMD\"]" - } - } - }, - "PutCurrenciesRequest": { - "type": "object", - "properties": { - "currencies": { - "type": "string", - "example": "[\"KES\",\n \"BND\",\n \"LBP\",\n \"GHC\",\n \"USD\",\n \"XOF\",\n \"AED\",\n \"AMD\"]" - } - } - }, - "GetOfficesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - }, - "externalId": { - "type": "string", - "example": "1" - }, - "openingDate": { - "type": "string", - "format": "date", - "example": "[2009, 1, 1]" - }, - "hierarchy": { - "type": "string", - "example": "." - } - } - }, - "GetOfficesTemplateResponse": { - "type": "object", - "properties": { - "openingDate": { - "type": "string", - "format": "date", - "example": "[2009, 1, 1]" - }, - "allowedParents": { - "type": "array", - "items": { - "$ref": "#/definitions/GetOfficesResponse" - } - } - } - }, - "PostOfficesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 3 - } - } - }, - "PostOfficesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Good Friday" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "openingDate": { - "type": "string", - "format": "date", - "example": "01 July 2007" - }, - "parentId": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "externalId": { - "type": "string", - "example": "SYS54-88" - } - } - }, - "PutOfficesOfficeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "changes": { - "$ref": "#/definitions/PutOfficesOfficeIdResponseChanges" - } - } - }, - "PutOfficesOfficeIdResponseChanges": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Name is updated" - } - } - }, - "PutOfficesOfficeIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Name is updated" - } - } - }, - "GetProvisioningCriteriaCriteriaIdResponse": { - "type": "object", - "properties": { - "criteriaId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "criteriaName": { - "type": "string", - "example": "High Risk Products Criteria" - }, - "createdBy": { - "type": "string", - "example": "mifos" - }, - "loanProducts": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductData" - } - }, - "provisioningcriteria": { - "type": "array", - "items": { - "$ref": "#/definitions/ProvisioningCriteriaDefinitionData" - } - } - } - }, - "ProvisioningCriteriaDefinitionData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "categoryId": { - "type": "integer", - "format": "int64" - }, - "categoryName": { - "type": "string" - }, - "minAge": { - "type": "integer", - "format": "int64" - }, - "maxAge": { - "type": "integer", - "format": "int64" - }, - "provisioningPercentage": { - "type": "number" - }, - "liabilityAccount": { - "type": "integer", - "format": "int64" - }, - "liabilityCode": { - "type": "string" - }, - "expenseAccount": { - "type": "integer", - "format": "int64" - }, - "expenseCode": { - "type": "string" - } - } - }, - "GetProvisioningCriteriaResponse": { - "type": "object", - "properties": { - "criteriaId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "criteriaName": { - "type": "string", - "example": "High Risk Products Criteria" - }, - "createdBy": { - "type": "string", - "example": "mifos" - } - } - }, - "PostProvisioningCriteriaResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostProvisioningCriteriaRequest": { - "type": "object", - "properties": { - "criteriaName": { - "type": "string", - "example": "High Risk Products Criteria" - }, - "loanProducts": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductData" - } - }, - "provisioningcriteria": { - "type": "array", - "items": { - "$ref": "#/definitions/ProvisioningCriteriaDefinitionData" - } - } - } - }, - "PutProvisioningCriteriaResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutProvisioningCriteriaResponseChanges" - } - } - }, - "PutProvisioningCriteriaResponseChanges": { - "type": "object", - "properties": { - "criteriaName": { - "type": "string", - "example": "High Risk Products Criteria" - } - } - }, - "PutProvisioningCriteriaRequest": { - "type": "object", - "properties": { - "criteriaName": { - "type": "string", - "example": "High Risk Products Criteria" - }, - "loanProducts": { - "type": "array", - "items": { - "$ref": "#/definitions/LoanProductData" - } - }, - "provisioningcriteria": { - "type": "array", - "items": { - "$ref": "#/definitions/ProvisioningCriteriaDefinitionData" - } - } - } - }, - "DeleteProvisioningCriteriaResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetStaffResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "firstname": { - "type": "string", - "example": "John" - }, - "lastname": { - "type": "string", - "example": "Doe" - }, - "displayName": { - "type": "string", - "example": "Doe, John" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "isLoanOfficer": { - "type": "boolean", - "example": true - }, - "externalId": { - "type": "string", - "example": "17H" - }, - "isActive": { - "type": "boolean", - "example": false - }, - "joiningDate": { - "type": "string", - "format": "date", - "example": "[2009,8,1]" - } - } - }, - "PostStaffResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostStaffRequest": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "firstname": { - "type": "string", - "example": "John" - }, - "lastname": { - "type": "string", - "example": "Doe" - }, - "isLoanOfficer": { - "type": "boolean", - "example": true - }, - "externalId": { - "type": "string", - "example": "17H" - }, - "mobileNo": { - "type": "string", - "example": "+353851239876" - }, - "isActive": { - "type": "boolean", - "example": true - }, - "joiningDate": { - "type": "string", - "format": "date", - "example": "01 January 2009" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - } - } - }, - "PutStaffResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PutStaffRequest": { - "type": "object", - "properties": { - "isLoanOfficer": { - "type": "boolean", - "example": false - }, - "externalId": { - "type": "string", - "example": "17Hbb" - } - } - }, - "PutTellersResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 5 - }, - "changes": { - "$ref": "#/definitions/PutTellersResponseChanges" - } - } - }, - "PutTellersResponseChanges": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "teller cash handling" - }, - "endDate": { - "type": "string", - "format": "date", - "example": "28 February 2015" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "01 February 2015" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - } - } - }, - "PutTellersRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Teller3" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "description": { - "type": "string", - "example": "teller cash handling" - }, - "status": { - "type": "string", - "example": "ACTIVE", - "enum": [ - "INVALID", - "PENDING", - "ACTIVE", - "INACTIVE", - "CLOSED" - ] - }, - "endDate": { - "type": "string", - "format": "date", - "example": "28 February 2015" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "01 February 2015" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - } - } - }, - "GetTellersTellerIdCashiersCashierIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "tellerId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "staffId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "description": { - "type": "string" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "Feb 20, 2015 12:00:00 AM" - }, - "endDate": { - "type": "string", - "format": "date", - "example": "Feb 27, 2015 12:00:00 AM" - }, - "isFullDay": { - "type": "boolean", - "example": true - }, - "startTime": { - "type": "string" - }, - "endTime": { - "type": "string" - }, - "tellerName": { - "type": "string", - "example": "Teller1" - }, - "staffName": { - "type": "string", - "example": "Staff1, Test" - } - } - }, - "GetTellersTellerIdCashiersTemplateResponse": { - "type": "object", - "properties": { - "tellerId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "tellerName": { - "type": "string", - "example": "Teller1" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "staffOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/StaffData" - } - } - } - }, - "StaffData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "officeId": { - "type": "integer", - "format": "int64" - }, - "officeName": { - "type": "string" - }, - "joiningDate": { - "type": "string", - "format": "date" - }, - "rowIndex": { - "type": "integer", - "format": "int32" - } - } - }, - "PostTellersTellerIdCashiersResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "subResourceId": { - "type": "integer", - "format": "int64", - "example": 2 - } - } - }, - "PostTellersTellerIdCashiersRequest": { - "type": "object", - "properties": { - "endDate": { - "type": "string", - "format": "date", - "example": "28 February 2015" - }, - "description": { - "type": "string", - "example": "teller cash handling" - }, - "isFullDay": { - "type": "boolean", - "example": true - }, - "staffId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "01 February 2015" - } - } - }, - "PutTellersTellerIdCashiersCashierIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "subResourceId": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "changes": { - "$ref": "#/definitions/PutTellersTellerIdCashiersCashierIdResponseChanges" - } - } - }, - "PutTellersTellerIdCashiersCashierIdResponseChanges": { - "type": "object", - "properties": { - "endDate": { - "type": "string", - "format": "date", - "example": "25 February 2015" - }, - "description": { - "type": "string", - "example": "Cashier updated." - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - } - } - }, - "PutTellersTellerIdCashiersCashierIdRequest": { - "type": "object", - "properties": { - "endDate": { - "type": "string", - "format": "date", - "example": "25 February 2015" - }, - "description": { - "type": "string", - "example": "Cashier updated." - }, - "isFullDay": { - "type": "boolean", - "example": true - }, - "staffId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "01 February 2015" - } - } - }, - "GetTellersResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "debitAccountId": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "creditAccountId": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "name": { - "type": "string", - "example": "Teller3" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "[2015,2,1]" - }, - "status": { - "type": "string", - "example": "ACTIVE", - "enum": [ - "INVALID", - "PENDING", - "ACTIVE", - "INACTIVE", - "CLOSED" - ] - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "PostTellersResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 5 - } - } - }, - "PostTellersRequest": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Teller3" - }, - "description": { - "type": "string", - "example": "cash handling" - }, - "status": { - "type": "string", - "example": "ACTIVE", - "enum": [ - "INVALID", - "PENDING", - "ACTIVE", - "INACTIVE", - "CLOSED" - ] - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "01 February 2015" - } - } - }, - "CashierData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "tellerId": { - "type": "integer", - "format": "int64" - }, - "officeId": { - "type": "integer", - "format": "int64" - }, - "staffId": { - "type": "integer", - "format": "int64" - }, - "description": { - "type": "string" - }, - "startDate": { - "type": "string", - "format": "date-time" - }, - "endDate": { - "type": "string", - "format": "date-time" - }, - "startTime": { - "type": "string" - }, - "endTime": { - "type": "string" - }, - "officeName": { - "type": "string" - }, - "tellerName": { - "type": "string" - }, - "staffName": { - "type": "string" - }, - "fullDay": { - "type": "boolean" - } - } - }, - "GetTellersTellerIdCashiersResponse": { - "type": "object", - "properties": { - "tellerId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "tellerName": { - "type": "string", - "example": "Teller1" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "cashiers": { - "type": "array", - "items": { - "$ref": "#/definitions/CashierData" - } - } - } - }, - "DeleteTellersTellerIdCashiersCashierIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostTellersTellerIdCashiersCashierIdAllocateResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "subResourceId": { - "type": "integer", - "format": "int64", - "example": 4 - } - } - }, - "PostTellersTellerIdCashiersCashierIdAllocateRequest": { - "type": "object", - "properties": { - "currencyCode": { - "type": "string", - "example": "USD" - }, - "txnAmount": { - "type": "number", - "example": 5000 - }, - "txnNote": { - "type": "string", - "example": "allocating cash" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - }, - "txnDate": { - "type": "string", - "format": "date-time", - "example": "01 February 2015" - } - } - }, - "PostTellersTellerIdCashiersCashierIdSettleResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "subResourceId": { - "type": "integer", - "format": "int64", - "example": 5 - } - } - }, - "PostTellersTellerIdCashiersCashierIdSettleRequest": { - "type": "object", - "properties": { - "currencyCode": { - "type": "string", - "example": "USD" - }, - "txnAmount": { - "type": "number", - "example": 2000 - }, - "txnNote": { - "type": "string", - "example": "cash settlement" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd-MM-yyyy" - }, - "txnDate": { - "type": "string", - "format": "date-time", - "example": "20 February 2015" - } - } - }, - "CashierTxnType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "value": { - "type": "string" - } - } - }, - "GetTellersTellerIdCashiersCashiersIdTransactionsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 8 - }, - "cashierId": { - "type": "integer", - "format": "int64", - "example": 15 - }, - "txnType": { - "$ref": "#/definitions/CashierTxnType" - }, - "txnAmount": { - "type": "number", - "example": 1000 - }, - "txnDate": { - "type": "string", - "format": "date-time", - "example": "Feb 25, 2015 12:00:00 AM" - }, - "entityId": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "entityType": { - "type": "string", - "example": "loans" - }, - "txnNote": { - "type": "string", - "example": "Disbursement, Loan:2-000000002,Client:1-Test 1" - }, - "createdDate": { - "type": "string", - "format": "date-time", - "example": "Feb 25, 2015 12:00:00 AM" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "tellerId": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "cashierName": { - "type": "string", - "example": "B, Ramesh" - } - } - }, - "CashierTransactionData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "cashierId": { - "type": "integer", - "format": "int64" - }, - "txnType": { - "$ref": "#/definitions/CashierTxnType" - }, - "txnAmount": { - "type": "number" - }, - "txnDate": { - "type": "string", - "format": "date-time" - }, - "entityId": { - "type": "integer", - "format": "int64" - }, - "entityType": { - "type": "string" - }, - "txnNote": { - "type": "string" - }, - "createdDate": { - "type": "string", - "format": "date-time" - }, - "officeId": { - "type": "integer", - "format": "int64" - }, - "officeName": { - "type": "string" - }, - "tellerId": { - "type": "integer", - "format": "int64" - }, - "tellerName": { - "type": "string" - }, - "cashierName": { - "type": "string" - }, - "cashierData": { - "$ref": "#/definitions/CashierData" - }, - "startDate": { - "type": "string", - "format": "date-time" - }, - "endDate": { - "type": "string", - "format": "date-time" - } - } - }, - "GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse": { - "type": "object", - "properties": { - "sumCashAllocation": { - "type": "number", - "example": 7000 - }, - "sumInwardCash": { - "type": "number", - "example": 0 - }, - "sumOutwardCash": { - "type": "number", - "example": 0 - }, - "sumCashSettlement": { - "type": "number", - "example": 50 - }, - "netCash": { - "type": "number", - "example": 6950 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "tellerId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "tellerName": { - "type": "string", - "example": "Teller1" - }, - "cashierId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "cashierName": { - "type": "string", - "example": "Staff1, Test" - }, - "cashierTransactions": { - "$ref": "#/definitions/PageCashierTransactionData" - } - } - }, - "Page": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32" - }, - "pageItems": { - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "PageCashierTransactionData": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32" - }, - "pageItems": { - "type": "array", - "items": { - "$ref": "#/definitions/CashierTransactionData" - } - } - } - }, - "GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse": { - "type": "object", - "properties": { - "cashierId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "tellerId": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "tellerName": { - "type": "string", - "example": "Teller1" - }, - "cashierName": { - "type": "string", - "example": "Staff1, Test" - }, - "cashierData": { - "$ref": "#/definitions/CashierData" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "Feb 20, 2015 12:00:00 AM" - }, - "endDate": { - "type": "string", - "format": "date", - "example": "Feb 27, 2015 12:00:00 AM" - }, - "currencyOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/CurrencyData" - } - } - } - }, - "GetWorkingDaysResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "recurrence": { - "type": "string", - "example": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR" - }, - "repaymentRescheduleType": { - "$ref": "#/definitions/EnumOptionData" - }, - "extendTermForDailyRepayments": { - "type": "boolean", - "example": true - } - } - }, - "GetWorkingDaysTemplateResponse": { - "type": "object", - "properties": { - "repaymentRescheduleOptions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumOptionData" - } - } - } - }, - "PutWorkingDaysResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PutWorkingDaysRequest": { - "type": "object", - "properties": { - "recurrence": { - "type": "string", - "example": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR" - }, - "locale": { - "type": "string", - "example": "en" - }, - "repaymentRescheduleType": { - "example": "4", - "$ref": "#/definitions/EnumOptionData" - }, - "extendTermForDailyRepayments": { - "type": "boolean", - "example": true - } - } - }, - "GetAccountTransfersClientClassification": { - "type": "object" - }, - "GetAccountTransfersClientType": { - "type": "object" - }, - "GetAccountTransfersFromAccountType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetAccountTransfersGender": { - "type": "object" - }, - "GetAccountTransfersGroups": { - "type": "object" - }, - "GetAccountTransfersPageItemsToAccountType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountType.loan" - }, - "value": { - "type": "string", - "example": "Loan Account" - } - } - }, - "GetAccountTransfersStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "clientStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferFromAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Daniel Owusu" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "CTRL" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferCurrency" - }, - "amtForTransfer": { - "type": "number", - "format": "float", - "example": 130 - } - } - }, - "GetAccountTransfersTemplateRefundByTransferFromAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Daniel Owusu" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "CTRL" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferCurrency" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferFromClient": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "status": { - "$ref": "#/definitions/GetAccountTransfersStatus" - }, - "active": { - "type": "boolean", - "example": true - }, - "activationDate": { - "type": "string", - "format": "date", - "example": "[2012, 2, 1]" - }, - "firstname": { - "type": "string", - "example": "Daniel" - }, - "lastname": { - "type": "string", - "example": "Owusu" - }, - "displayName": { - "type": "string", - "example": "Daniel Owusu" - }, - "gender": { - "$ref": "#/definitions/GetAccountTransfersGender" - }, - "clientType": { - "$ref": "#/definitions/GetAccountTransfersClientType" - }, - "clientClassification": { - "$ref": "#/definitions/GetAccountTransfersClientClassification" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "timeline": { - "$ref": "#/definitions/GetAccountTransfersTimeline" - }, - "groups": { - "$ref": "#/definitions/GetAccountTransfersGroups" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferFromClientOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Daniel Owusu" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferFromOffice": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - }, - "externalId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "openingDate": { - "type": "string", - "format": "date", - "example": "[2009, 1, 1]" - }, - "hierarchy": { - "type": "string", - "example": "." - } - } - }, - "GetAccountTransfersTemplateRefundByTransferFromOfficeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferResponse": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferCurrency" - }, - "transferAmount": { - "type": "number", - "format": "float", - "example": 130 - }, - "transferDate": { - "type": "string", - "format": "date", - "example": "[2014, 11, 1]" - }, - "fromOffice": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromOffice" - }, - "fromClient": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromClient" - }, - "fromAccountType": { - "$ref": "#/definitions/GetAccountTransfersPageItemsToAccountType" - }, - "fromAccount": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromAccount" - }, - "toOffice": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromOffice" - }, - "toClient": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferToClient" - }, - "toAccountType": { - "$ref": "#/definitions/GetAccountTransfersFromAccountType" - }, - "toAccount": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferToAccount" - }, - "fromOfficeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromOfficeOptions" - } - }, - "fromClientOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromClientOptions" - } - }, - "fromAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersFromAccountType" - } - }, - "fromAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromAccountOptions" - } - }, - "toOfficeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromOfficeOptions" - } - }, - "toClientOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferFromClientOptions" - } - }, - "toAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersFromAccountType" - } - }, - "toAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferToAccount" - } - } - } - }, - "GetAccountTransfersTemplateRefundByTransferToAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Daniel Owusu" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "TEST" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetAccountTransfersTemplateRefundByTransferCurrency" - } - } - }, - "GetAccountTransfersTemplateRefundByTransferToClient": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Daniel Owusu" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetAccountTransfersTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2012, 2, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - }, - "activatedOnDate": { - "type": "string", - "format": "date", - "example": "[2012, 2, 1]" - }, - "activatedByUsername": { - "type": "string", - "example": "mifos" - }, - "activatedByFirstname": { - "type": "string", - "example": "App" - }, - "activatedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "PostAccountTransfersRefundByTransferResponse": { - "type": "object", - "properties": { - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostAccountTransfersRefundByTransferRequest": { - "type": "object", - "properties": { - "fromAccountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "fromAccountType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toOfficeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toClientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toAccountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "toAccountId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transferAmount": { - "type": "number", - "format": "float", - "example": 130 - }, - "transferDate": { - "type": "string", - "example": "31 October 2014" - }, - "transferDescription": { - "type": "string", - "example": "Transfer refund to my savings account" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "fromClientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromOfficeId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetAccountTransfersFromClientOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Small shop" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "HO" - } - } - }, - "GetAccountTransfersPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "reversed": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetAccountTransfersPageItemsCurrency" - }, - "transferAmount": { - "type": "number", - "format": "float", - "example": 200 - }, - "transferDate": { - "type": "string", - "format": "date", - "example": "[2013, 4, 1]" - }, - "transferDescription": { - "type": "string", - "example": "pay off loan from savings." - }, - "fromOffice": { - "$ref": "#/definitions/GetAccountTransfersPageItemsFromOffice" - }, - "fromClient": { - "$ref": "#/definitions/GetAccountTransfersFromClientOptions" - }, - "fromAccountType": { - "$ref": "#/definitions/GetAccountTransfersFromAccountType" - }, - "fromAccount": { - "$ref": "#/definitions/GetAccountTransfersPageItemsFromAccount" - }, - "toOffice": { - "$ref": "#/definitions/GetAccountTransfersPageItemsFromOffice" - }, - "toClient": { - "$ref": "#/definitions/GetAccountTransfersFromClientOptions" - }, - "toAccountType": { - "$ref": "#/definitions/GetAccountTransfersPageItemsToAccountType" - }, - "toAccount": { - "$ref": "#/definitions/GetAccountTransfersPageItemsFromAccount" - } - } - }, - "GetAccountTransfersPageItemsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetAccountTransfersPageItemsFromAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetAccountTransfersPageItemsFromOffice": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "HO" - } - } - }, - "GetAccountTransfersResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersPageItems" - } - } - } - }, - "GetAccountTransfersFromAccountTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetAccountTransfersFromOffice": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "HO" - }, - "nameDecorated": { - "type": "string", - "example": "HO" - }, - "externalId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "openingDate": { - "type": "string", - "format": "date", - "example": "[2009, 1, 1]" - }, - "hierarchy": { - "type": "string", - "example": "." - } - } - }, - "GetAccountTransfersFromOfficeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "HO" - }, - "nameDecorated": { - "type": "string", - "example": "HO" - } - } - }, - "GetAccountTransfersTemplateResponse": { - "type": "object", - "properties": { - "transferAmount": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "transferDate": { - "type": "string", - "format": "date", - "example": "[2013, 8, 15]" - }, - "fromOffice": { - "$ref": "#/definitions/GetAccountTransfersFromOffice" - }, - "fromAccountType": { - "$ref": "#/definitions/GetAccountTransfersFromAccountType" - }, - "fromOfficeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersFromOfficeOptions" - } - }, - "fromClientOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersFromClientOptions" - } - }, - "fromAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersFromAccountTypeOptions" - } - }, - "toOfficeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersToOfficeOptions" - } - }, - "toAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountTransfersToAccountTypeOptions" - } - } - } - }, - "GetAccountTransfersToAccountTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetAccountTransfersToOfficeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "HO" - }, - "nameDecorated": { - "type": "string", - "example": "HO" - } - } - }, - "PostAccountTransfersResponse": { - "type": "object", - "properties": { - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostAccountTransfersRequest": { - "type": "object", - "properties": { - "fromOfficeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromClientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromAccountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "fromAccountId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toOfficeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toClientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toAccountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "toAccountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "transferDate": { - "type": "string", - "example": "01 August 2011" - }, - "transferAmount": { - "type": "number", - "format": "float", - "example": 112.45 - }, - "transferDescription": { - "type": "string", - "example": "A description of the transfer" - } - } - }, - "GetFromAccountStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 14 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 14 - }, - "productId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "productName": { - "type": "string", - "example": "savings old" - } - } - }, - "GetFromAccountTypeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetFromClientStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Test test" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetFromOfficeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetInstructionTypeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "standingInstructionType.fixed" - }, - "value": { - "type": "string", - "example": "Fixed" - } - } - }, - "GetPageItemsStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountDetailId": { - "type": "integer", - "format": "int64", - "example": 6 - }, - "name": { - "type": "string", - "example": "test standing" - }, - "fromOffice": { - "$ref": "#/definitions/GetFromOfficeStandingInstructionSwagger" - }, - "fromClient": { - "$ref": "#/definitions/GetFromClientStandingInstructionSwagger" - }, - "fromAccountType": { - "$ref": "#/definitions/GetFromAccountTypeStandingInstructionSwagger" - }, - "fromAccount": { - "$ref": "#/definitions/GetFromAccountStandingInstructionSwagger" - }, - "toOffice": { - "$ref": "#/definitions/GetToOfficeStandingInstructionSwagger" - }, - "toClient": { - "$ref": "#/definitions/GetToClientStandingInstructionSwagger" - }, - "toAccountType": { - "$ref": "#/definitions/GetToAccountTypeStandingInstructionSwagger" - }, - "toAccount": { - "$ref": "#/definitions/GetToAccountStandingInstructionSwagger" - }, - "transferType": { - "$ref": "#/definitions/GetTransferTypeStandingInstructionSwagger" - }, - "priority": { - "$ref": "#/definitions/GetPriorityStandingInstructionSwagger" - }, - "instructionType": { - "$ref": "#/definitions/GetInstructionTypeStandingInstructionSwagger" - }, - "status": { - "$ref": "#/definitions/GetStatusStandingInstructionSwagger" - }, - "amount": { - "type": "number", - "format": "float", - "example": 150 - }, - "validFrom": { - "type": "string", - "format": "date", - "example": "[2014, 4, 3]" - }, - "recurrenceType": { - "$ref": "#/definitions/GetRecurrenceTypeStandingInstructionSwagger" - }, - "recurrenceFrequency": { - "$ref": "#/definitions/GetRecurrenceFrequencyStandingInstructionSwagger" - }, - "recurrenceInterval": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurrenceOnMonthDay": { - "type": "string", - "format": "date", - "example": "[4, 3]" - } - } - }, - "GetPriorityStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "standingInstructionPriority.medium" - }, - "value": { - "type": "string", - "example": "Medium Priority" - } - } - }, - "GetRecurrenceFrequencyStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "frequencyperiodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetRecurrenceTypeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountTransferRecurrenceType.periodic" - }, - "value": { - "type": "string", - "example": "Periodic Recurrence" - } - } - }, - "GetStandingInstructionsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetPageItemsStandingInstructionSwagger" - } - } - } - }, - "GetStatusStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "standingInstructionStatus.deleted" - }, - "value": { - "type": "string", - "example": "Deleted" - } - } - }, - "GetToAccountStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "productId": { - "type": "integer", - "format": "int64", - "example": 4 - }, - "productName": { - "type": "string", - "example": "account overdraft" - } - } - }, - "GetToAccountTypeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetToClientStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Test test" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetToOfficeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetTransferTypeStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountTransferType.account.transfer" - }, - "value": { - "type": "string", - "example": "Account Transfer" - } - } - }, - "GetStandingInstructionsStandingInstructionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountDetailId": { - "type": "integer", - "format": "int64", - "example": 6 - }, - "name": { - "type": "string", - "example": "test standing" - }, - "fromOffice": { - "$ref": "#/definitions/GetFromOfficeStandingInstructionSwagger" - }, - "fromClient": { - "$ref": "#/definitions/GetFromClientStandingInstructionSwagger" - }, - "fromAccountType": { - "$ref": "#/definitions/GetFromAccountTypeStandingInstructionSwagger" - }, - "fromAccount": { - "$ref": "#/definitions/GetFromAccountStandingInstructionSwagger" - }, - "toOffice": { - "$ref": "#/definitions/GetToOfficeStandingInstructionSwagger" - }, - "toClient": { - "$ref": "#/definitions/GetToClientStandingInstructionSwagger" - }, - "toAccountType": { - "$ref": "#/definitions/GetToAccountTypeStandingInstructionSwagger" - }, - "toAccount": { - "$ref": "#/definitions/GetToAccountStandingInstructionSwagger" - }, - "transferType": { - "$ref": "#/definitions/GetTransferTypeStandingInstructionSwagger" - }, - "priority": { - "$ref": "#/definitions/GetPriorityStandingInstructionSwagger" - }, - "instructionType": { - "$ref": "#/definitions/GetInstructionTypeStandingInstructionSwagger" - }, - "status": { - "$ref": "#/definitions/GetStatusStandingInstructionSwagger" - }, - "amount": { - "type": "number", - "format": "float", - "example": 150 - }, - "validFrom": { - "type": "string", - "format": "date", - "example": "[2014, 4, 3]" - }, - "recurrenceType": { - "$ref": "#/definitions/GetRecurrenceTypeStandingInstructionSwagger" - }, - "recurrenceFrequency": { - "$ref": "#/definitions/GetRecurrenceFrequencyStandingInstructionSwagger" - }, - "recurrenceInterval": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurrenceOnMonthDay": { - "type": "string", - "format": "date", - "example": "[4, 3]" - } - } - }, - "GetFromAccountTypeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetFromAccountTypeResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetFromClientOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Client_FirstName_2VRAG Client_LastName_9QCY" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetFromOfficeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetFromOfficeResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "decoratedName": { - "type": "string", - "example": "Head Office" - }, - "externalId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "openingDate": { - "type": "string", - "format": "date", - "example": "[2009, 1, 1]" - }, - "hierarchy": { - "type": "string", - "example": "." - } - } - }, - "GetInstructionTypeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "standingInstructionType.fixed" - }, - "value": { - "type": "string", - "example": "Fixed" - } - } - }, - "GetPriorityOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "standingInstructionPriority.urgent" - }, - "value": { - "type": "string", - "example": "Urgent Priority" - } - } - }, - "GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "frequencyperiodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetRecurrenceTypeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountTransferRecurrenceType.periodic" - }, - "value": { - "type": "string", - "example": "Periodic Recurrence" - } - } - }, - "GetStandingInstructionsTemplateResponse": { - "type": "object", - "properties": { - "fromOffice": { - "$ref": "#/definitions/GetFromOfficeResponseStandingInstructionSwagger" - }, - "fromAccountType": { - "$ref": "#/definitions/GetFromAccountTypeResponseStandingInstructionSwagger" - }, - "fromOfficeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFromOfficeOptionsResponseStandingInstructionSwagger" - } - }, - "fromClientOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFromClientOptionsResponseStandingInstructionSwagger" - } - }, - "fromAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFromAccountTypeOptionsResponseStandingInstructionSwagger" - } - }, - "toOfficeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetToOfficeOptionsResponseStandingInstructionSwagger" - } - }, - "toAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetToAccountTypeOptionsResponseStandingInstructionSwagger" - } - }, - "transferTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetTransferTypeOptionsResponseStandingInstructionSwagger" - } - }, - "statusOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetStatusOptionsResponseStandingInstructionSwagger" - } - }, - "instructionTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetInstructionTypeOptionsResponseStandingInstructionSwagger" - } - }, - "priorityOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetPriorityOptionsResponseStandingInstructionSwagger" - } - }, - "recurrenceTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurrenceTypeOptionsResponseStandingInstructionSwagger" - } - }, - "recurrenceFrequencyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurrenceFrequencyOptionsResponseStandingInstructionSwagger" - } - } - } - }, - "GetStatusOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "standingInstructionStatus.active" - }, - "value": { - "type": "string", - "example": "Active" - } - } - }, - "GetToAccountTypeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountType.loan" - }, - "value": { - "type": "string", - "example": "Loan Account" - } - } - }, - "GetToOfficeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetTransferTypeOptionsResponseStandingInstructionSwagger": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountTransferType.account.transfer" - }, - "value": { - "type": "string", - "example": "Account Transfer" - } - } - }, - "PutStandingInstructionsStandingInstructionIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "changes": { - "$ref": "#/definitions/PutUpdateStandingInstructionChanges" - } - } - }, - "PutUpdateStandingInstructionChanges": { - "type": "object", - "properties": { - "recurrenceInterval": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PutStandingInstructionsStandingInstructionIdRequest": { - "type": "object", - "properties": { - "recurrenceInterval": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostStandingInstructionsResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 65 - } - } - }, - "PostStandingInstructionsRequest": { - "type": "object", - "properties": { - "fromOfficeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "fromClientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "fromAccountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "standing instruction" - }, - "transferType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "priority": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "status": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromAccountId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "toOfficeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "toClientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "toAccountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "toAccountId": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "instructionType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 221 - }, - "validFrom": { - "type": "string", - "example": "08 April 2014" - }, - "recurrenceType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurrenceInterval": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurrenceFrequency": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "locale": { - "type": "string", - "description": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "recurrenceOnMonthDay": { - "type": "string", - "example": "02 April" - }, - "monthDayFormat": { - "type": "string", - "example": "dd MMMM" - } - } - }, - "GetStandingInstructionHistoryFromAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "productId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "productName": { - "type": "string", - "example": "General Savings" - } - } - }, - "GetStandingInstructionHistoryPageItemsFromClient": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Test client" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetStandingInstructionHistoryPageItemsResponse": { - "type": "object", - "properties": { - "standingInstructionId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "ACC Transfer" - }, - "fromOffice": { - "$ref": "#/definitions/GetFromOfficeStandingInstructionSwagger" - }, - "fromClient": { - "$ref": "#/definitions/GetStandingInstructionHistoryPageItemsFromClient" - }, - "fromAccountType": { - "$ref": "#/definitions/GetFromAccountTypeStandingInstructionSwagger" - }, - "fromAccount": { - "$ref": "#/definitions/GetStandingInstructionHistoryFromAccount" - }, - "toAccountType": { - "$ref": "#/definitions/GetToAccountTypeStandingInstructionSwagger" - }, - "toAccount": { - "$ref": "#/definitions/GetStandingInstructionHistoryToAccount" - }, - "toOffice": { - "$ref": "#/definitions/GetToOfficeStandingInstructionSwagger" - }, - "toClient": { - "$ref": "#/definitions/GetStandingInstructionHistoryToClient" - }, - "amount": { - "type": "number", - "format": "float", - "example": 10 - }, - "status": { - "type": "string", - "example": "success" - }, - "executionTime": { - "type": "string", - "format": "date", - "example": "[2014, 6, 30]" - }, - "errorLog": { - "type": "string", - "example": " " - } - } - }, - "GetStandingInstructionHistoryToAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "productId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "productName": { - "type": "string", - "example": "General Savings" - } - } - }, - "GetStandingInstructionHistoryToClient": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Test client" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetStandingInstructionRunHistoryResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetStandingInstructionHistoryPageItemsResponse" - } - } - } - }, - "GetAccountsChargesCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetAccountsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Client Name" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "Share Product Name" - }, - "status": { - "$ref": "#/definitions/GetAccountsTypeStatus" - }, - "timeline": { - "$ref": "#/definitions/GetAccountsTypeTimeline" - }, - "currency": { - "$ref": "#/definitions/GetAccountsChargesCurrency" - }, - "purchasedShares": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountsTypePurchasedShares" - } - }, - "summary": { - "$ref": "#/definitions/GetAccountsTypeSummary" - } - } - }, - "GetAccountsTypePurchasedShares": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "purchasedDate": { - "type": "string", - "example": "01 May 2013" - }, - "numberOfShares": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "purchasedPrice": { - "type": "integer", - "format": "int32", - "example": 5 - } - } - }, - "GetAccountsTypeResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountsPageItems" - } - } - } - }, - "GetAccountsTypeStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "shareAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetAccountsTypeSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetAccountsChargesCurrency" - } - } - }, - "GetAccountsTypeTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 3, 1]" - } - } - }, - "PostAccountsTypeAccountIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 5 - } - } - }, - "PostAccountsRequestedShares": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 35 - } - } - }, - "PostAccountsTypeAccountIdRequest": { - "type": "object", - "properties": { - "requestedShares": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostAccountsRequestedShares" - } - } - } - }, - "PutAccountsChanges": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "applicationDate": { - "type": "string", - "example": "01 April 2016" - }, - "requestedShares": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutAccountsTypeAccountIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutAccountsChanges" - } - } - }, - "PutAccountsTypeAccountIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "applicationDate": { - "type": "string", - "example": "01 April 2016" - }, - "requestedShares": { - "type": "integer", - "format": "int32", - "example": 20 - } - } - }, - "PostAccountsTypeResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostAccountsCharges": { - "type": "object", - "properties": { - "chargeId": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostAccountsTypeRequest": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "requestedShares": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "externalId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "submittedDate": { - "type": "string", - "example": "01 May 2016" - }, - "minimumActivePeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minimumActivePeriodFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "lockinPeriodFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "lockinPeriodFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "applicationDate": { - "type": "string", - "example": "01 May 2016" - }, - "allowDividendCalculationForInactiveClients": { - "type": "boolean", - "example": true - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "charges": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostAccountsCharges" - } - }, - "savingsAccountId": { - "type": "integer", - "format": "int32", - "example": 13 - } - } - }, - "GetAccountsChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetAccountsChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "code": { - "type": "string", - "example": "chargeTimeType.activation" - }, - "value": { - "type": "string", - "example": "Share Account Activate" - } - } - }, - "GetAccountsCharges": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 9 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Share Account Activation Flat" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetAccountsChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetAccountsChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetAccountsChargesCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 1 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 1 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOrPercentage": { - "type": "number", - "format": "float", - "example": 1 - }, - "isActive": { - "type": "boolean", - "example": true - } - } - }, - "GetAccountsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetAccountsLockPeriodTypeEnum": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "savings.lockin.sharePeriodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetAccountsPurchasedShares": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "purchasedDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 1]" - }, - "numberOfShares": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "purchasedPrice": { - "type": "number", - "format": "double", - "example": 0.5 - }, - "status": { - "$ref": "#/definitions/GetAccountsPurchasedSharesStatus" - }, - "type": { - "$ref": "#/definitions/GetAccountsPurchasedSharesType" - }, - "amount": { - "type": "number", - "format": "double", - "example": 5.05 - }, - "chargeAmount": { - "type": "number", - "format": "double", - "example": 0.05 - }, - "amountPaid": { - "type": "number", - "format": "double", - "example": 5.05 - } - } - }, - "GetAccountsPurchasedSharesStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "purchasedSharesStatusType.approved" - }, - "value": { - "type": "string", - "example": "Approved" - } - } - }, - "GetAccountsPurchasedSharesType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 500 - }, - "code": { - "type": "string", - "example": "purchasedSharesType.purchased" - }, - "value": { - "type": "string", - "example": "Purchase" - } - } - }, - "GetAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "shareAccountStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": false - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": true - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetAccountsSummary": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "totalApprovedShares": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "totalPendingForApprovalShares": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "Conflux Share Product" - }, - "status": { - "$ref": "#/definitions/GetAccountsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetAccountsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetAccountsCurrency" - } - } - }, - "GetAccountsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - }, - "approvedDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 1]" - }, - "approvedByUsername": { - "type": "string", - "example": "mifos" - }, - "approvedByFirstname": { - "type": "string", - "example": "App" - }, - "approvedByLastname": { - "type": "string", - "example": "Administrator" - }, - "activatedDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 1]" - } - } - }, - "GetAccountsTypeAccountIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "savingsAccountNumber": { - "type": "integer", - "format": "int64", - "example": 13 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "clientName": { - "type": "string", - "example": "Client_FirstName_2KX8C Client_LastName_NWNG" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "Share Product" - }, - "status": { - "$ref": "#/definitions/GetAccountsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetAccountsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetAccountsCurrency" - }, - "summary": { - "$ref": "#/definitions/GetAccountsSummary" - }, - "purchasedShares": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountsPurchasedShares" - } - }, - "savingsAccountId": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "currentMarketPrice": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "lockinPeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "lockPeriodTypeEnum": { - "$ref": "#/definitions/GetAccountsLockPeriodTypeEnum" - }, - "minimumActivePeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minimumActivePeriodTypeEnum": { - "$ref": "#/definitions/GetAccountsLockPeriodTypeEnum" - }, - "allowDividendCalculationForInactiveClients": { - "type": "boolean", - "example": true - }, - "charges": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountsCharges" - } - }, - "dividends": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "GetAccountsTypeProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Share Product" - }, - "shortName": { - "type": "string", - "example": "SP" - }, - "totalShares": { - "type": "integer", - "format": "int64", - "example": 100 - } - } - }, - "GetAccountsTypeTemplateResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "clientName": { - "type": "string", - "example": "Client Name" - }, - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountsTypeProductOptions" - } - } - } - }, - "GetFieldConfigurationEntityResponse": { - "type": "object", - "properties": { - "fieldConfigurationId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "entity": { - "type": "string", - "example": "ADDRESS" - }, - "subentity": { - "type": "string", - "example": "CLIENT" - }, - "field": { - "type": "string", - "example": "addressType" - }, - "is_enabled": { - "type": "string", - "example": "true" - }, - "is_mandatory": { - "type": "string", - "example": "false" - }, - "validation_regex": { - "type": "string", - "example": " " - } - } - }, - "GetChargesAppliesToResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeAppliesTo.loan" - }, - "value": { - "type": "string", - "example": "Loan" - } - } - }, - "GetChargesCalculationTypeResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetChargesCurrencyResponse": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetChargesPaymentModeResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargepaymentmode.accounttransfer" - }, - "value": { - "type": "string", - "example": "Account Transfer" - } - } - }, - "GetChargesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Loan Service fee" - }, - "active": { - "type": "string", - "example": "true" - }, - "penalty": { - "type": "string", - "example": "false" - }, - "currency": { - "$ref": "#/definitions/GetChargesCurrencyResponse" - }, - "amount": { - "type": "number", - "format": "float", - "example": 230.56 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetChargesTimeTypeResponse" - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetChargesAppliesToResponse" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetChargesCalculationTypeResponse" - }, - "chargePaymentMode": { - "$ref": "#/definitions/GetChargesPaymentModeResponse" - } - } - }, - "GetChargesTimeTypeResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeTimeType.disbursement" - }, - "value": { - "type": "string", - "example": "Disbursement" - } - } - }, - "GetChargesTemplateFeeFrequencyOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "loanTermFrequency.periodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetChargesTemplateLoanChargeCalculationTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetChargesTemplateLoanChargeTimeTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetChargesTemplateResponse": { - "type": "object", - "properties": { - "active": { - "type": "string", - "example": "false" - }, - "penalty": { - "type": "string", - "example": "false" - }, - "currencyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesCurrencyResponse" - } - }, - "chargeCalculationTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesCalculationTypeResponse" - } - }, - "chargeAppliesToOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesAppliesToResponse" - } - }, - "chargeTimeTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesTimeTypeResponse" - } - }, - "chargePaymentModeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesPaymentModeResponse" - } - }, - "loanChargeCalculationTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesTemplateLoanChargeCalculationTypeOptions" - } - }, - "loanChargeTimeTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesTemplateLoanChargeTimeTypeOptions" - } - }, - "savingsChargeCalculationTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesTemplateLoanChargeCalculationTypeOptions" - } - }, - "savingsChargeTimeTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesTemplateLoanChargeTimeTypeOptions" - } - }, - "feeFrequencyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesTemplateFeeFrequencyOptions" - } - } - } - }, - "PutChargesChargeIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Loan service fee(changed)" - } - } - }, - "PutChargesChargeIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutChargesChargeIdRequest" - } - } - }, - "PostChargesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostChargesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Loan Service fee" - }, - "chargeAppliesTo": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "currencyCode": { - "type": "string", - "example": "USD" - }, - "locale": { - "type": "string", - "example": "en" - }, - "amount": { - "type": "number", - "format": "float", - "example": 230.56 - }, - "chargeTimeType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeCalculationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargePaymentMode": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "active": { - "type": "string", - "example": "true" - } - } - }, - "DeleteChargesChargeIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetClientClientIdAddressesResponse": { - "type": "object", - "properties": { - "client_id": { - "type": "integer", - "format": "int64", - "example": 111755 - }, - "addressType": { - "type": "string", - "example": "PERMANENT ADDRESS" - }, - "addressId": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "addressTypeId": { - "type": "integer", - "format": "int32", - "example": 804 - }, - "isActive": { - "type": "boolean", - "example": false - }, - "street": { - "type": "string", - "example": "anki's home" - }, - "addressLine1": { - "type": "string", - "example": "test123" - }, - "addressLine2": { - "type": "string", - "example": "iuyt" - }, - "addressLine3": { - "type": "string", - "example": " " - }, - "townVillage": { - "type": "string", - "example": " " - }, - "city": { - "type": "string", - "example": "mumbai" - }, - "countyDistrict": { - "type": "string", - "example": " " - }, - "stateProvinceId": { - "type": "integer", - "format": "int32", - "example": 801 - }, - "countryName": { - "type": "string", - "example": "UNITED STATES" - }, - "stateName": { - "type": "string", - "example": "GUJRAT" - }, - "countryId": { - "type": "integer", - "format": "int32", - "example": 807 - }, - "postalCode": { - "type": "integer", - "format": "int64", - "example": 400095 - }, - "createdBy": { - "type": "string", - "example": " " - }, - "updatedBy": { - "type": "string", - "example": " " - } - } - }, - "PutClientClientIdAddressesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 67 - } - } - }, - "PutClientClientIdAddressesRequest": { - "type": "object", - "properties": { - "addressId": { - "type": "integer", - "format": "int32", - "example": 67 - }, - "street": { - "type": "string", - "example": "goldensource" - } - } - }, - "PostClientClientIdAddressesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 15 - } - } - }, - "PostClientClientIdAddressesRequest": { - "type": "object", - "properties": { - "street": { - "type": "string", - "example": "Ipca" - }, - "addressLine1": { - "type": "string", - "example": "Kandivali" - }, - "addressLine2": { - "type": "string", - "example": "plot47" - }, - "addressLine3": { - "type": "string", - "example": "charkop" - }, - "city": { - "type": "string", - "example": "Mumbai" - }, - "stateProvinceId": { - "type": "integer", - "format": "int32", - "example": 800 - }, - "countryId": { - "type": "integer", - "format": "int32", - "example": 802 - }, - "postalCode": { - "type": "integer", - "format": "int64", - "example": 400064 - } - } - }, - "GetClientChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetClientChargeCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetClientChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetClientsChargesPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "name": { - "type": "string", - "example": "Client Fee 1" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetClientChargeTimeType" - }, - "dueDate": { - "type": "string", - "format": "date", - "example": "[2015, 8, 17]" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetClientChargeCalculationType" - }, - "currency": { - "$ref": "#/definitions/GetClientChargeCurrency" - }, - "amount": { - "type": "number", - "example": 100 - }, - "amountPaid": { - "type": "number", - "example": 0 - }, - "amountWaived": { - "type": "number", - "example": 100 - }, - "amountWrittenOff": { - "type": "number", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "example": 0 - }, - "penalty": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - }, - "isPaid": { - "type": "boolean", - "example": false - }, - "isWaived": { - "type": "boolean", - "example": true - } - } - }, - "GetClientsClientIdChargesResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsChargesPageItems" - } - } - } - }, - "PostClientsClientIdChargesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 189 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 164 - } - } - }, - "PostClientsClientIdChargesRequest": { - "type": "object", - "properties": { - "amount": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 226 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "dueDate": { - "type": "string", - "example": "01 September 2015" - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PostClientsClientIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 189 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 157 - }, - "transactionId": { - "type": "integer", - "format": "int32", - "example": 221 - } - } - }, - "PostClientsClientIdChargesChargeIdRequest": { - "type": "object", - "properties": { - "amount": { - "type": "integer", - "format": "int32", - "example": 200 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "transactionDate": { - "type": "string", - "example": "01 September 2015" - } - } - }, - "DeleteClientsClientIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 189 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 164 - } - } - }, - "GetClientsClientIdIdentifiersResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "documentType": { - "$ref": "#/definitions/GetClientsDocumentType" - }, - "documentKey": { - "type": "string", - "example": "12345" - }, - "description": { - "type": "string", - "example": "Issued in the year 2--7" - } - } - }, - "GetClientsDocumentType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "name": { - "type": "string", - "example": "Drivers License" - } - } - }, - "GetClientsAllowedDocumentTypes": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passport" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetClientsClientIdIdentifiersTemplateResponse": { - "type": "object", - "properties": { - "allowedDocumentTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsAllowedDocumentTypes" - } - } - } - }, - "PostClientsClientIdIdentifiersResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "PostClientsClientIdIdentifiersRequest": { - "type": "object", - "properties": { - "documentTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "documentKey": { - "type": "string", - "example": "KA-54677" - }, - "description": { - "type": "string", - "example": "Document has been verified" - } - } - }, - "PutClientsClientIdIdentifiersIdentifierIdRequest": { - "type": "object", - "properties": { - "documentTypeId": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "documentKey": { - "type": "string", - "example": "KA-94667" - }, - "description": { - "type": "string", - "example": "Document has been updated" - } - } - }, - "PutClientsClientIdIdentifiersIdentifierIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "changes": { - "$ref": "#/definitions/PutClientsClientIdIdentifiersIdentifierIdRequest" - } - } - }, - "DeleteClientsClientIdIdentifiersIdentifierIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "GetClientTransactionsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetClientsClientIdTransactionsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsPageItems" - } - } - } - }, - "GetClientsClientIdTransactionsType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "clientTransactionType.payCharge" - }, - "value": { - "type": "string", - "example": "PAY_CHARGE" - } - } - }, - "GetClientsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 226 - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "type": { - "$ref": "#/definitions/GetClientsClientIdTransactionsType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2015, 9, 2]" - }, - "currency": { - "$ref": "#/definitions/GetClientTransactionsCurrency" - }, - "amount": { - "type": "number", - "format": "double", - "example": 22 - }, - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2015, 9, 2]" - }, - "reversed": { - "type": "boolean", - "example": false - } - } - }, - "GetClientsClientIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "type": { - "$ref": "#/definitions/GetClientsClientIdTransactionsType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2015, 8, 17]" - }, - "currency": { - "$ref": "#/definitions/GetClientTransactionsCurrency" - }, - "amount": { - "type": "number", - "example": 60 - }, - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2015, 8, 17]" - }, - "reversed": { - "type": "boolean", - "example": true - } - } - }, - "PostClientsClientIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 189 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 222 - } - } - }, - "GetClientsClientIdAccountsResponse": { - "type": "object", - "properties": { - "loanAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsLoanAccounts" - } - }, - "savingsAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsSavingsAccounts" - } - } - } - }, - "GetClientsLoanAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "externalId": { - "type": "integer", - "format": "int32", - "example": 456 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "TestOne" - }, - "status": { - "$ref": "#/definitions/GetClientsLoanAccountsStatus" - }, - "loanType": { - "$ref": "#/definitions/GetClientsLoanAccountsType" - }, - "loanCycle": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetClientsLoanAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "loanStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - }, - "pendingApproval": { - "type": "boolean", - "example": false - }, - "waitingForDisbursal": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": true - }, - "closedObligationsMet": { - "type": "boolean", - "example": false - }, - "closedWrittenOff": { - "type": "boolean", - "example": false - }, - "closedRescheduled": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "overpaid": { - "type": "boolean", - "example": false - } - } - }, - "GetClientsLoanAccountsType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "loanType.individual" - }, - "value": { - "type": "string", - "example": "Individual" - } - } - }, - "GetClientsSavingsAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 7 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "productName": { - "type": "string", - "example": "Other product" - }, - "status": { - "$ref": "#/definitions/GetClientsSavingsAccountsStatus" - }, - "currency": { - "$ref": "#/definitions/GetClientsSavingsAccountsCurrency" - } - } - }, - "GetClientsSavingsAccountsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetClientsSavingsAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetClientStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "clientStatusType.pending" - }, - "value": { - "type": "string", - "example": "Pending" - } - } - }, - "GetClientsPageItemsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNo": { - "type": "string", - "example": "000000002" - }, - "status": { - "$ref": "#/definitions/GetClientStatus" - }, - "active": { - "type": "boolean", - "example": false - }, - "fullname": { - "type": "string", - "example": "Home Farm Produce" - }, - "displayName": { - "type": "string", - "example": "Home Farm Produce" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetClientsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsPageItemsResponse" - } - } - } - }, - "GetClientsClientIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 27 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 27 - }, - "status": { - "$ref": "#/definitions/GetClientsClientIdStatus" - }, - "active": { - "type": "boolean", - "example": true - }, - "activationDate": { - "type": "string", - "format": "date", - "example": "[2013, 1, 1]" - }, - "firstname": { - "type": "string", - "example": "savings" - }, - "lastname": { - "type": "string", - "example": "test" - }, - "displayName": { - "type": "string", - "example": "savings test" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "timeline": { - "$ref": "#/definitions/GetClientsTimeline" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "savingsProductName": { - "type": "string", - "example": "account overdraft" - }, - "groups": { - "type": "array", - "example": "[]", - "items": { - "type": "string" - } - } - } - }, - "GetClientsClientIdStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "clientStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - } - } - }, - "GetClientsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 1, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - }, - "activatedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 1, 1]" - }, - "activatedByUsername": { - "type": "string", - "example": "mifos" - }, - "activatedByFirstname": { - "type": "string", - "example": "App" - }, - "activatedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "GetClientsColumnHeaderData": { - "type": "object", - "properties": { - "columnName": { - "type": "string", - "example": "client_id" - }, - "columnType": { - "type": "string", - "example": "bigint" - }, - "columnLength": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "columnDisplayType": { - "type": "string", - "example": "INTEGER" - }, - "isColumnNullable": { - "type": "boolean", - "example": false - }, - "isColumnPrimaryKey": { - "type": "boolean", - "example": true - }, - "columnValues": { - "type": "array", - "example": "[]", - "items": { - "type": "string" - } - } - } - }, - "GetClientsDataTables": { - "type": "object", - "properties": { - "applicationTableName": { - "type": "string", - "example": "m_client" - }, - "registeredTableName": { - "type": "string", - "example": "Address Details" - }, - "columnHeaderData": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsColumnHeaderData" - } - } - } - }, - "GetClientsOfficeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetClientsSavingProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "account overdraft" - }, - "withdrawalFeeForTransfers": { - "type": "boolean", - "example": false - }, - "allowOverdraft": { - "type": "boolean", - "example": false - } - } - }, - "GetClientsStaffOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "firstname": { - "type": "string", - "example": "xyz" - }, - "lastname": { - "type": "string", - "example": "sjs" - }, - "displayName": { - "type": "string", - "example": "sjs, xyz" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "isLoanOfficer": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - } - } - }, - "GetClientsTemplateResponse": { - "type": "object", - "properties": { - "activationDate": { - "type": "string", - "format": "date", - "example": "[2014, 3, 4]" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsOfficeOptions" - } - }, - "staffOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsStaffOptions" - } - }, - "savingProductOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsSavingProductOptions" - } - }, - "datatables": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientsDataTables" - } - } - } - }, - "PostClientsClientIdResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostClientsClientIdRequest": { - "type": "object", - "properties": { - "note": { - "type": "string", - "example": "We cannot accept transfers of clients having loans with less than 1 repayment left" - } - } - }, - "PutClientsClientIdRequest": { - "type": "object", - "properties": { - "externalId": { - "type": "string", - "example": "786444UUUYYH7" - } - } - }, - "PutClientsClientIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutClientsClientIdRequest" - } - } - }, - "DeleteClientsClientIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "DeleteClientsClientIdRequest": { - "type": "object" - }, - "PostClientsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostClientsRequest": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fullname": { - "type": "string", - "example": "Client of group" - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "active": { - "type": "boolean", - "example": true - }, - "activationDate": { - "type": "string", - "example": "04 March 2009" - } - } - }, - "GetCollateralsTemplateAllowedTypes": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 9 - }, - "name": { - "type": "string", - "example": "Silver" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetLoansLoanIdCollateralsTemplateResponse": { - "type": "object", - "properties": { - "allowedCollateralTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetCollateralsTemplateAllowedTypes" - } - } - } - }, - "GetCollateralCurrencyResponse": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetCollateralTypeResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "name": { - "type": "string", - "example": "Gold" - } - } - }, - "GetLoansLoanIdCollateralsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "type": { - "$ref": "#/definitions/GetCollateralTypeResponse" - }, - "value": { - "type": "integer", - "format": "int64", - "example": 50000 - }, - "description": { - "type": "string", - "example": "24 Carat Gold chain weighing 12 grams" - }, - "currency": { - "$ref": "#/definitions/GetCollateralCurrencyResponse" - } - } - }, - "PutLoansLoanIdCollateralsCollateralIdResponse": { - "type": "object", - "properties": { - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "changes": { - "$ref": "#/definitions/PutLoansLoandIdCollateralsCollateralIdRequest" - } - } - }, - "PutLoansLoandIdCollateralsCollateralIdRequest": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "22 Carat Gold chain weighing 12 grams" - } - } - }, - "PostLoansLoanIdCollateralsResponse": { - "type": "object", - "properties": { - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 12 - } - } - }, - "PostLoansLoanIdCollateralsRequest": { - "type": "object", - "properties": { - "collateralTypeId": { - "type": "integer", - "format": "int32", - "example": 9 - } - } - }, - "DeleteLoansLoanIdCollateralsCollateralIdResponse": { - "type": "object", - "properties": { - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 12 - } - } - }, - "PostCollectionSheetChanges": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "loanTransactions": { - "type": "array", - "example": "[15]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "SavingsTransactions": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "PostCollectionSheetResponse": { - "type": "object", - "properties": { - "groupId": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "changes": { - "$ref": "#/definitions/PostCollectionSheetChanges" - } - } - }, - "PostCollectionSheetBulkRepaymentTransactions": { - "type": "object", - "properties": { - "loanId": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "transactionAmount": { - "type": "number", - "format": "double", - "example": 1221.36 - }, - "paymentTypeId": { - "type": "integer", - "format": "int32", - "example": 19 - }, - "receiptNumber": { - "type": "integer", - "format": "int64", - "example": 1245356 - } - } - }, - "PostCollectionSheetRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "transactionDate": { - "type": "string", - "example": "04 May 2014" - }, - "actualDisbursementDate": { - "type": "string", - "example": "04 May 2014" - }, - "bulkDisbursementTransactions": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - }, - "bulkRepaymentTransactions": { - "$ref": "#/definitions/PostCollectionSheetBulkRepaymentTransactions" - }, - "bulkSavingsDueTransactions": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "PostFloatingRatesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostFloatingRatesRatePeriods": { - "type": "object", - "properties": { - "fromDate": { - "type": "string", - "example": "19 November 2015" - }, - "interestRate": { - "type": "number", - "format": "double", - "example": 10 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - } - } - }, - "PostFloatingRatesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Floating Rate 1" - }, - "isBaseLendingRate": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - }, - "ratePeriods": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostFloatingRatesRatePeriods" - } - } - } - }, - "GetFloatingRatesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Floating Rate 1" - }, - "isBaseLendingRate": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - }, - "createdBy": { - "type": "string", - "example": "mifos" - }, - "createdOn": { - "type": "string", - "example": "Nov 18, 2015" - }, - "modifiedBy": { - "type": "string", - "example": "mifos" - }, - "modifiedOn": { - "type": "string", - "example": "Nov 18, 2015" - } - } - }, - "PutFloatingRatesChanges": { - "type": "object", - "properties": { - "ratePeriods": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostFloatingRatesRatePeriods" - } - } - } - }, - "PutFloatingRatesFloatingRateIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutFloatingRatesChanges" - } - } - }, - "PutFloatingRatesFloatingRateIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Floating Rate 1" - }, - "isBaseLendingRate": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - }, - "ratePeriods": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostFloatingRatesRatePeriods" - } - } - } - }, - "GetFloatingRatesFloatingRateIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Floating Rate 1" - }, - "isBaseLendingRate": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - }, - "createdBy": { - "type": "string", - "example": "mifos" - }, - "createdOn": { - "type": "string", - "example": "Nov 18, 2015" - }, - "modifiedBy": { - "type": "string", - "example": "mifos" - }, - "modifiedOn": { - "type": "string", - "example": "Nov 18, 2015" - }, - "ratePeriods": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFloatingRatesRatePeriods" - } - } - } - }, - "GetFloatingRatesRatePeriods": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromDate": { - "type": "string", - "example": "Dec 15, 2015" - }, - "interestRate": { - "type": "number", - "format": "double", - "example": 11 - }, - "isDifferentialToBaseLendingRate": { - "type": "boolean", - "example": false - }, - "isActive": { - "type": "boolean", - "example": true - }, - "createdBy": { - "type": "string", - "example": "mifos" - }, - "createdOn": { - "type": "string", - "example": "Nov 18, 2015" - }, - "modifiedBy": { - "type": "string", - "example": "mifos" - }, - "modifiedOn": { - "type": "string", - "example": "Nov 18, 2015" - } - } - }, - "PostFundsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostFundsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "EU Agri Fund" - } - } - }, - "GetFundsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "EU Agri Fund" - } - } - }, - "PutFundsFundIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "EU Agri Fund (2010-2020)" - } - } - }, - "PutFundsFundIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutFundsFundIdRequest" - } - } - }, - "GetCentersAccountType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.group" - }, - "value": { - "type": "string", - "example": "Group" - } - } - }, - "GetCentersCenterIdAccountsResponse": { - "type": "object", - "properties": { - "savingsAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetCentersSavingsAccounts" - } - } - } - }, - "GetCentersCenterIdCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetCentersCenterIdStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "prematureClosed": { - "type": "boolean", - "example": false - }, - "transferInProgress": { - "type": "boolean", - "example": false - }, - "transferOnHold": { - "type": "boolean", - "example": false - } - } - }, - "GetCentersDepositType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "depositAccountType.savingsDeposit" - }, - "value": { - "type": "string", - "example": "Savings" - } - } - }, - "GetCentersSavingsAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 16 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "Voluntary savings" - }, - "status": { - "$ref": "#/definitions/GetCentersCenterIdStatus" - }, - "currency": { - "$ref": "#/definitions/GetCentersCenterIdCurrency" - }, - "accountType": { - "$ref": "#/definitions/GetCentersAccountType" - }, - "timeline": { - "$ref": "#/definitions/GetCentersTimeline" - }, - "depositType": { - "$ref": "#/definitions/GetCentersDepositType" - } - } - }, - "GetCentersTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2014, 5, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "GetCentersPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "status": { - "$ref": "#/definitions/GetCentersStatus" - }, - "active": { - "type": "boolean", - "example": false - }, - "name": { - "type": "string", - "example": "Center 1" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "hierarchy": { - "type": "string", - "example": ".2." - } - } - }, - "GetCentersResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetCentersPageItems" - } - } - } - }, - "GetCentersStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "groupingStatusType.pending" - }, - "value": { - "type": "string", - "example": "Pending" - } - } - }, - "GetCentersCenterIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "status": { - "$ref": "#/definitions/GetCentersStatus" - }, - "active": { - "type": "boolean", - "example": false - }, - "name": { - "type": "string", - "example": "First Center (No groups)" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "hierarchy": { - "type": "string", - "example": ".8." - } - } - }, - "GetCentersOfficeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetCentersStaffOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displayName": { - "type": "string", - "example": "D, Mary" - } - } - }, - "GetCentersTemplateResponse": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "example": false - }, - "activationDate": { - "type": "string", - "format": "date", - "example": "[2013, 4, 18]" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "officeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetCentersOfficeOptions" - } - }, - "staffOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetCentersStaffOptions" - } - } - } - }, - "PostCentersCenterIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostCentersCenterIdRequest": { - "type": "object", - "properties": { - "closureReasonId": { - "type": "integer", - "format": "int32", - "example": 32 - }, - "closureDate": { - "type": "string", - "example": "05 May 2014" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - } - } - }, - "PutCentersCenterIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "changes": { - "$ref": "#/definitions/PutCentersChanges" - } - } - }, - "PutCentersChanges": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "First Center (No groups) - modified" - } - } - }, - "PutCentersCenterIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "First Center (No groups)" - } - } - }, - "DeleteCentersCenterIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/DeleteCentersChanges" - } - } - }, - "DeleteCentersChanges": { - "type": "object" - }, - "PostCentersResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 8 - } - } - }, - "PostCentersRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "First Center (No groups)" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "active": { - "type": "boolean", - "example": false - } - } - }, - "PostGroupsGroupIdCommandUnassignStaffChanges": { - "type": "object" - }, - "PostGroupsGroupIdCommandUnassignStaffResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PostGroupsGroupIdCommandUnassignStaffChanges" - } - } - }, - "PostGroupsGroupIdCommandUnassignStaffRequest": { - "type": "object", - "properties": { - "staffId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostGroupsGroupIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostGroupsGroupIdClients": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostGroupsGroupIdRequest": { - "type": "object", - "properties": { - "destinationGroupId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clients": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostGroupsGroupIdClients" - } - } - } - }, - "GetGroupsGroupIdAccountsLoanAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "productName": { - "type": "string", - "example": "daily product" - }, - "status": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsStatus" - }, - "loanType": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsLoanType" - } - } - }, - "GetGroupsGroupIdAccountsLoanType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.group" - }, - "value": { - "type": "string", - "example": "Group" - } - } - }, - "GetGroupsGroupIdAccountsMemberLoanAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 4 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "testLoan" - }, - "status": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsMemberLoanStatus" - }, - "loanType": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsMemberLoanType" - } - } - }, - "GetGroupsGroupIdAccountsMemberLoanStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 200 - }, - "code": { - "type": "string", - "example": "loanStatusType.approved" - }, - "value": { - "type": "string", - "example": "Approved" - }, - "pendingApproval": { - "type": "boolean", - "example": false - }, - "waitingForDisbursal": { - "type": "boolean", - "example": true - }, - "active": { - "type": "boolean", - "example": false - }, - "closedObligationsMet": { - "type": "boolean", - "example": false - }, - "closedWrittenOff": { - "type": "boolean", - "example": false - }, - "closedRescheduled": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "overpaid": { - "type": "boolean", - "example": false - } - } - }, - "GetGroupsGroupIdAccountsMemberLoanType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "accountType.jlg" - }, - "value": { - "type": "string", - "example": "JLG" - } - } - }, - "GetGroupsGroupIdAccountsMemberSavingsAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 3 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "p_sav" - }, - "status": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsSavingStatus" - }, - "currency": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsSavingCurrency" - }, - "accountType": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsMemberLoanType" - } - } - }, - "GetGroupsGroupIdAccountsResponse": { - "type": "object", - "properties": { - "loanAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsLoanAccounts" - } - }, - "savingsAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsSavingAccounts" - } - }, - "memberLoanAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsMemberLoanAccounts" - } - }, - "memberSavingsAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsMemberSavingsAccounts" - } - } - } - }, - "GetGroupsGroupIdAccountsSavingAccountType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.group" - }, - "value": { - "type": "string", - "example": "Group" - } - } - }, - "GetGroupsGroupIdAccountsSavingAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 9 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 9 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "p_sav" - }, - "status": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsSavingStatus" - }, - "currency": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsSavingCurrency" - }, - "accountType": { - "$ref": "#/definitions/GetGroupsGroupIdAccountsSavingAccountType" - } - } - }, - "GetGroupsGroupIdAccountsSavingCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetGroupsGroupIdAccountsSavingStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetGroupsGroupIdAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "loanStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "pendingApproval": { - "type": "boolean", - "example": true - }, - "waitingForDisbursal": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closedObligationsMet": { - "type": "boolean", - "example": false - }, - "closedWrittenOff": { - "type": "boolean", - "example": false - }, - "closedRescheduled": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "overpaid": { - "type": "boolean", - "example": false - } - } - }, - "GetGroupsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "AnotherGroup" - }, - "status": { - "$ref": "#/definitions/GetGroupsStatus" - }, - "active": { - "type": "boolean", - "example": false - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "hierarchy": { - "type": "string", - "example": ".4." - } - } - }, - "GetGroupsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsPageItems" - } - } - } - }, - "GetGroupsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "clientStatusType.pending" - }, - "value": { - "type": "string", - "example": "Pending" - } - } - }, - "GetGroupsGroupIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "First Group" - }, - "externalId": { - "type": "string", - "example": "000-1A" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "hierarchy": { - "type": "string", - "example": ".1." - }, - "timeline": { - "$ref": "#/definitions/GetGroupsGroupIdTimeline" - } - } - }, - "GetGroupsGroupIdTimeline": { - "type": "object", - "properties": { - "activatedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 11, 14]" - }, - "activatedByUsername": { - "type": "string", - "example": "mifos" - }, - "activatedByFirstname": { - "type": "string", - "example": "App" - }, - "activatedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "GetGroupsTemplateClientOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "Petra Yton" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetGroupsTemplateColumnHeaderData": { - "type": "object", - "properties": { - "columnName": { - "type": "string", - "example": "group_id" - }, - "columnType": { - "type": "string", - "example": "bigint" - }, - "columnLength": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "columnDisplayType": { - "type": "string", - "example": "INTEGER" - }, - "isColumnNullable": { - "type": "boolean", - "example": false - }, - "isColumnPrimaryKey": { - "type": "boolean", - "example": true - }, - "columnValues": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsTemplateColumnValues" - } - } - } - }, - "GetGroupsTemplateColumnValues": { - "type": "object" - }, - "GetGroupsTemplateDatatables": { - "type": "object", - "properties": { - "applicationTableName": { - "type": "string", - "example": "m_group" - }, - "registeredTableName": { - "type": "string", - "example": "Group Activation Data" - }, - "columnHeaderData": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsTemplateColumnHeaderData" - } - } - } - }, - "GetGroupsTemplateOfficeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Head Office" - }, - "nameDecorated": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetGroupsTemplateResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsTemplateOfficeOptions" - } - }, - "staffOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsTemplateStaffOptions" - } - }, - "clientOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsTemplateClientOptions" - } - }, - "datatables": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetGroupsTemplateDatatables" - } - } - } - }, - "GetGroupsTemplateStaffOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displayName": { - "type": "string", - "example": "C, Mike" - } - } - }, - "PutGroupsGroupIdChanges": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "First Group (changed)" - } - } - }, - "PutGroupsGroupIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutGroupsGroupIdChanges" - } - } - }, - "PutGroupsGroupIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "First Group (changed)" - } - } - }, - "DeleteGroupsGroupIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostGroupsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "groupId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostGroupsRequest": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Pending Group" - }, - "active": { - "type": "boolean", - "example": false - } - } - }, - "GetInterestRateChartsChartIdChartSlabsAttributeName": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "integer", - "format": "int32", - "example": "InterestIncentiveAttributeName.gender" - }, - "value": { - "type": "integer", - "format": "int32", - "example": "Gender" - } - } - }, - "GetInterestRateChartsChartIdChartSlabsConditionType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "integer", - "format": "int32", - "example": "incentiveConditionType.equal" - }, - "value": { - "type": "integer", - "format": "int32", - "example": "equal" - } - } - }, - "GetInterestRateChartsChartIdChartSlabsEntityType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "integer", - "format": "int32", - "example": "InterestIncentiveEntityType.customer" - }, - "value": { - "type": "integer", - "format": "int32", - "example": "Customer" - } - } - }, - "GetInterestRateChartsChartIdChartSlabsIncentiveType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "integer", - "format": "int32", - "example": "InterestIncentiveType.incentive" - }, - "value": { - "type": "integer", - "format": "int32", - "example": "Incentive" - } - } - }, - "GetInterestRateChartsChartIdChartSlabsIncentives": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "entityType": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsEntityType" - }, - "attributeName": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsAttributeName" - }, - "conditionType": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsConditionType" - }, - "attributeValue": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "attributeValueDesc": { - "type": "string", - "example": "FEMALE" - }, - "incentiveType": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsIncentiveType" - }, - "amount": { - "type": "number", - "format": "float", - "example": -1 - } - } - }, - "GetInterestRateChartsChartIdChartSlabsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "description": { - "type": "string", - "example": "5% interest from 1 day till 180 days of deposit" - }, - "periodTypes": { - "$ref": "#/definitions/GetInterestRateChartsTemplatePeriodTypes" - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 180 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 5 - }, - "currency": { - "$ref": "#/definitions/GetInterestRateChartsCurrency" - }, - "incentives": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetInterestRateChartsChartIdChartSlabsIncentives" - } - } - } - }, - "GetInterestRateChartsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetInterestRateChartsTemplatePeriodTypes": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest": { - "type": "object", - "properties": { - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 6 - }, - "description": { - "type": "string", - "example": "Interest rate changed to 6%" - } - } - }, - "PutInterestRateChartsChartIdChartSlabsChartSlabIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutInterestRateChartsChartIdChartSlabsChartSlabIdRequest" - } - } - }, - "DeleteInterestRateChartsChartIdChartSlabsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostInterestRateChartsChartIdChartSlabsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostInterestRateChartsChartIdChartSlabsIncentives": { - "type": "object", - "properties": { - "entityType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "attributeName": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "conditionType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "attributeValue": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "incentiveType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "amount": { - "type": "number", - "format": "float", - "example": -1 - } - } - }, - "PostInterestRateChartsChartIdChartSlabsRequest": { - "type": "object", - "properties": { - "periodType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 180 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 5 - }, - "description": { - "type": "string", - "example": "5% interest from 1 day till 180 days of deposit" - }, - "locale": { - "type": "string", - "example": "en" - }, - "incentives": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostInterestRateChartsChartIdChartSlabsIncentives" - } - } - } - }, - "GetInterestRateChartsChartSlabs": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "periodTypes": { - "$ref": "#/definitions/GetInterestRateChartsTemplatePeriodTypes" - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "annualInterestRate": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "currency": { - "$ref": "#/definitions/GetInterestRateChartsCurrency" - } - } - }, - "GetInterestRateChartsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "[2014, 1, 1]" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsProductName": { - "type": "string", - "example": "Fixed Deposit Product 001" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetInterestRateChartsChartSlabs" - } - } - } - }, - "GetInterestRateChartsTemplateResponse": { - "type": "object", - "properties": { - "periodTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetInterestRateChartsTemplatePeriodTypes" - } - } - } - }, - "PutInterestRateChartsChartIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PutInterestRateChartsChartIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Interest rate chart for 2014" - }, - "description": { - "type": "string", - "example": "Interest rate chart for 2014" - } - } - }, - "DeleteInterestRateChartsChartIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostInterestRateChartsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostInterestRateChartsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Chart - 2014" - }, - "description": { - "type": "string", - "example": "This chart is applicable for year 2014" - }, - "type": { - "type": "string", - "example": "Document" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "fromDate": { - "type": "string", - "example": "01 Jan 2014" - } - } - }, - "DeleteLoansLoanIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "GetLoanChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetLoanChargeCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetLoanChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeTimeType.disbursement" - }, - "value": { - "type": "string", - "example": "Disbursement" - } - } - }, - "GetLoansLoanIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Loan Processing fee" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetLoanChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetLoanChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetLoanChargeCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountOrPercentage": { - "type": "number", - "format": "float", - "example": 100 - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "PostLoansLoanIdChargesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 31 - } - } - }, - "PostLoansLoanIdChargesRequest": { - "type": "object", - "properties": { - "chargeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "locale": { - "type": "string", - "example": "en" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "dueDate": { - "type": "string", - "example": "29 April 2013" - } - } - }, - "PostLoansLoanIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int64", - "example": 6 - }, - "savingsId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 12 - } - } - }, - "PostLoansLoanIdChargesChargeIdRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "transactionDate": { - "type": "string", - "example": "19 September 2013" - } - } - }, - "PutLoansLoanIdChargesChargeIdRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "amount": { - "type": "number", - "format": "float", - "example": 60 - }, - "dueDate": { - "type": "string", - "example": "27 March 2013" - } - } - }, - "PutLoansLoanIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "changes": { - "$ref": "#/definitions/PutLoansLoanIdChargesChargeIdRequest" - } - } - }, - "GetLoanChargeTemplateChargeAppliesTo": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": "1 " - }, - "code": { - "type": "string", - "example": "chargeAppliesTo.loan" - }, - "value": { - "type": "string", - "example": "Loan" - } - } - }, - "GetLoanChargeTemplateChargeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Collection fee" - }, - "active": { - "type": "boolean", - "example": true - }, - "penalty": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetLoanChargeCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetLoanChargeTemplateChargeTimeType" - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetLoanChargeTemplateChargeAppliesTo" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetLoanChargeCalculationType" - } - } - }, - "GetLoanChargeTemplateChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetLoansLoanIdChargesTemplateResponse": { - "type": "object", - "properties": { - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "chargeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanChargeTemplateChargeOptions" - } - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "PostLoanChanges": { - "type": "object", - "properties": { - "removedEntityIds": { - "type": "array", - "example": "[21, 22]", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "PostLoansLoanIdScheduleResponse": { - "type": "object", - "properties": { - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PostLoanChanges" - } - } - }, - "PostLoansLoanIdScheduleRequest": { - "type": "object" - }, - "GetLoansCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetLoansLoanIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "type": { - "$ref": "#/definitions/GetLoansType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2012, 5, 14]" - }, - "manuallyReversed": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetLoansCurrency" - }, - "amount": { - "type": "number", - "format": "double", - "example": 559.88 - }, - "interestPortion": { - "type": "number", - "format": "double", - "example": 559.88 - } - } - }, - "GetLoansType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "loanTransactionType.repayment" - }, - "value": { - "type": "string", - "example": "Repayment" - }, - "disbursement": { - "type": "boolean", - "example": false - }, - "repaymentAtDisbursement": { - "type": "boolean", - "example": false - }, - "repayment": { - "type": "boolean", - "example": true - }, - "contra": { - "type": "boolean", - "example": false - }, - "waiveInterest": { - "type": "boolean", - "example": false - }, - "waiveCharges": { - "type": "boolean", - "example": false - }, - "writeOff": { - "type": "boolean", - "example": false - }, - "recoveryRepayment": { - "type": "boolean", - "example": false - } - } - }, - "GetLoansLoanIdTransactionsTemplateResponse": { - "type": "object", - "properties": { - "transactionType": { - "$ref": "#/definitions/GetLoansTransactionType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2009, 8, 1]" - }, - "total": { - "$ref": "#/definitions/GetLoansTotal" - } - } - }, - "GetLoansTotal": { - "type": "object", - "properties": { - "currencyCode": { - "type": "string", - "example": "XOF" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amount": { - "type": "number", - "format": "float", - "example": 471 - }, - "defaultName": { - "type": "string", - "example": "CFA Franc BCEAO" - }, - "nameCode": { - "type": "string", - "example": "currency.XOF" - }, - "displaySymbol": { - "type": "string", - "example": "CFA" - }, - "zero": { - "type": "boolean", - "example": false - }, - "greaterThanZero": { - "type": "boolean", - "example": true - }, - "displaySymbolValue": { - "type": "string", - "example": "471 CFA" - } - } - }, - "GetLoansTransactionType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "loanTransactionType.repayment" - }, - "value": { - "type": "string", - "example": "Repayment" - } - } - }, - "PostLoansLoanIdTransactionsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 22 - } - } - }, - "PostLoansLoanIdTransactionsRequest": { - "type": "object" - }, - "PostLoansLoanIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 16 - } - } - }, - "PostLoansLoanIdTransactionsTransactionIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en_GB" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "transactionDate": { - "type": "string", - "example": "25 May 2012" - }, - "transactionAmount": { - "type": "number", - "format": "double", - "example": "50,000.00" - }, - "note": { - "type": "string", - "example": "An optional note about why your adjusting or changing the transaction." - } - } - }, - "GetLoansLoanIdAmortizationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "amortizationType.equal.installments" - }, - "value": { - "type": "string", - "example": "Equal installments" - } - } - }, - "GetLoansLoanIdChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.percent.of.amount" - }, - "value": { - "type": "string", - "example": "% Amount" - } - } - }, - "GetLoansLoanIdChargePaymentMode": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "chargepaymentmode.regular" - }, - "value": { - "type": "string", - "example": "Regular" - } - } - }, - "GetLoansLoanIdChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 9 - }, - "code": { - "type": "string", - "example": "chargeTimeType.overdueInstallment" - }, - "value": { - "type": "string", - "example": "overdue fees" - } - } - }, - "GetLoansLoanIdCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "UGX" - }, - "name": { - "type": "string", - "example": "Uganda Shilling" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "USh" - }, - "nameCode": { - "type": "string", - "example": "currency.UGX" - }, - "displayLabel": { - "type": "string", - "example": "Uganda Shilling (USh)" - } - } - }, - "GetLoansLoanIdDisbursementDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 71 - }, - "expectedDisbursementDate": { - "type": "string", - "format": "date", - "example": "[2013, 11, 1]" - }, - "principal": { - "type": "number", - "format": "float", - "example": 22000 - }, - "approvedPrincipal": { - "type": "number", - "format": "float", - "example": 22000 - } - } - }, - "GetLoansLoanIdEmiVariations": { - "type": "object" - }, - "GetLoansLoanIdFeeFrequency": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "feeFrequencyperiodFrequencyType.weeks" - }, - "value": { - "type": "string", - "example": "Weeks" - } - } - }, - "GetLoansLoanIdInterestCalculationPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestCalculationPeriodType.same.as.repayment.period" - }, - "value": { - "type": "string", - "example": "Same as repayment period" - } - } - }, - "GetLoansLoanIdInterestRateFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "interestRateFrequency.periodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Per year" - } - } - }, - "GetLoansLoanIdInterestType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetLoansLoanIdLinkedAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetLoansLoanIdLoanType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "loanType.individual" - }, - "value": { - "type": "string", - "example": "Individual" - } - } - }, - "GetLoansLoanIdOverdueCharges": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "name": { - "type": "string", - "example": "overdraft penality" - }, - "active": { - "type": "boolean", - "example": true - }, - "penalty": { - "type": "boolean", - "example": true - }, - "currency": { - "$ref": "#/definitions/GetLoanCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 3 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetLoansLoanIdChargeTimeType" - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetLoanChargeTemplateChargeAppliesTo" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetLoansLoanIdChargeCalculationType" - }, - "chargePaymentMode": { - "$ref": "#/definitions/GetLoansLoanIdChargePaymentMode" - }, - "feeInterval": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "feeFrequency": { - "$ref": "#/definitions/GetLoansLoanIdFeeFrequency" - } - } - }, - "GetLoansLoanIdRepaymentFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "repaymentFrequency.periodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetLoansLoanIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "status": { - "$ref": "#/definitions/GetLoansLoanIdStatus" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Kampala first Client" - }, - "clientOfficeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "loanProductId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanProductName": { - "type": "string", - "example": "Kampala Product (with cash accounting)" - }, - "loanProductDescription": { - "type": "string", - "example": "Typical Kampala loan product with cash accounting enabled for testing." - }, - "loanPurposeId": { - "type": "integer", - "format": "int32", - "example": 22 - }, - "loanPurposeName": { - "type": "string", - "example": "option.HousingImprovement" - }, - "loanOfficerId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "loanOfficerName": { - "type": "string", - "example": "LoanOfficer, Kampala" - }, - "loanType": { - "$ref": "#/definitions/GetLoansLoanIdLoanType" - }, - "currency": { - "$ref": "#/definitions/GetLoansLoanIdCurrency" - }, - "principal": { - "type": "integer", - "format": "int64", - "example": 1000000 - }, - "termFrequency": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "termPeriodFrequencyType": { - "$ref": "#/definitions/GetLoansLoanIdTermPeriodFrequencyType" - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "$ref": "#/definitions/GetLoansLoanIdRepaymentFrequencyType" - }, - "interestRatePerPeriod": { - "type": "integer", - "format": "int32", - "example": 24 - }, - "interestRateFrequencyType": { - "$ref": "#/definitions/GetLoansLoanIdInterestRateFrequencyType" - }, - "annualInterestRate": { - "type": "integer", - "format": "int32", - "example": 24 - }, - "amortizationType": { - "$ref": "#/definitions/GetLoansLoanIdAmortizationType" - }, - "interestType": { - "$ref": "#/definitions/GetLoansLoanIdInterestType" - }, - "interestCalculationPeriodType": { - "$ref": "#/definitions/GetLoansLoanIdInterestCalculationPeriodType" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "timeline": { - "$ref": "#/definitions/GetLoansLoanIdTimeline" - }, - "summary": { - "$ref": "#/definitions/GetLoansLoanIdSummary" - } - } - }, - "GetLoansLoanIdStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "loanStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - }, - "pendingApproval": { - "type": "boolean", - "example": false - }, - "waitingForDisbursal": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": true - }, - "closedObligationsMet": { - "type": "boolean", - "example": false - }, - "closedWrittenOff": { - "type": "boolean", - "example": false - }, - "closedRescheduled": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "overpaid": { - "type": "boolean", - "example": false - } - } - }, - "GetLoansLoanIdSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetLoansLoanIdCurrency" - }, - "principalDisbursed": { - "type": "integer", - "format": "int64", - "example": 1000000 - }, - "principalPaid": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "principalWrittenOff": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "principalOutstanding": { - "type": "integer", - "format": "int64", - "example": 1000000 - }, - "principalOverdue": { - "type": "number", - "format": "double", - "example": 833333.3 - }, - "interestCharged": { - "type": "integer", - "format": "int64", - "example": 240000 - }, - "interestPaid": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "interestWaived": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "interestWrittenOff": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "interestOutstanding": { - "type": "integer", - "format": "int64", - "example": 240000 - }, - "interestOverdue": { - "type": "integer", - "format": "int64", - "example": 200000 - }, - "feeChargesCharged": { - "type": "integer", - "format": "int64", - "example": 18000 - }, - "feeChargesDueAtDisbursementCharged": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "feeChargesPaid": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "feeChargesWaived": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "feeChargesWrittenOff": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "feeChargesOutstanding": { - "type": "integer", - "format": "int64", - "example": 18000 - }, - "feeChargesOverdue": { - "type": "integer", - "format": "int64", - "example": 15000 - }, - "penaltyChargesCharged": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "penaltyChargesPaid": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "penaltyChargesWaived": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "penaltyChargesWrittenOff": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "penaltyChargesOutstanding": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "penaltyChargesOverdue": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalExpectedRepayment": { - "type": "integer", - "format": "int64", - "example": 1258000 - }, - "totalRepayment": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalExpectedCostOfLoan": { - "type": "integer", - "format": "int64", - "example": 258000 - }, - "totalCostOfLoan": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalWaived": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalWrittenOff": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalOutstanding": { - "type": "integer", - "format": "int64", - "example": 1258000 - }, - "totalOverdue": { - "type": "number", - "format": "double", - "example": 1048333.3 - }, - "overdueSinceDate": { - "type": "string", - "format": "date", - "example": "[2012, 5, 10]" - }, - "linkedAccount": { - "$ref": "#/definitions/GetLoansLoanIdLinkedAccount" - }, - "disbursementDetails": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansLoanIdDisbursementDetails" - } - }, - "fixedEmiAmount": { - "type": "number", - "format": "float", - "example": 1100 - }, - "maxOutstandingLoanBalance": { - "type": "integer", - "format": "int64", - "example": 35000 - }, - "canDisburse": { - "type": "boolean", - "example": false - }, - "emiAmountVariations": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansLoanIdEmiVariations" - } - }, - "inArrears": { - "type": "boolean", - "example": true - }, - "isNPA": { - "type": "boolean", - "example": false - }, - "overdueCharges": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansLoanIdOverdueCharges" - } - } - } - }, - "GetLoansLoanIdTermPeriodFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "termFrequency.periodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetLoansLoanIdTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2012, 4, 3]" - }, - "submittedByUsername": { - "type": "string", - "example": "admin" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - }, - "approvedOnDate": { - "type": "string", - "format": "date", - "example": "[2012, 4, 3]" - }, - "approvedByUsername": { - "type": "string", - "example": "admin" - }, - "approvedByFirstname": { - "type": "string", - "example": "App" - }, - "approvedByLastname": { - "type": "string", - "example": "Administrator" - }, - "expectedDisbursementDate": { - "type": "string", - "format": "date", - "example": "[2012, 4, 10]" - }, - "actualDisbursementDate": { - "type": "string", - "format": "date", - "example": "[2012, 4, 10]" - }, - "disbursedByUsername": { - "type": "string", - "example": "admin" - }, - "disbursedByFirstname": { - "type": "string", - "example": "App" - }, - "disbursedByLastname": { - "type": "string", - "example": "Administrator" - }, - "expectedMaturityDate": { - "type": "string", - "format": "date", - "example": "[2012, 4, 10]" - } - } - }, - "PostLoansRepaymentSchedulePeriods": { - "type": "object", - "properties": { - "period": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "dueDate": { - "type": "string", - "format": "date", - "example": "[2011, 9, 20]" - }, - "principalDisbursed": { - "type": "integer", - "format": "int64", - "example": 100000 - }, - "principalLoanBalanceOutstanding": { - "type": "integer", - "format": "int64", - "example": 100000 - }, - "feeChargesDue": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "feeChargesOutstanding": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalOriginalDueForPeriod": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalDueForPeriod": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalOutstandingForPeriod": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalOverdue": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalActualCostOfLoanForPeriod": { - "type": "integer", - "format": "int64", - "example": 0 - } - } - }, - "PostLoansResponse": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetLoansLoanIdCurrency" - }, - "loanTermInDays": { - "type": "integer", - "format": "int32", - "example": 366 - }, - "totalPrincipalDisbursed": { - "type": "integer", - "format": "int64", - "example": 100000 - }, - "totalPrincipalExpected": { - "type": "integer", - "format": "int64", - "example": 100000 - }, - "totalPrincipalPaid": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalInterestCharged": { - "type": "number", - "format": "double", - "example": 13471.52 - }, - "totalFeeChargesCharged": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalPenaltyChargesCharged": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalWaived": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalWrittenOff": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalRepaymentExpected": { - "type": "number", - "format": "double", - "example": 113471.52 - }, - "totalRepayment": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "totalOutstanding": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "periods": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostLoansRepaymentSchedulePeriods" - } - } - } - }, - "PostLoansRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en_GB" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "principal": { - "type": "number", - "format": "double", - "example": "100,000.00" - }, - "loanTermFrequency": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "loanTermFrequencyType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "interestRatePerPeriod": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "amortizationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestCalculationPeriodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "expectedDisbursementDate": { - "type": "string", - "example": "20 September 2011" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PutLoansLoanIdChanges": { - "type": "object", - "properties": { - "principal": { - "type": "integer", - "format": "int64", - "example": 5000 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutLoansLoanIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutLoansLoanIdChanges" - } - } - }, - "PutLoansLoanIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "principal": { - "type": "integer", - "format": "int64", - "example": 5000 - }, - "loanTermFrequency": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "loanTermFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestRatePerPeriod": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "interestType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestCalculationPeriodType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amortizationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "expectedDisbursementDate": { - "type": "string", - "example": "04 March 2014" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "DeleteLoansLoanIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostLoansLoanIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "loanId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "PostLoansLoanIdRequest": { - "type": "object", - "properties": { - "toLoanOfficerId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "assignmentDate": { - "type": "string", - "example": "02 September 2014" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "fromLoanOfficerId": { - "type": "integer", - "format": "int32" - } - } - }, - "GetLoansResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansLoanIdResponse" - } - } - } - }, - "GetLoansTemplateProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Kampala Product (with cash accounting)" - } - } - }, - "GetLoansTemplateResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Kampala first Client" - }, - "clientOfficeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "timeline": { - "$ref": "#/definitions/GetLoansTemplateTimeline" - }, - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansTemplateProductOptions" - } - } - } - }, - "GetLoansTemplateTimeline": { - "type": "object", - "properties": { - "expectedDisbursementDate": { - "type": "string", - "format": "date", - "example": "[2013, 3, 8]" - } - } - }, - "GetLoanAccountingMappings": { - "type": "object", - "properties": { - "fundSourceAccount": { - "$ref": "#/definitions/GetLoanFundSourceAccount" - }, - "loanPortfolioAccount": { - "$ref": "#/definitions/GetLoanPortfolioAccount" - }, - "transfersInSuspenseAccount": { - "$ref": "#/definitions/GetLoanTransfersInSuspenseAccount" - }, - "interestOnLoanAccount": { - "$ref": "#/definitions/GetLoanInterestOnLoanAccount" - }, - "incomeFromFeeAccount": { - "$ref": "#/definitions/GetLoanIncomeFromFeeAccount" - }, - "incomeFromPenaltyAccount": { - "$ref": "#/definitions/GetLoanIncomeFromPenaltyAccount" - }, - "writeOffAccount": { - "$ref": "#/definitions/GetLoanWriteOffAccount" - }, - "overpaymentLiabilityAccount": { - "$ref": "#/definitions/GetLoanOverpaymentLiabilityAccount" - } - } - }, - "GetLoanCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "flat install" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetLoanFeeToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetLoanCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetLoanIncomeFromFeeAccount" - } - } - }, - "GetLoanFundSourceAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "fund source" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetLoanIncomeFromFeeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "name": { - "type": "string", - "example": "income from fees 2" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 10 - } - } - }, - "GetLoanIncomeFromPenaltyAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 9 - }, - "name": { - "type": "string", - "example": "income from penalities 2" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 11 - } - } - }, - "GetLoanInterestOnLoanAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "income from interest" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 4 - } - } - }, - "GetLoanOverpaymentLiabilityAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "over payment" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 13 - } - } - }, - "GetLoanPaymentChannelToFundSourceMappings": { - "type": "object", - "properties": { - "paymentType": { - "$ref": "#/definitions/GetLoanPaymentType" - }, - "fundSourceAccount": { - "$ref": "#/definitions/GetLoanFundSourceAccount" - } - } - }, - "GetLoanPaymentType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "name": { - "type": "string", - "example": "check" - } - } - }, - "GetLoanPortfolioAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Loan portfolio" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "GetLoanProductsAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountingRuleType.cash" - }, - "value": { - "type": "string", - "example": "CASH BASED" - } - } - }, - "GetLoanProductsAmortizationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "amortizationType.equal.installments" - }, - "value": { - "type": "string", - "example": "Equal installments" - } - } - }, - "GetLoanProductsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetLoanProductsInterestRateFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "interestRateFrequency.periodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Per year" - } - } - }, - "GetLoanProductsInterestTemplateType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "interestType.declining.balance" - }, - "value": { - "type": "string", - "example": "Declining Balance" - } - } - }, - "GetLoanProductsParamType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "LoanProductParamType.principal" - }, - "value": { - "type": "string", - "example": "principal" - } - } - }, - "GetLoanProductsPrincipalVariationsForBorrowerCycle": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 21 - }, - "borrowerCycleNumber": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "paramType": { - "$ref": "#/definitions/GetLoanProductsParamType" - }, - "valueConditionType": { - "$ref": "#/definitions/GetLoanProductsValueConditionType" - }, - "minValue": { - "type": "number", - "format": "float", - "example": 2000 - }, - "maxValue": { - "type": "number", - "format": "float", - "example": 20000 - }, - "defaultValue": { - "type": "number", - "format": "float", - "example": 15000 - } - } - }, - "GetLoanProductsProductIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "advanced accounting" - }, - "shortName": { - "type": "string", - "example": "ad11" - }, - "includeInBorrowerCycle": { - "type": "boolean", - "example": true - }, - "useBorrowerCycle": { - "type": "boolean", - "example": true - }, - "status": { - "type": "string", - "example": "loanProduct.active" - }, - "currency": { - "$ref": "#/definitions/GetLoanProductsCurrency" - }, - "principal": { - "type": "number", - "format": "float", - "example": 10000 - }, - "minPrincipal": { - "type": "number", - "format": "float", - "example": 2000 - }, - "maxPrincipal": { - "type": "number", - "format": "float", - "example": 15000 - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "repaymentFrequencyType": { - "$ref": "#/definitions/GetLoanProductsRepaymentFrequencyType" - }, - "interestRatePerPeriod": { - "type": "number", - "format": "float", - "example": 5 - }, - "interestRateFrequencyType": { - "$ref": "#/definitions/GetLoanProductsInterestRateFrequencyType" - }, - "annualInterestRate": { - "type": "number", - "format": "float", - "example": 60 - }, - "amortizationType": { - "$ref": "#/definitions/GetLoanProductsAmortizationType" - }, - "interestType": { - "$ref": "#/definitions/GetLoanProductsInterestTemplateType" - }, - "interestCalculationPeriodType": { - "$ref": "#/definitions/GetLoansProductsInterestCalculationPeriodType" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transactionProcessingStrategyName": { - "type": "string", - "example": "Mifos style" - }, - "charges": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "productsPrincipalVariationsForBorrowerCycle": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsPrincipalVariationsForBorrowerCycle" - } - }, - "interestRateVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "numberOfRepaymentVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "accountingRule": { - "$ref": "#/definitions/GetLoanProductsAccountingRule" - }, - "accountingMappings": { - "$ref": "#/definitions/GetLoanAccountingMappings" - }, - "paymentChannelToFundSourceMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanPaymentChannelToFundSourceMappings" - } - }, - "feeToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanFeeToIncomeAccountMappings" - } - }, - "multiDisburseLoan": { - "type": "boolean", - "example": true - }, - "maxTrancheCount": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "outstandingLoanBalance": { - "type": "number", - "format": "float", - "example": 36000 - }, - "overdueDaysForNPA": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "principalThresholdForLastInstalment": { - "type": "integer", - "format": "int32", - "example": 50 - } - } - }, - "GetLoanProductsRepaymentFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "repaymentFrequency.periodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetLoanProductsValueConditionType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "LoanProductValueConditionType.equal" - }, - "value": { - "type": "string", - "example": "equals" - } - } - }, - "GetLoanTransfersInSuspenseAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "name": { - "type": "string", - "example": "transfers" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "GetLoanWriteOffAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "name": { - "type": "string", - "example": "loans written off 2" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 12 - } - } - }, - "GetLoansProductsInterestCalculationPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestCalculationPeriodType.same.as.repayment.period" - }, - "value": { - "type": "string", - "example": "Same as repayment period" - } - } - }, - "PostLoanProductsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "PostLoanProductsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "LP Accrual Accounting" - }, - "shortName": { - "type": "string", - "example": "LPAA" - }, - "currencyCode": { - "type": "string", - "example": "USD" - }, - "locale": { - "type": "string", - "example": "en_GB" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "principal": { - "type": "number", - "format": "double", - "example": "100,000.00" - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestRatePerPeriod": { - "type": "number", - "format": "double", - "example": 1.75 - }, - "interestRateFrequencyType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "amortizationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestCalculationPeriodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "daysInMonthType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "daysInYearType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "isInterestRecalculationEnabled": { - "type": "boolean", - "example": false - }, - "accountingRule": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "fundSourceAccountId": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "loanPortfolioAccountId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "receivableInterestAccountId": { - "type": "integer", - "format": "int32", - "example": 9 - }, - "receivableFeeAccountId": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "receivablePenaltyAccountId": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "interestOnLoanAccountId": { - "type": "integer", - "format": "int32", - "example": 34 - }, - "incomeFromFeeAccountId": { - "type": "integer", - "format": "int32", - "example": 37 - }, - "incomeFromPenaltyAccountId": { - "type": "integer", - "format": "int32", - "example": 35 - }, - "overpaymentLiabilityAccountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "writeOffAccountId": { - "type": "integer", - "format": "int32", - "example": 41 - } - } - }, - "GetLoanProductsInterestRecalculationCompoundingFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestRecalculationFrequencyType.same.as.repayment.period" - }, - "value": { - "type": "string", - "example": "Same as repayment period" - } - } - }, - "GetLoanProductsInterestRecalculationCompoundingType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "interestRecalculationCompoundingMethod.fee" - }, - "value": { - "type": "string", - "example": "Fee" - } - } - }, - "GetLoanProductsInterestRecalculationData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestRecalculationCompoundingType": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationCompoundingType" - }, - "interestRecalculationCompoundingFrequencyType": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationCompoundingFrequencyType" - }, - "rescheduleStrategyType": { - "$ref": "#/definitions/GetLoanProductsRescheduleStrategyType" - }, - "recalculationRestFrequencyType": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationCompoundingFrequencyType" - }, - "preClosureInterestCalculationStrategy": { - "$ref": "#/definitions/GetLoanProductsPreClosureInterestCalculationStrategy" - }, - "isArrearsBasedOnOriginalSchedule": { - "type": "boolean", - "example": true - } - } - }, - "GetLoanProductsInterestType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetLoanProductsPreClosureInterestCalculationStrategy": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "loanPreClosureInterestCalculationStrategy.tillPreClosureDate" - }, - "value": { - "type": "string", - "example": "Till preclose Date" - } - } - }, - "GetLoanProductsRescheduleStrategyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "loanRescheduleStrategyMethod.reduce.number.of.installments" - }, - "value": { - "type": "string", - "example": "Reduce number of installments" - } - } - }, - "GetLoanProductsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "personal loan product" - }, - "shortName": { - "type": "string", - "example": "pe1" - }, - "includeInBorrowerCycle": { - "type": "boolean", - "example": false - }, - "useBorrowerCycle": { - "type": "boolean", - "example": false - }, - "startDate": { - "type": "string", - "format": "date", - "example": "[2013, 9, 2]" - }, - "endDate": { - "type": "string", - "format": "date", - "example": "[2014, 2, 7]" - }, - "status": { - "type": "string", - "example": "loanProduct.active" - }, - "currency": { - "$ref": "#/definitions/GetLoanProductsCurrency" - }, - "principal": { - "type": "number", - "format": "float", - "example": 10000 - }, - "minPrincipal": { - "type": "number", - "format": "float", - "example": 5000 - }, - "maxPrincipal": { - "type": "number", - "format": "float", - "example": 15000 - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "minNumberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "maxNumberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "repaymentFrequencyType": { - "$ref": "#/definitions/GetLoanProductsRepaymentFrequencyType" - }, - "interestRatePerPeriod": { - "type": "number", - "format": "float", - "example": 15 - }, - "interestRateFrequencyType": { - "$ref": "#/definitions/GetLoanProductsInterestRateFrequencyType" - }, - "annualInterestRate": { - "type": "number", - "format": "float", - "example": 15 - }, - "amortizationType": { - "$ref": "#/definitions/GetLoanProductsAmortizationType" - }, - "interestType": { - "$ref": "#/definitions/GetLoanProductsInterestType" - }, - "interestCalculationPeriodType": { - "$ref": "#/definitions/GetLoansProductsInterestCalculationPeriodType" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transactionProcessingStrategyName": { - "type": "string", - "example": "Mifos style" - }, - "principalVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "interestRateVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "numberOfRepaymentVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "daysInMonthType": { - "$ref": "#/definitions/GetLoansProductsDaysInMonthType" - }, - "daysInYearType": { - "$ref": "#/definitions/GetLoansProductsDaysInYearType" - }, - "isInterestRecalculationEnabled": { - "type": "boolean", - "example": true - }, - "interestRecalculationData": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationData" - }, - "accountingRule": { - "$ref": "#/definitions/GetLoanProductsAccountingRule" - }, - "principalThresholdForLastInstalment": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetLoansProductsDaysInMonthType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 30 - }, - "code": { - "type": "string", - "example": "DaysInMonthType.days360" - }, - "value": { - "type": "string", - "example": "30 Days" - } - } - }, - "GetLoansProductsDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 360 - }, - "code": { - "type": "string", - "example": "DaysInYearType.days360" - }, - "value": { - "type": "string", - "example": "360 Days" - } - } - }, - "PutLoanChanges": { - "type": "object", - "properties": { - "principal": { - "type": "number", - "format": "double", - "example": "70,000.00" - }, - "locale": { - "type": "string", - "example": "en_GB" - } - } - }, - "PutLoanProductsProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutLoanChanges" - } - } - }, - "PutLoanProductsProductIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en_GB" - }, - "principal": { - "type": "number", - "format": "double", - "example": "70,000.00" - } - } - }, - "GetLoanProductsAccountingMappingOptions": { - "type": "object", - "properties": { - "liabilityAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsLiabilityAccountOptions" - } - }, - "assetAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsAssetAccountOptions" - } - }, - "expenseAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsExpenseAccountOptions" - } - }, - "incomeAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsIncomeAccountOptions" - } - } - } - }, - "GetLoanProductsAssetAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Loan portfolio" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetLoanProductsLiabilityType" - }, - "usage": { - "$ref": "#/definitions/GetLoanProductsLiabilityUsage" - }, - "nameDecorated": { - "type": "string", - "example": "Loan portfolio" - }, - "tagId": { - "$ref": "#/definitions/GetLoanProductsLiabilityTagId" - }, - "organizationRunningBalance": { - "type": "integer", - "format": "int32", - "example": 60000 - } - } - }, - "GetLoanProductsChargeAppliesTo": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": "1 " - }, - "code": { - "type": "string", - "example": "chargeAppliesTo.loan" - }, - "value": { - "type": "string", - "example": "Loan" - } - } - }, - "GetLoanProductsChargeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "name": { - "type": "string", - "example": "des charges" - }, - "active": { - "type": "boolean", - "example": true - }, - "penalty": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetLoanProductsCurrencyOptions" - }, - "amount": { - "type": "integer", - "format": "int64", - "example": 100 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetLoanChargeTimeType" - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetLoanProductsChargeAppliesTo" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetLoanChargeCalculationType" - }, - "chargePaymentMode": { - "$ref": "#/definitions/GetLoansChargePaymentMode" - } - } - }, - "GetLoanProductsCurrencyOptions": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetLoanProductsDaysInYearTemplateType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "DaysInYearType.actual" - }, - "value": { - "type": "string", - "example": "Actual" - } - } - }, - "GetLoanProductsExpenseAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "name": { - "type": "string", - "example": "loans written off 2" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetLoanProductsExpenseType" - }, - "usage": { - "$ref": "#/definitions/GetLoanProductsLiabilityUsage" - }, - "nameDecorated": { - "type": "string", - "example": "loans written off 2" - }, - "tagId": { - "$ref": "#/definitions/GetLoanProductsLiabilityTagId" - }, - "organizationRunningBalance": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetLoanProductsExpenseType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "code": { - "type": "string", - "example": "accountType.expense" - }, - "value": { - "type": "string", - "example": "EXPENSE" - } - } - }, - "GetLoanProductsIncomeAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "income from interest" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetLoanProductsIncomeType" - }, - "usage": { - "$ref": "#/definitions/GetLoanProductsLiabilityUsage" - }, - "nameDecorated": { - "type": "string", - "example": "income from interest" - }, - "tagId": { - "$ref": "#/definitions/GetLoanProductsLiabilityTagId" - }, - "organizationRunningBalance": { - "type": "integer", - "format": "int32", - "example": 19 - } - } - }, - "GetLoanProductsIncomeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "accountType.income" - }, - "value": { - "type": "string", - "example": "INCOME" - } - } - }, - "GetLoanProductsInterestRateTemplateFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "interestRateFrequency.periodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Per month" - } - } - }, - "GetLoanProductsInterestRecalculationTemplateData": { - "type": "object", - "properties": { - "interestRecalculationCompoundingType": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationCompoundingType" - }, - "rescheduleStrategyType": { - "$ref": "#/definitions/GetLoanProductsRescheduleStrategyType" - }, - "preClosureInterestCalculationStrategy": { - "$ref": "#/definitions/GetLoanProductsPreClosureInterestCalculationStrategy" - } - } - }, - "GetLoanProductsLiabilityAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "over payment" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetLoanProductsLiabilityType" - }, - "usage": { - "$ref": "#/definitions/GetLoanProductsLiabilityUsage" - }, - "nameDecorated": { - "type": "string", - "example": "over payment" - }, - "tagId": { - "$ref": "#/definitions/GetLoanProductsLiabilityTagId" - }, - "organizationRunningBalance": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetLoanProductsLiabilityTagId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetLoanProductsLiabilityType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.liability" - }, - "value": { - "type": "string", - "example": "LIABILITY" - } - } - }, - "GetLoanProductsLiabilityUsage": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountUsage.detail" - }, - "value": { - "type": "string", - "example": "DETAIL" - } - } - }, - "GetLoanProductsPaymentTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "name": { - "type": "string", - "example": "check" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetLoanProductsRepaymentTemplateFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "repaymentFrequency.periodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetLoanProductsTemplateCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "name": { - "type": "string" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "displaySymbol": { - "type": "string" - }, - "nameCode": { - "type": "string" - }, - "displayLabel": { - "type": "string", - "example": "[]" - } - } - }, - "GetLoanProductsTemplateResponse": { - "type": "object", - "properties": { - "includeInBorrowerCycle": { - "type": "boolean", - "example": false - }, - "useBorrowerCycle": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetLoanProductsTemplateCurrency" - }, - "repaymentFrequencyType": { - "$ref": "#/definitions/GetLoanProductsRepaymentTemplateFrequencyType" - }, - "interestRateFrequencyType": { - "$ref": "#/definitions/GetLoanProductsInterestRateTemplateFrequencyType" - }, - "amortizationType": { - "$ref": "#/definitions/GetLoanProductsAmortizationType" - }, - "interestType": { - "$ref": "#/definitions/GetLoanProductsInterestTemplateType" - }, - "interestCalculationPeriodType": { - "$ref": "#/definitions/GetLoansProductsInterestCalculationPeriodType" - }, - "principalVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "interestRateVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "numberOfRepaymentVariationsForBorrowerCycle": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "accountingRule": { - "$ref": "#/definitions/GetLoanProductsAccountingRule" - }, - "daysInMonthType": { - "$ref": "#/definitions/GetLoansProductsDaysInMonthTemplateType" - }, - "daysInYearType": { - "$ref": "#/definitions/GetLoanProductsDaysInYearTemplateType" - }, - "isInterestRecalculationEnabled": { - "type": "boolean", - "example": false - }, - "interestRecalculationData": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationTemplateData" - }, - "paymentTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsPaymentTypeOptions" - } - }, - "currencyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsCurrencyOptions" - } - }, - "repaymentFrequencyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsRepaymentTemplateFrequencyType" - } - }, - "preClosureInterestCalculationStrategyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsPreClosureInterestCalculationStrategy" - } - }, - "interestRateFrequencyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsInterestRateTemplateFrequencyType" - } - }, - "amortizationTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsAmortizationType" - } - }, - "interestTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsInterestTemplateType" - } - }, - "interestCalculationPeriodTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansProductsInterestCalculationPeriodType" - } - }, - "transactionProcessingStrategyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsTransactionProcessingStrategyOptions" - } - }, - "chargeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsChargeOptions" - } - }, - "accountingRuleOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsAccountingRule" - } - }, - "accountingMappingOptions": { - "$ref": "#/definitions/GetLoanProductsAccountingMappingOptions" - }, - "valueConditionTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsValueConditionTypeOptions" - } - }, - "daysInMonthTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoansProductsDaysInMonthTemplateType" - } - }, - "daysInYearTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsInterestTemplateType" - } - }, - "interestRecalculationCompoundingTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationCompoundingType" - } - }, - "rescheduleStrategyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsRescheduleStrategyType" - } - }, - "interestRecalculationFrequencyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetLoanProductsInterestRecalculationCompoundingFrequencyType" - } - } - } - }, - "GetLoanProductsTransactionProcessingStrategyOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "mifos-standard-strategy" - }, - "name": { - "type": "string", - "example": "Penalties, Fees, Interest, Principal order" - } - } - }, - "GetLoanProductsValueConditionTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "mifos-standard-strategyLoanProductValueConditionType.equal" - }, - "value": { - "type": "string", - "example": "equals" - } - } - }, - "GetLoansChargePaymentMode": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "chargepaymentmode.regular" - }, - "value": { - "type": "string", - "example": "Regular" - } - } - }, - "GetLoansProductsDaysInMonthTemplateType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "DaysInMonthType.actual" - }, - "value": { - "type": "string", - "example": "Actual" - } - } - }, - "GetNotesNoteType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "noteType.client" - }, - "value": { - "type": "string", - "example": "Client note" - } - } - }, - "GetResourceTypeResourceIdNotesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "noteType": { - "$ref": "#/definitions/GetNotesNoteType" - }, - "note": { - "type": "string", - "example": "First note edited" - }, - "createdById": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "createdByUsername": { - "type": "string", - "example": "mifos" - }, - "createdOn": { - "type": "string", - "format": "date-time", - "example": "1342498505000" - }, - "updatedById": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "updatedByUsername": { - "type": "string", - "example": "mifos" - }, - "updatedOn": { - "type": "string", - "format": "date-time", - "example": "1342498517000" - } - } - }, - "DeleteResourceTypeResourceIdNotesNoteIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 76 - } - } - }, - "PostResourceTypeResourceIdNotesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 76 - } - } - }, - "PostResourceTypeResourceIdNotesRequest": { - "type": "object", - "properties": { - "note": { - "type": "string", - "example": "a note about the client" - } - } - }, - "GetResourceTypeResourceIdNotesNoteIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 76 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "noteType": { - "$ref": "#/definitions/GetNotesNoteType" - }, - "note": { - "type": "string", - "example": "a note about the client" - }, - "createdById": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "createdByUsername": { - "type": "string", - "example": "mifos" - }, - "createdOn": { - "type": "string", - "format": "date-time", - "example": "1359463135000" - }, - "updatedById": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "updatedByUsername": { - "type": "string", - "example": "mifos" - }, - "updatedOn": { - "type": "string", - "format": "date-time", - "example": "1359463135000" - } - } - }, - "PutNotesChanges": { - "type": "object", - "properties": { - "note": { - "type": "string", - "example": "a note about the client" - } - } - }, - "PutResourceTypeResourceIdNotesNoteIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 76 - }, - "changes": { - "$ref": "#/definitions/PutNotesChanges" - } - } - }, - "PutResourceTypeResourceIdNotesNoteIdRequest": { - "type": "object", - "properties": { - "note": { - "type": "string", - "example": "a note about the client" - } - } - }, - "DeletePaymentTypesPaymentTypeIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 13 - } - } - }, - "GetPaymentTypesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 24 - }, - "name": { - "type": "string", - "example": "PTC" - }, - "description": { - "type": "string", - "example": "Cash" - }, - "isCashPayment": { - "type": "boolean", - "example": true - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetPaymentTypesPaymentTypeIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "name": { - "type": "string", - "example": "cash" - }, - "description": { - "type": "string", - "example": "cash Payment" - }, - "isCashPayment": { - "type": "boolean", - "example": true - }, - "position": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostPaymentTypesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostPaymentTypesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "cash" - }, - "description": { - "type": "string", - "example": "cash payment type" - }, - "isCashPayment": { - "type": "boolean", - "example": true - }, - "position": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PutPaymentTypesPaymentTypeIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 13 - } - } - }, - "PutPaymentTypesPaymentTypeIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "mPay" - }, - "description": { - "type": "string", - "example": "not a cash payment type" - }, - "isCashPayment": { - "type": "boolean", - "example": false - }, - "position": { - "type": "integer", - "format": "int32", - "example": 3 - } - } - }, - "GetProductsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Share Product" - }, - "shortName": { - "type": "string", - "example": "Share Product Description" - }, - "totalShares": { - "type": "integer", - "format": "int32", - "example": 100 - } - } - }, - "GetProductsTypeResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsPageItems" - } - } - } - }, - "PostProductsTypeResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostProductsChargesSelected": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 20 - } - } - }, - "PostProductsMarketPricePeriods": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "fromDate": { - "type": "string", - "example": "04 May 2016" - }, - "shareValue": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostProductsTypeRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Share Product" - }, - "shortName": { - "type": "string", - "example": "SP" - }, - "description": { - "type": "string", - "example": "Description" - }, - "currencyCode": { - "type": "string", - "example": "USD" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "locale": { - "type": "string", - "example": "en" - }, - "totalShares": { - "type": "integer", - "format": "int32", - "example": 1000 - }, - "sharesIssued": { - "type": "integer", - "format": "int32", - "example": 1000 - }, - "unitPrice": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minimumShares": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "nominalShares": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "maximumShares": { - "type": "integer", - "format": "int32", - "example": 30 - }, - "minimumActivePeriodForDividends": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minimumactiveperiodFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "lockinPeriodFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "lockinPeriodFrequencyType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "allowDividendCalculationForInactiveClients": { - "type": "boolean", - "example": true - }, - "marketPricePeriods": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostProductsMarketPricePeriods" - } - }, - "chargesSelected": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostProductsChargesSelected" - } - }, - "accountingRule": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetAssetType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountType.asset" - }, - "value": { - "type": "string", - "example": "ASSET" - } - } - }, - "GetChargeAppliesTo": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "chargeAppliesTo.shares" - }, - "value": { - "type": "string", - "example": "Shares" - } - } - }, - "GetChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetChargePaymentMode": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "chargepaymentmode.regular" - }, - "value": { - "type": "string", - "example": "Regular" - } - } - }, - "GetChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "code": { - "type": "string", - "example": "chargeTimeType.activation" - }, - "value": { - "type": "string", - "example": "Share Account Activate" - } - } - }, - "GetChargesCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetEquityType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "accountType.equity" - }, - "value": { - "type": "string", - "example": "EQUITY" - } - } - }, - "GetIncomeFromFeeAccountId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "glCode": { - "type": "string", - "example": "INCOME_OY1461237869836" - } - } - }, - "GetIncomeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountType.income" - }, - "value": { - "type": "string", - "example": "INCOME" - } - } - }, - "GetLockPeriodTypeEnum": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetProductsAccountingMappingOptions": { - "type": "object", - "properties": { - "liabilityAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsLiabilityAccountOptions" - } - }, - "assetAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsAssetAccountOptions" - } - }, - "incomeAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsIncomeAccountOptions" - } - }, - "equityAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsEquityAccountOptions" - } - } - } - }, - "GetProductsAccountingMappings": { - "type": "object", - "properties": { - "shareReferenceId": { - "$ref": "#/definitions/GetShareReferenceId" - }, - "incomeFromFeeAccountId": { - "$ref": "#/definitions/GetIncomeFromFeeAccountId" - }, - "shareEquityId": { - "$ref": "#/definitions/GetShareEquityId" - }, - "shareSuspenseId": { - "$ref": "#/definitions/GetShareSuspenseId" - } - } - }, - "GetProductsAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountingRuleType.cash" - }, - "value": { - "type": "string", - "example": "CASH BASED" - } - } - }, - "GetProductsAssetAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "glCode": { - "type": "string", - "example": "ASSET_ED1461237837829" - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetAssetType" - }, - "usage": { - "$ref": "#/definitions/GetProductsLiabilityUsage" - }, - "description": { - "type": "string", - "example": "DEFAULT_DESCRIPTION" - }, - "nameDecorated": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "tagId": { - "$ref": "#/definitions/GetProductsTagId" - } - } - }, - "GetProductsCharges": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "name": { - "type": "string", - "example": "Share Account Activation Flat" - }, - "active": { - "type": "boolean", - "example": true - }, - "penalty": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetChargesCurrency" - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetChargeTimeType" - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetChargeAppliesTo" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetChargeCalculationType" - }, - "chargePaymentMode": { - "$ref": "#/definitions/GetChargePaymentMode" - } - } - }, - "GetProductsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetProductsEquityAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 66 - }, - "name": { - "type": "string", - "example": "Equity Account" - }, - "glCode": { - "type": "string", - "example": "EQUITY1" - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetEquityType" - }, - "usage": { - "$ref": "#/definitions/GetProductsLiabilityUsage" - }, - "nameDecorated": { - "type": "string", - "example": "Equity Account" - }, - "tagId": { - "$ref": "#/definitions/GetProductsTagId" - } - } - }, - "GetProductsIncomeAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "glCode": { - "type": "string", - "example": "INCOME_9O1461237838422" - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetIncomeType" - }, - "usage": { - "$ref": "#/definitions/GetProductsLiabilityUsage" - }, - "description": { - "type": "string", - "example": "DEFAULT_DESCRIPTION" - }, - "nameDecorated": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "tagId": { - "$ref": "#/definitions/GetProductsTagId" - } - } - }, - "GetProductsLiabilityAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "glCode": { - "type": "string", - "example": "LIABILITY_2T1461237838897" - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetProductsLiabilityType" - }, - "usage": { - "$ref": "#/definitions/GetProductsLiabilityUsage" - }, - "description": { - "type": "string", - "example": "DEFAULT_DESCRIPTION" - }, - "nameDecorated": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "tagId": { - "$ref": "#/definitions/GetProductsTagId" - } - } - }, - "GetProductsLiabilityType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.liability" - }, - "value": { - "type": "string", - "example": "LIABILITY" - } - } - }, - "GetProductsLiabilityUsage": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountUsage.detail" - }, - "value": { - "type": "string", - "example": "DETAIL" - } - } - }, - "GetProductsMarketPrice": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "fromDate": { - "type": "string", - "example": "Feb 1, 2016" - }, - "shareValue": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetProductsMinimumActivePeriodFrequencyTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "savings.lockin.sharePeriodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetProductsTagId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "isActive": { - "type": "boolean", - "example": false - } - } - }, - "GetProductsTypeProductIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Share Product" - }, - "shortName": { - "type": "string", - "example": "SP" - }, - "description": { - "type": "string", - "example": "SP" - }, - "currency": { - "$ref": "#/definitions/GetProductsCurrency" - }, - "totalShares": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "totalSharesIssued": { - "type": "integer", - "format": "int32", - "example": 50 - }, - "unitPrice": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "shareCapital": { - "type": "integer", - "format": "int32", - "example": 50 - }, - "minimumShares": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "nominalShares": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "maximumShares": { - "type": "integer", - "format": "int32", - "example": 50 - }, - "marketPrice": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsMarketPrice" - } - }, - "charges": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsCharges" - } - }, - "allowDividendCalculationForInactiveClients": { - "type": "boolean", - "example": true - }, - "lockinPeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "lockPeriodTypeEnum": { - "$ref": "#/definitions/GetLockPeriodTypeEnum" - }, - "minimumActivePeriod": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minimumActivePeriodForDividendsTypeEnum": { - "$ref": "#/definitions/GetLockPeriodTypeEnum" - }, - "accountingRule": { - "$ref": "#/definitions/GetProductsAccountingRule" - }, - "accountingMappings": { - "$ref": "#/definitions/GetProductsAccountingMappings" - }, - "currencyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetChargesCurrency" - } - }, - "chargeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsCharges" - } - }, - "minimumActivePeriodFrequencyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsMinimumActivePeriodFrequencyTypeOptions" - } - }, - "lockinPeriodFrequencyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetProductsMinimumActivePeriodFrequencyTypeOptions" - } - }, - "accountingMappingOptions": { - "$ref": "#/definitions/GetProductsAccountingMappingOptions" - } - } - }, - "GetShareEquityId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 66 - }, - "name": { - "type": "string", - "example": "Equity Account" - }, - "glCode": { - "type": "string", - "example": "EQUITY1" - } - } - }, - "GetShareReferenceId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "glCode": { - "type": "string", - "example": "ASSET_ED1461237837829" - } - } - }, - "GetShareSuspenseId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_1FJBQ" - }, - "glCode": { - "type": "string", - "example": "LIABILITY_MA1461237860198" - } - } - }, - "PutProductsChanges": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Share Product Description." - }, - "unitPrice": { - "type": "number", - "format": "double", - "example": 5 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutProductsTypeProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutProductsChanges" - } - } - }, - "PutProductsTypeProductIdRequest": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Share Product Description." - }, - "locale": { - "type": "string", - "example": "en" - }, - "unitPrice": { - "type": "number", - "format": "double", - "example": 5 - } - } - }, - "PostFixedDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostFixedDepositAccountsAccountIdRequest": { - "type": "object" - }, - "PostFixedDepositAccountsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostFixedDepositAccountsRequest": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "submittedOnDate": { - "type": "string", - "example": "01 March 2014" - }, - "depositAmount": { - "type": "number", - "format": "float", - "example": 5000 - }, - "depositPeriod": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "depositPeriodFrequencyId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "GetFixedDepositAccountsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetFixedDepositAccountsDepositPeriodFrequency": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "deposit.period.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetFixedDepositAccountsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetFixedDepositAccountsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetFixedDepositAccountsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetFixedDepositAccountsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetFixedDepositAccountsMaxDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Years" - } - } - }, - "GetFixedDepositAccountsMinDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetFixedDepositAccountsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Sangamesh N" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "savingsProductName": { - "type": "string", - "example": "FD01" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetFixedDepositAccountsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetFixedDepositAccountsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetFixedDepositAccountsCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestCalculationDaysInYearType" - }, - "summary": { - "$ref": "#/definitions/GetFixedDepositAccountsSummary" - }, - "interestFreePeriodApplicable": { - "type": "boolean", - "example": false - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": false - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetFixedDepositAccountsMinDepositTermType" - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetFixedDepositAccountsMaxDepositTermType" - }, - "depositAmount": { - "type": "number", - "format": "float", - "example": 5000 - }, - "maturityAmount": { - "type": "number", - "format": "float", - "example": 5140.25 - }, - "maturityDate": { - "type": "string", - "format": "date", - "example": "[2014, 9, 1]" - }, - "depositPeriod": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "depositPeriodFrequency": { - "$ref": "#/definitions/GetFixedDepositAccountsDepositPeriodFrequency" - } - } - }, - "GetFixedDepositAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "prematureClosed": { - "type": "boolean", - "example": false - }, - "transferInProgress": { - "type": "boolean", - "example": false - }, - "transferOnHold": { - "type": "boolean", - "example": false - } - } - }, - "GetFixedDepositAccountsSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetFixedDepositAccountsCurrency" - }, - "accountBalance": { - "type": "number", - "format": "float", - "example": 0 - } - } - }, - "GetFixedDepositAccountsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2014, 3, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "GetFixedDepositAccountsAccountChart": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "[2013, 10, 2]" - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "accountNumber": { - "type": "integer", - "format": "int64", - "example": "FD000023" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositAccountsChartSlabs" - } - }, - "periodTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositAccountsPeriodTypes" - } - } - } - }, - "GetFixedDepositAccountsAccountChartCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetFixedDepositAccountsAccountIdCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetFixedDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": "FD000023" - }, - "externalId": { - "type": "string", - "example": "FD-23" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Sangamesh N" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "savingsProductName": { - "type": "string", - "example": "FD01" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetFixedDepositAccountsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetFixedDepositAccountsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetFixedDepositAccountsAccountIdCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetFixedDepositAccountsInterestCalculationDaysInYearType" - }, - "interestFreePeriodApplicable": { - "type": "boolean", - "example": false - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": false - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetFixedDepositAccountsMinDepositTermType" - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetFixedDepositAccountsMaxDepositTermType" - }, - "depositAmount": { - "type": "number", - "format": "float", - "example": 5000 - }, - "maturityAmount": { - "type": "number", - "format": "float", - "example": 5140.25 - }, - "maturityDate": { - "type": "string", - "format": "date", - "example": "[2014, 9, 1]" - }, - "depositPeriod": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "depositPeriodFrequency": { - "$ref": "#/definitions/GetFixedDepositAccountsDepositPeriodFrequency" - }, - "summary": { - "$ref": "#/definitions/GetFixedDepositAccountsAccountIdSummary" - }, - "accountChart": { - "$ref": "#/definitions/GetFixedDepositAccountsAccountChart" - } - } - }, - "GetFixedDepositAccountsAccountIdSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetFixedDepositAccountsAccountIdCurrency" - }, - "accountBalance": { - "type": "number", - "format": "float", - "example": 0 - } - } - }, - "GetFixedDepositAccountsChartSlabs": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "periodType": { - "$ref": "#/definitions/GetFixedDepositAccountsPeriodType" - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 181 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 5.5 - }, - "currency": { - "$ref": "#/definitions/GetFixedDepositAccountsAccountChartCurrency" - } - } - }, - "GetFixedDepositAccountsPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetFixedDepositAccountsPeriodTypes": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetFixedDepositAccountsProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passbook Savings" - } - } - }, - "GetFixedDepositAccountsTemplateResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "small business" - }, - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositAccountsProductOptions" - } - } - } - }, - "PutFixedDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutFixedDepositAccountsChanges" - } - } - }, - "PutFixedDepositAccountsChanges": { - "type": "object", - "properties": { - "depositAmount": { - "type": "number", - "format": "float", - "example": 6000 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutFixedDepositAccountsAccountIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "depositAmount": { - "type": "number", - "format": "float", - "example": 6000 - } - } - }, - "DeleteFixedDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetFixedDepositProductsAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountingRuleType.none" - }, - "value": { - "type": "string", - "example": "NONE" - } - } - }, - "GetFixedDepositProductsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetFixedDepositProductsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetFixedDepositProductsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetFixedDepositProductsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetFixedDepositProductsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetFixedDepositProductsMaxDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Years" - } - } - }, - "GetFixedDepositProductsMinDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetFixedDepositProductsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "name": { - "type": "string", - "example": "FD01" - }, - "shortName": { - "type": "string", - "example": "FD01" - }, - "description": { - "type": "string", - "example": "FD01" - }, - "currency": { - "$ref": "#/definitions/GetFixedDepositProductsCurrency" - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": false - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetFixedDepositProductsMinDepositTermType" - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetFixedDepositProductsMaxDepositTermType" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 0 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestCalculationDaysInYearType" - }, - "accountingRule": { - "$ref": "#/definitions/GetFixedDepositProductsAccountingRule" - } - } - }, - "GetFixedDepositProductsProductIdAccountingMappings": { - "type": "object", - "properties": { - "savingsReferenceAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdSavingsReferenceAccount" - }, - "incomeFromFeeAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdIncomeFromFeeAccount" - }, - "incomeFromPenaltyAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdIncomeFromPenaltyAccount" - }, - "interestOnSavingsAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdInterestOnSavingsAccount" - }, - "savingsControlAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdSavingsControlAccount" - }, - "transfersInSuspenseAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdTransfersInSuspenseAccount" - } - } - }, - "GetFixedDepositProductsProductIdActiveChart": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "[2014, 1, 1]" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "savingsProductName": { - "type": "string", - "example": "Fixed deposit product" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdChartSlabs" - } - }, - "periodTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdPeriodType" - } - } - } - }, - "GetFixedDepositProductsProductIdChartSlabs": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 18 - }, - "description": { - "type": "string", - "example": "from 0 to 90 days" - }, - "periodType": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdPeriodType" - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 90 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 4.5 - }, - "currency": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdCurrency" - } - } - }, - "GetFixedDepositProductsProductIdCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetFixedDepositProductsProductIdFeeToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdFeeToIncomeAccountMappingsCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdFeeToIncomeAccountMappingsIncomeAccount" - } - } - }, - "GetFixedDepositProductsProductIdFeeToIncomeAccountMappingsCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "sav charge" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetFixedDepositProductsProductIdFeeToIncomeAccountMappingsIncomeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "name": { - "type": "string", - "example": "income from savings fee" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 24 - } - } - }, - "GetFixedDepositProductsProductIdIncomeFromFeeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "name": { - "type": "string", - "example": "income from savings fee" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 24 - } - } - }, - "GetFixedDepositProductsProductIdIncomeFromPenaltyAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 17 - }, - "name": { - "type": "string", - "example": "income from sav penalties" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 25 - } - } - }, - "GetFixedDepositProductsProductIdInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.daily" - }, - "value": { - "type": "string", - "example": "Daily" - } - } - }, - "GetFixedDepositProductsProductIdInterestOnSavingsAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "name": { - "type": "string", - "example": "interest on savings" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 23 - } - } - }, - "GetFixedDepositProductsProductIdMaxDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Years" - } - } - }, - "GetFixedDepositProductsProductIdMinDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.weeks" - }, - "value": { - "type": "string", - "example": "Weeks" - } - } - }, - "GetFixedDepositProductsProductIdPenaltyToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdPenaltyToIncomeAccountMappingsCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdIncomeFromPenaltyAccount" - } - } - }, - "GetFixedDepositProductsProductIdPenaltyToIncomeAccountMappingsCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "sav 2" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": true - } - } - }, - "GetFixedDepositProductsProductIdPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.weeks" - }, - "value": { - "type": "string", - "example": "Weeks" - } - } - }, - "GetFixedDepositProductsProductIdPreClosurePenalInterestOnType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "preClosurePenalInterestOnType.wholeTerm" - }, - "value": { - "type": "string", - "example": "Whole term" - } - } - }, - "GetFixedDepositProductsProductIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Fixed deposit product" - }, - "shortName": { - "type": "string", - "example": "FD01" - }, - "description": { - "type": "string", - "example": "Daily compounding using Daily Balance, 5% per year, 365 days in year" - }, - "currency": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetFixedDepositProductsInterestCalculationDaysInYearType" - }, - "accountingMappings": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdAccountingMappings" - }, - "feeToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdFeeToIncomeAccountMappings" - } - }, - "penaltyToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdPenaltyToIncomeAccountMappings" - } - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": true - }, - "preClosurePenalInterest": { - "type": "number", - "format": "double", - "example": 1.75 - }, - "preClosurePenalInterestOnType": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdPreClosurePenalInterestOnType" - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdMinDepositTermType" - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdMaxDepositTermType" - }, - "activeChart": { - "$ref": "#/definitions/GetFixedDepositProductsProductIdActiveChart" - } - } - }, - "GetFixedDepositProductsProductIdSavingsControlAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "name": { - "type": "string", - "example": "savings ref tool kit" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 21 - } - } - }, - "GetFixedDepositProductsProductIdSavingsReferenceAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "savings ref" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 20 - } - } - }, - "GetFixedDepositProductsProductIdTransfersInSuspenseAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "name": { - "type": "string", - "example": "saving transfers" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 22 - } - } - }, - "PutFixedDepositProductsChanges": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Fixed deposit product new offerings" - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - } - } - }, - "PutFixedDepositProductsProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutFixedDepositProductsChanges" - } - } - }, - "PutFixedDepositProductsProductIdRequest": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Fixed deposit product new offerings" - }, - "locale": { - "type": "string", - "example": "en" - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "minDepositTermTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "DeleteFixedDepositProductsProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostFixedDepositProductsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostFixedDepositProductsChartSlabs": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "from 0 to 90 days" - }, - "periodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 90 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 4.5 - } - } - }, - "PostFixedDepositProductsCharts": { - "type": "object", - "properties": { - "fromDate": { - "type": "string", - "example": "01 Jan 2014" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostFixedDepositProductsChartSlabs" - } - } - } - }, - "PostFixedDepositProductsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Fixed deposit product" - }, - "shortName": { - "type": "string", - "example": "FD01" - }, - "description": { - "type": "string", - "example": "Daily compounding using Daily Balance, 5% per year, 365 days in year" - }, - "currencyCode": { - "type": "string", - "example": "USD" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "locale": { - "type": "string", - "example": "en" - }, - "interestCompoundingPeriodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestPostingPeriodType": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "interestCalculationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestCalculationDaysInYearType": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "accountingRule": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": true - }, - "preClosurePenalInterest": { - "type": "number", - "format": "double", - "example": 1.75 - }, - "preClosurePenalInterestOnTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minDepositTermTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "maxDepositTermTypeId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "charts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostFixedDepositProductsCharts" - } - } - } - }, - "PostRecurringChanges": { - "type": "object", - "properties": { - "accountNumber": { - "type": "string", - "example": "acc123" - }, - "checkNumber": { - "type": "string", - "example": "che123" - }, - "routingCode": { - "type": "string", - "example": "rou123" - }, - "receiptNumber": { - "type": "string", - "example": "rec123" - }, - "bankNumber": { - "type": "string", - "example": "ban123" - } - } - }, - "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 48 - }, - "changes": { - "$ref": "#/definitions/PostRecurringChanges" - } - } - }, - "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "transactionDate": { - "type": "string", - "example": "27 May 2013" - }, - "transactionAmount": { - "type": "number", - "format": "double", - "example": 500 - }, - "paymentTypeId": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "accountNumber": { - "type": "string", - "example": "acc123" - }, - "checkNumber": { - "type": "string", - "example": "che123" - }, - "routingCode": { - "type": "string", - "example": "rou123" - }, - "receiptNumber": { - "type": "string", - "example": "rec123" - }, - "bankNumber": { - "type": "string", - "example": "ban123" - } - } - }, - "PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 47 - }, - "changes": { - "$ref": "#/definitions/PostRecurringChanges" - } - } - }, - "GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transactionType": { - "$ref": "#/definitions/GetRecurringTransactionsTransactionType" - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "string", - "example": "000000001" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2013, 8, 7]" - }, - "currency": { - "$ref": "#/definitions/GetRecurringTransactionsCurrency" - }, - "paymentDetailData": { - "$ref": "#/definitions/GetRecurringPaymentDetailData" - }, - "amount": { - "type": "number", - "format": "float", - "example": 5000 - }, - "runningBalance": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "reversed": { - "type": "boolean", - "example": true - } - } - }, - "GetRecurringPaymentDetailData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 62 - }, - "paymentType": { - "$ref": "#/definitions/GetRecurringPaymentType" - }, - "accountNumber": { - "type": "integer", - "format": "int32" - }, - "checkNumber": { - "type": "integer", - "format": "int32" - }, - "routingCode": { - "type": "integer", - "format": "int32" - }, - "receiptNumber": { - "type": "integer", - "format": "int32" - }, - "bankNumber": { - "type": "integer", - "format": "int32" - } - } - }, - "GetRecurringPaymentType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "cash" - } - } - }, - "GetRecurringTransactionsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetRecurringTransactionsTransactionType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "savingsAccountTransactionType.withdrawal" - }, - "value": { - "type": "string", - "example": "Withdrawal" - }, - "deposit": { - "type": "boolean", - "example": false - }, - "withdrawal": { - "type": "boolean", - "example": true - }, - "interestPosting": { - "type": "boolean", - "example": false - }, - "feeDeduction": { - "type": "boolean", - "example": false - } - } - }, - "GetRecurringCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transactionType": { - "$ref": "#/definitions/GetRecurringTransactionType" - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "string", - "example": "000000001" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2014, 6, 25]" - }, - "currency": { - "$ref": "#/definitions/GetRecurringCurrency" - }, - "amount": { - "type": "number", - "example": 100000 - }, - "reversed": { - "type": "boolean", - "example": false - }, - "paymentTypeOptions": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "GetRecurringTransactionType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsAccountTransactionType.deposit" - }, - "value": { - "type": "string", - "example": "Deposit" - }, - "deposit": { - "type": "boolean", - "example": true - }, - "withdrawal": { - "type": "boolean", - "example": false - }, - "interestPosting": { - "type": "boolean", - "example": false - }, - "feeDeduction": { - "type": "boolean", - "example": false - }, - "initiateTransfer": { - "type": "boolean", - "example": false - }, - "approveTransfer": { - "type": "boolean", - "example": false - }, - "withdrawTransfer": { - "type": "boolean", - "example": false - }, - "rejectTransfer": { - "type": "boolean", - "example": false - }, - "overdraftInterest": { - "type": "boolean", - "example": false - }, - "writtenoff": { - "type": "boolean", - "example": false - }, - "overdraftFee": { - "type": "boolean", - "example": true - } - } - }, - "PostRecurringDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostRecurringDepositAccountsAccountIdRequest": { - "type": "object" - }, - "PostRecurringDepositAccountsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostRecurringDepositAccountsRequest": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "submittedOnDate": { - "type": "string", - "example": "02 June 2014" - }, - "depositPeriod": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "depositPeriodFrequencyId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "depositAmount": { - "type": "number", - "format": "float", - "example": 10000 - }, - "isCalendarInherited": { - "type": "boolean", - "example": false - }, - "recurringFrequency": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "recurringFrequencyType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "mandatoryRecommendedDepositAmount": { - "type": "integer", - "format": "int64", - "example": 2000 - } - } - }, - "GetRecurringDepositAccountsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetRecurringDepositAccountsDepositPeriodFrequency": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "deposit.period.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetRecurringDepositAccountsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetRecurringDepositAccountsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetRecurringDepositAccountsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetRecurringDepositAccountsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetRecurringDepositAccountsMaxDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Years" - } - } - }, - "GetRecurringDepositAccountsMinDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetRecurringDepositAccountsRecurringDepositFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "recurring.deposit.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetRecurringDepositAccountsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Sangamesh N" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "savingsProductName": { - "type": "string", - "example": "RD01" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetRecurringDepositAccountsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetRecurringDepositAccountsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetRecurringDepositAccountsCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestCalculationDaysInYearType" - }, - "summary": { - "$ref": "#/definitions/GetRecurringDepositAccountsSummary" - }, - "depositAmount": { - "type": "number", - "format": "float", - "example": 1150 - }, - "maturityAmount": { - "type": "number", - "format": "float", - "example": 252.59 - }, - "maturityDate": { - "type": "string", - "format": "date", - "example": "[2014, 4, 3]" - }, - "recurringDepositAmount": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "recurringDepositFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurringDepositFrequencyType": { - "$ref": "#/definitions/GetRecurringDepositAccountsRecurringDepositFrequencyType" - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": false - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositAccountsMinDepositTermType" - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositAccountsMaxDepositTermType" - }, - "depositPeriod": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "depositPeriodFrequency": { - "$ref": "#/definitions/GetRecurringDepositAccountsDepositPeriodFrequency" - } - } - }, - "GetRecurringDepositAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "prematureClosed": { - "type": "boolean", - "example": false - }, - "transferInProgress": { - "type": "boolean", - "example": false - }, - "transferOnHold": { - "type": "boolean", - "example": false - } - } - }, - "GetRecurringDepositAccountsSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetRecurringDepositAccountsCurrency" - }, - "accountBalance": { - "type": "number", - "format": "float", - "example": 0 - } - } - }, - "GetRecurringDepositAccountsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2014, 3, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "GetRecurringDepositAccountsAccountChart": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "[2013, 10, 2]" - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "accountNumber": { - "type": "integer", - "format": "int64", - "example": "RD000023" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringDepositAccountsChartSlabs" - } - }, - "periodTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringDepositAccountsPeriodTypes" - } - } - } - }, - "GetRecurringDepositAccountsAccountChartCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetRecurringDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": "RD000023" - }, - "externalId": { - "type": "string", - "example": "RD-23" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Sangamesh N" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "savingsProductName": { - "type": "string", - "example": "RD01" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetRecurringDepositAccountsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetRecurringDepositAccountsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetRecurringDepositAccountsCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetRecurringDepositAccountsInterestCalculationDaysInYearType" - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": false - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositAccountsMinDepositTermType" - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositAccountsMaxDepositTermType" - }, - "recurringDepositAmount": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "recurringDepositFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "expectedFirstDepositOnDate": { - "type": "string", - "format": "date", - "example": "[2014, 4, 2]" - }, - "recurringDepositFrequencyType": { - "$ref": "#/definitions/GetRecurringDepositAccountsRecurringDepositFrequencyType" - }, - "depositPeriod": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "depositPeriodFrequency": { - "$ref": "#/definitions/GetRecurringDepositAccountsDepositPeriodFrequency" - }, - "summary": { - "$ref": "#/definitions/GetRecurringDepositAccountsSummary" - }, - "accountChart": { - "$ref": "#/definitions/GetRecurringDepositAccountsAccountChart" - } - } - }, - "GetRecurringDepositAccountsChartSlabs": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "periodType": { - "$ref": "#/definitions/GetRecurringDepositAccountsPeriodType" - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 181 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 5.5 - }, - "currency": { - "$ref": "#/definitions/GetRecurringDepositAccountsAccountChartCurrency" - } - } - }, - "GetRecurringDepositAccountsPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetRecurringDepositAccountsPeriodTypes": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetRecurringDepositAccountsTemplateResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "small business" - }, - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringProductOptions" - } - } - } - }, - "GetRecurringProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passbook Savings" - } - } - }, - "PutRecurringDepositAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutRecurringDepositAccountsChanges" - } - } - }, - "PutRecurringDepositAccountsChanges": { - "type": "object", - "properties": { - "depositAmount": { - "type": "integer", - "format": "int32", - "example": 6000 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutRecurringDepositAccountsAccountIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "depositAmount": { - "type": "integer", - "format": "int32", - "example": 6000 - } - } - }, - "DeleteRecurringDepositAccountsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetRecurringDepositProductsAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountingRuleType.none" - }, - "value": { - "type": "string", - "example": "NONE" - } - } - }, - "GetRecurringDepositProductsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetRecurringDepositProductsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetRecurringDepositProductsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetRecurringDepositProductsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetRecurringDepositProductsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetRecurringDepositProductsMaxDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Years" - } - } - }, - "GetRecurringDepositProductsMinDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetRecurringDepositProductsRecurringDepositFrequencyType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "recurring.deposit.savingsPeriodFrequencyType.months" - }, - "value": { - "type": "string", - "example": "Months" - } - } - }, - "GetRecurringDepositProductsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "name": { - "type": "string", - "example": "RD01" - }, - "shortName": { - "type": "string", - "example": "RD01" - }, - "description": { - "type": "string", - "example": "RD01" - }, - "currency": { - "$ref": "#/definitions/GetRecurringDepositProductsCurrency" - }, - "recurringDepositFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurringDepositFrequencyType": { - "$ref": "#/definitions/GetRecurringDepositProductsRecurringDepositFrequencyType" - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": false - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositProductsMinDepositTermType" - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositProductsMaxDepositTermType" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 0 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestCalculationDaysInYearType" - }, - "accountingRule": { - "$ref": "#/definitions/GetRecurringDepositProductsAccountingRule" - } - } - }, - "GetRecurringDepositProductsProductIdAccountingMappings": { - "type": "object", - "properties": { - "savingsReferenceAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdSavingsReferenceAccount" - }, - "incomeFromFeeAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdIncomeFromFeeAccount" - }, - "incomeFromPenaltyAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdIncomeFromPenaltyAccount" - }, - "interestOnSavingsAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdInterestOnSavingsAccount" - }, - "savingsControlAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdSavingsControlAccount" - }, - "transfersInSuspenseAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdTransfersInSuspenseAccount" - } - } - }, - "GetRecurringDepositProductsProductIdActiveChart": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "fromDate": { - "type": "string", - "format": "date", - "example": "[2014, 1, 1]" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "savingsProductName": { - "type": "string", - "example": "Recurring deposit product" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdChartSlabs" - } - }, - "periodTypes": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdPeriodType" - } - } - } - }, - "GetRecurringDepositProductsProductIdChartSlabs": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 18 - }, - "description": { - "type": "string", - "example": "from 0 to 90 days" - }, - "periodType": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdPeriodType" - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 90 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 4.5 - }, - "currency": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdCurrency" - } - } - }, - "GetRecurringDepositProductsProductIdCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetRecurringDepositProductsProductIdFeeToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdFeeToIncomeAccountMappingsCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdFeeToIncomeAccountMappingsIncomeAccount" - } - } - }, - "GetRecurringDepositProductsProductIdFeeToIncomeAccountMappingsCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "sav charge" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetRecurringDepositProductsProductIdFeeToIncomeAccountMappingsIncomeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "name": { - "type": "string", - "example": "income from savings fee" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 24 - } - } - }, - "GetRecurringDepositProductsProductIdIncomeFromFeeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "name": { - "type": "string", - "example": "income from savings fee" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 24 - } - } - }, - "GetRecurringDepositProductsProductIdIncomeFromPenaltyAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 17 - }, - "name": { - "type": "string", - "example": "income from sav penalties" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 25 - } - } - }, - "GetRecurringDepositProductsProductIdInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.daily" - }, - "value": { - "type": "string", - "example": "Daily" - } - } - }, - "GetRecurringDepositProductsProductIdInterestOnSavingsAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "name": { - "type": "string", - "example": "interest on savings" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 23 - } - } - }, - "GetRecurringDepositProductsProductIdMaxDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.years" - }, - "value": { - "type": "string", - "example": "Years" - } - } - }, - "GetRecurringDepositProductsProductIdMinDepositTermType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "deposit.term.savingsPeriodFrequencyType.weeks" - }, - "value": { - "type": "string", - "example": "Weeks" - } - } - }, - "GetRecurringDepositProductsProductIdPenaltyToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdPenaltyToIncomeAccountMappingsCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdIncomeFromPenaltyAccount" - } - } - }, - "GetRecurringDepositProductsProductIdPenaltyToIncomeAccountMappingsCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "sav 2" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": true - } - } - }, - "GetRecurringDepositProductsProductIdPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "interestChartPeriodType.weeks" - }, - "value": { - "type": "string", - "example": "Weeks" - } - } - }, - "GetRecurringDepositProductsProductIdPreClosurePenalInterestOnType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "preClosurePenalInterestOnType.wholeTerm" - }, - "value": { - "type": "string", - "example": "Whole term" - } - } - }, - "GetRecurringDepositProductsProductIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Recurring deposit product" - }, - "shortName": { - "type": "string", - "example": "RD01" - }, - "description": { - "type": "string", - "example": "Daily compounding using Daily Balance, 5% per year, 365 days in year" - }, - "currency": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetRecurringDepositProductsInterestCalculationDaysInYearType" - }, - "accountingMappings": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdAccountingMappings" - }, - "feeToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdFeeToIncomeAccountMappings" - } - }, - "penaltyToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdPenaltyToIncomeAccountMappings" - } - }, - "recurringDepositFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurringDepositFrequencyType": { - "$ref": "#/definitions/GetRecurringDepositProductsRecurringDepositFrequencyType" - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": true - }, - "preClosurePenalInterest": { - "type": "number", - "format": "double", - "example": 1.75 - }, - "preClosurePenalInterestOnType": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdPreClosurePenalInterestOnType" - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdMinDepositTermType" - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "maxDepositTermType": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdMaxDepositTermType" - }, - "activeChart": { - "$ref": "#/definitions/GetRecurringDepositProductsProductIdActiveChart" - } - } - }, - "GetRecurringDepositProductsProductIdSavingsControlAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "name": { - "type": "string", - "example": "savings ref tool kit" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 21 - } - } - }, - "GetRecurringDepositProductsProductIdSavingsReferenceAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "savings ref" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 20 - } - } - }, - "GetRecurringDepositProductsProductIdTransfersInSuspenseAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "name": { - "type": "string", - "example": "saving transfers" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 22 - } - } - }, - "PutRecurringDepositProductsChanges": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Recurring deposit product new offerings" - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - } - } - }, - "PutRecurringDepositProductsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutRecurringDepositProductsChanges" - } - } - }, - "PutRecurringDepositProductsRequest": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Recurring deposit product new offerings" - }, - "locale": { - "type": "string", - "example": "en" - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "minDepositTermTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "DeleteRecurringDepositProductsProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostRecurringDepositProductsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostRecurringDepositProductsChartSlabs": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "from 0 to 90 days" - }, - "periodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fromPeriod": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "toPeriod": { - "type": "integer", - "format": "int32", - "example": 90 - }, - "annualInterestRate": { - "type": "number", - "format": "double", - "example": 4.5 - } - } - }, - "PostRecurringDepositProductsCharts": { - "type": "object", - "properties": { - "fromDate": { - "type": "string", - "example": "01 Jan 2014" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "chartSlabs": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostRecurringDepositProductsChartSlabs" - } - } - } - }, - "PostRecurringDepositProductsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Recurring deposit product" - }, - "shortName": { - "type": "string", - "example": "RD01" - }, - "description": { - "type": "string", - "example": "Daily compounding using Daily Balance, 5% per year, 365 days in year" - }, - "currencyCode": { - "type": "string", - "example": "USD" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "locale": { - "type": "string", - "example": "en" - }, - "interestCompoundingPeriodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestPostingPeriodType": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "interestCalculationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestCalculationDaysInYearType": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "accountingRule": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurringDepositFrequency": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "recurringDepositFrequencyTypeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "preClosurePenalApplicable": { - "type": "boolean", - "example": true - }, - "preClosurePenalInterest": { - "type": "number", - "format": "double", - "example": 1.75 - }, - "preClosurePenalInterestOnTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minDepositTerm": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "minDepositTermTypeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "maxDepositTerm": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "maxDepositTermTypeId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "depositAmount": { - "type": "integer", - "format": "int64", - "example": 10000 - }, - "minDepositAmount": { - "type": "integer", - "format": "int64", - "example": 100 - }, - "maxDepositAmount": { - "type": "integer", - "format": "int64", - "example": 1000000 - }, - "charts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostRecurringDepositProductsCharts" - } - } - } - }, - "GetChargesChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetChargesChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetSavingsAccountsSavingsAccountIdChargesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 57 - }, - "name": { - "type": "string", - "example": "Savings account maintenance fee" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetChargesChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetChargesChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetChargesCurrencyResponse" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountOrPercentage": { - "type": "number", - "format": "float", - "example": 100 - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passbook fee" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetChargesChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetChargesChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetChargesCurrencyResponse" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountOrPercentage": { - "type": "number", - "format": "float", - "example": 100 - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "PostSavingsAccountsSavingsAccountIdChargesResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 6 - } - } - }, - "PostSavingsAccountsSavingsAccountIdChargesRequest": { - "type": "object", - "properties": { - "chargeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "locale": { - "type": "string", - "example": "en" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "dueDate": { - "type": "string", - "example": "29 April 2013" - } - } - }, - "PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "changes": { - "$ref": "#/definitions/PutSavingsChanges" - } - } - }, - "PutSavingsChanges": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Passbook Savings Lite." - }, - "interestRate": { - "type": "number", - "format": "double", - "example": 5.73 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "amount": { - "type": "number", - "format": "float", - "example": 60 - }, - "dueDate": { - "type": "string", - "example": "27 March 2013" - } - } - }, - "PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "amount": { - "type": "number", - "format": "float", - "example": 60 - }, - "dueDate": { - "type": "string", - "example": "12 September 2013" - } - } - }, - "DeleteSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - } - } - }, - "GetChargesAppliesTo": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeAppliesTo.savings" - }, - "value": { - "type": "string", - "example": "Savings" - } - } - }, - "GetSavingsAccountsSavingsAccountIdChargesTemplateResponse": { - "type": "object", - "properties": { - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "chargeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsChargesOptions" - } - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSavingsChargesChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetSavingsChargesOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Passbook Fee" - }, - "active": { - "type": "boolean", - "example": true - }, - "penalty": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetChargesCurrencyResponse" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSavingsChargesChargeTimeType" - }, - "chargesAppliesTo": { - "$ref": "#/definitions/GetChargesAppliesTo" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetChargesChargeCalculationType" - } - } - }, - "PostSavingsAccountsAccountIdChanges": { - "type": "object" - }, - "PostSavingsAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "changes": { - "$ref": "#/definitions/PostSavingsAccountsAccountIdChanges" - } - } - }, - "PostSavingsAccountsAccountIdRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en" - }, - "unassignedDate": { - "type": "string", - "example": "05 September 2014" - } - } - }, - "PostSavingsAccountsResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostSavingsAccountsRequest": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "submittedOnDate": { - "type": "string", - "example": "01 March 2011" - } - } - }, - "GetSavingsAccountsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsPageItems" - } - } - } - }, - "GetSavingsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetSavingsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetSavingsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetSavingsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.daily" - }, - "value": { - "type": "string", - "example": "Daily" - } - } - }, - "GetSavingsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetSavingsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "string", - "example": "000000001" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "small business" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsProductName": { - "type": "string", - "example": "Passbook Savings" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetSavingsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetSavingsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 5 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetSavingsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetSavingsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetSavingsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetSavingsInterestCalculationDaysInYearType" - }, - "summary": { - "$ref": "#/definitions/GetSavingsSummary" - } - } - }, - "GetSavingsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetSavingsSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "accountBalance": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetSavingsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 3, 1]" - } - } - }, - "GetSavingsAccountsAccountIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "string", - "example": "000000001" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "small business" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsProductName": { - "type": "string", - "example": "Passbook Savings" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetSavingsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetSavingsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 5 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetSavingsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetSavingsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetSavingsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetSavingsInterestCalculationDaysInYearType" - }, - "summary": { - "$ref": "#/definitions/GetSavingsAccountsSummary" - } - } - }, - "GetSavingsAccountsSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "accountBalance": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "availableBalance": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetSavingsAccountsTemplateResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "small business" - }, - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductOptions" - } - } - } - }, - "GetSavingsProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passbook Savings" - } - } - }, - "PutSavingsAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutSavingsAccountsChanges" - } - } - }, - "PutSavingsAccountsChanges": { - "type": "object", - "properties": { - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 5.9999999999 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutSavingsAccountsAccountIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 5.9999999999 - } - } - }, - "DeleteSavingsAccountsAccountIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetSavingsProductsAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountingRuleType.cash" - }, - "value": { - "type": "string", - "example": "CASH BASED" - } - } - }, - "GetSavingsProductsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetSavingsProductsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetSavingsProductsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.daily" - }, - "value": { - "type": "string", - "example": "Daily" - } - } - }, - "GetSavingsProductsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetSavingsProductsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Savings product" - }, - "shortName": { - "type": "string", - "example": "sa1" - }, - "description": { - "type": "string", - "example": "gtasga" - }, - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "nominalAnnualInterestRate": { - "type": "number", - "example": 5 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetSavingsProductsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetSavingsProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationDaysInYearType" - }, - "withdrawalFeeForTransfers": { - "type": "boolean", - "example": false - }, - "accountingRule": { - "$ref": "#/definitions/GetSavingsProductsAccountingRule" - } - } - }, - "GetSavingsProductsAccountingMappings": { - "type": "object", - "properties": { - "savingsReferenceAccount": { - "$ref": "#/definitions/GetSavingsProductsSavingsReferenceAccount" - }, - "incomeFromFeeAccount": { - "$ref": "#/definitions/GetSavingsProductsIncomeFromFeeAccount" - }, - "incomeFromPenaltyAccount": { - "$ref": "#/definitions/GetSavingsProductsIncomeFromPenaltyAccount" - }, - "interestOnSavingsAccount": { - "$ref": "#/definitions/GetSavingsProductsInterestOnSavingsAccount" - }, - "savingsControlAccount": { - "$ref": "#/definitions/GetSavingsProductsSavingsControlAccount" - }, - "transfersInSuspenseAccount": { - "$ref": "#/definitions/GetSavingsProductsTransfersInSuspenseAccount" - } - } - }, - "GetSavingsProductsFeeToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetSavingsProductsFeeToIncomeAccountMappingsCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetSavingsProductsFeeToIncomeAccountMappingsIncomeAccount" - } - } - }, - "GetSavingsProductsFeeToIncomeAccountMappingsCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "sav charge" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSavingsProductsFeeToIncomeAccountMappingsIncomeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "name": { - "type": "string", - "example": "income from savings fee" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 24 - } - } - }, - "GetSavingsProductsFundSourceAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "savings ref" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 20 - } - } - }, - "GetSavingsProductsIncomeFromFeeAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 16 - }, - "name": { - "type": "string", - "example": "income from savings fee" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 24 - } - } - }, - "GetSavingsProductsIncomeFromPenaltyAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 17 - }, - "name": { - "type": "string", - "example": "income from sav penalties" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 25 - } - } - }, - "GetSavingsProductsInterestOnSavingsAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "name": { - "type": "string", - "example": "interest on savings" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 23 - } - } - }, - "GetSavingsProductsPaymentChannelToFundSourceMappings": { - "type": "object", - "properties": { - "paymentType": { - "$ref": "#/definitions/GetSavingsProductsPaymentType" - }, - "fundSourceAccount": { - "$ref": "#/definitions/GetSavingsProductsFundSourceAccount" - } - } - }, - "GetSavingsProductsPaymentType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "name": { - "type": "string", - "example": "check" - } - } - }, - "GetSavingsProductsPenaltyToIncomeAccountMappings": { - "type": "object", - "properties": { - "charge": { - "$ref": "#/definitions/GetSavingsProductsPenaltyToIncomeAccountMappingsCharge" - }, - "incomeAccount": { - "$ref": "#/definitions/GetSavingsProductsIncomeFromPenaltyAccount" - } - } - }, - "GetSavingsProductsPenaltyToIncomeAccountMappingsCharge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "sav 2" - }, - "active": { - "type": "boolean", - "example": false - }, - "penalty": { - "type": "boolean", - "example": true - } - } - }, - "GetSavingsProductsProductIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "savings product" - }, - "shortName": { - "type": "string", - "example": "sa1" - }, - "description": { - "type": "string", - "example": "gtasga" - }, - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "nominalAnnualInterestRate": { - "type": "number", - "example": 5 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetSavingsProductsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetSavingsProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationDaysInYearType" - }, - "withdrawalFeeForTransfers": { - "type": "boolean", - "example": false - }, - "accountingRule": { - "$ref": "#/definitions/GetSavingsProductsAccountingRule" - }, - "accountingMappings": { - "$ref": "#/definitions/GetSavingsProductsAccountingMappings" - }, - "paymentChannelToFundSourceMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsPaymentChannelToFundSourceMappings" - } - }, - "feeToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsFeeToIncomeAccountMappings" - } - }, - "penaltyToIncomeAccountMappings": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsPenaltyToIncomeAccountMappings" - } - }, - "charges": { - "type": "array", - "example": "[]", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "GetSavingsProductsSavingsControlAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 13 - }, - "name": { - "type": "string", - "example": "savings ref tool kit" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 21 - } - } - }, - "GetSavingsProductsSavingsReferenceAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "name": { - "type": "string", - "example": "savings ref" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 20 - } - } - }, - "GetSavingsProductsTransfersInSuspenseAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "name": { - "type": "string", - "example": "saving transfers" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 22 - } - } - }, - "GetSavingsAssetLiabilityType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountType.asset" - }, - "value": { - "type": "string", - "example": "ASSET" - } - } - }, - "GetSavingsAssetTagId": { - "type": "object" - }, - "GetSavingsChargeCalculationType": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetSavingsChargePaymentMode": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "chargepaymentmode.regular" - }, - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "value": { - "type": "string", - "example": "chargepaymentmode.regular" - } - } - }, - "GetSavingsChargeTimeType": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetSavingsProductsAccountingMappingOptions": { - "type": "object", - "properties": { - "liabilityAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsLiabilityAccountOptions" - } - }, - "assetAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsAssetAccountOptions" - } - }, - "expenseAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsExpenseAccountOptions" - } - }, - "incomeAccountOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsIncomeAccountOptions" - } - } - } - }, - "GetSavingsProductsAssetAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Cash" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 100001 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetSavingsAssetLiabilityType" - }, - "usage": { - "$ref": "#/definitions/GetSavingsProductsLiabilityUsage" - }, - "tagId": { - "$ref": "#/definitions/GetSavingsAssetTagId" - } - } - }, - "GetSavingsProductsChargeAppliesTo": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "chargeAppliesTo.savings" - }, - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "value": { - "type": "string", - "example": "Savings" - } - } - }, - "GetSavingsProductsChargeOptions": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "example": true - }, - "amount": { - "type": "integer", - "format": "int64", - "example": 200 - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetSavingsProductsChargeAppliesTo" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetSavingsChargeCalculationType" - }, - "chargePaymentMode": { - "$ref": "#/definitions/GetSavingsChargePaymentMode" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSavingsChargeTimeType" - }, - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "Savings charge 1" - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSavingsProductsExpenseAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "name": { - "type": "string", - "example": "Write Off Expenses" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 60001 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetSavingsProductsExpenseType" - }, - "usage": { - "$ref": "#/definitions/GetSavingsProductsLiabilityUsage" - }, - "tagId": { - "$ref": "#/definitions/GetSavingsAssetTagId" - } - } - }, - "GetSavingsProductsExpenseType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "code": { - "type": "string", - "example": "accountType.expense" - }, - "value": { - "type": "string", - "example": "EXPENSE" - } - } - }, - "GetSavingsProductsIncomeAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "name": { - "type": "string", - "example": "income from interest" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 40001 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetSavingsProductsIncomeType" - }, - "usage": { - "$ref": "#/definitions/GetSavingsProductsLiabilityUsage" - }, - "tagId": { - "$ref": "#/definitions/GetSavingsAssetTagId" - } - } - }, - "GetSavingsProductsIncomeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "accountType.income" - }, - "value": { - "type": "string", - "example": "INCOME" - } - } - }, - "GetSavingsProductsLiabilityAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "name": { - "type": "string", - "example": "Savings Control" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 50001 - }, - "disabled": { - "type": "boolean", - "example": false - }, - "manualEntriesAllowed": { - "type": "boolean", - "example": true - }, - "type": { - "$ref": "#/definitions/GetSavingsProductsLiabilityType" - }, - "usage": { - "$ref": "#/definitions/GetSavingsProductsLiabilityUsage" - }, - "nameDecorated": { - "type": "string", - "example": "Savings Control" - }, - "tagId": { - "$ref": "#/definitions/GetSavingsProductsLiabilityTagId" - } - } - }, - "GetSavingsProductsLiabilityTagId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetSavingsProductsLiabilityType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.liability" - }, - "value": { - "type": "string", - "example": "LIABILITY" - } - } - }, - "GetSavingsProductsLiabilityUsage": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountUsage.detail" - }, - "value": { - "type": "string", - "example": "DETAIL" - } - } - }, - "GetSavingsProductsLockinPeriodFrequencyTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "savings.lockin.savingsPeriodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "Days" - } - } - }, - "GetSavingsProductsPaymentTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "name": { - "type": "string", - "example": "Wire Transfer" - }, - "position": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetSavingsProductsTemplateAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "accountingRuleType.none" - }, - "value": { - "type": "string", - "example": "NONE" - } - } - }, - "GetSavingsProductsTemplateResponse": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetSavingsCurrency" - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetSavingsProductsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetSavingsProductsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationDaysInYearType" - }, - "accountingRule": { - "$ref": "#/definitions/GetSavingsProductsTemplateAccountingRule" - }, - "currencyOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsCurrency" - } - }, - "interestCompoundingPeriodTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsInterestCompoundingPeriodType" - } - }, - "interestPostingPeriodTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsInterestPostingPeriodType" - } - }, - "interestCalculationTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationType" - } - }, - "interestCalculationDaysInYearTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsInterestCalculationDaysInYearType" - } - }, - "lockinPeriodFrequencyTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsLockinPeriodFrequencyTypeOptions" - } - }, - "withdrawalFeeTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsWithdrawalFeeTypeOptions" - } - }, - "paymentTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsPaymentTypeOptions" - } - }, - "accountingRuleOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsTemplateAccountingRule" - } - }, - "accountingMappingOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsAccountingMappingOptions" - } - }, - "chargeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSavingsProductsChargeOptions" - } - } - } - }, - "GetSavingsProductsWithdrawalFeeTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsWithdrawalFeesType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "PutSavingsProductsProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutSavingsChanges" - } - } - }, - "PutSavingsProductsProductIdRequest": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Passbook Savings Lite." - }, - "locale": { - "type": "string", - "example": "en" - }, - "interestRate": { - "type": "number", - "format": "double", - "example": 5.73 - } - } - }, - "DeleteSavingsProductsProductIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostSavingsProductsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostSavingsCharges": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostSavingsProductsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Passbook Savings" - }, - "shortName": { - "type": "string", - "example": "PBSV" - }, - "description": { - "type": "string", - "example": "Daily compounding using Daily Balance, 5% per year, 365 days in year" - }, - "currencyCode": { - "type": "string", - "example": "USD" - }, - "digitsAfterDecimal": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "locale": { - "type": "string", - "example": "en" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 5 - }, - "interestCompoundingPeriodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestPostingPeriodType": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "interestCalculationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestCalculationDaysInYearType": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "accountingRule": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "charges": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostSavingsCharges" - } - } - } - }, - "GetSearchResponse": { - "type": "object", - "properties": { - "entityId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "entityAccountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "entityExternalId": { - "type": "string", - "example": "ID_JKZGEXF" - }, - "entityName": { - "type": "string", - "example": "Group_Name_HVCU5" - }, - "entityType": { - "type": "string", - "example": "GROUP" - }, - "parentId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "parentName": { - "type": "string", - "example": "Head Office" - }, - "entityStatus": { - "$ref": "#/definitions/EnumOptionData" - } - } - }, - "PostAdhocQuerySearchResponse": { - "type": "object", - "properties": { - "officeName": { - "type": "string", - "example": "HFC" - }, - "loanProductName": { - "type": "string", - "example": "01 BC3M" - }, - "loanOutStanding": { - "type": "integer", - "format": "int64", - "example": " 5692.41" - }, - "percentage": { - "type": "integer", - "format": "int64", - "example": "76.4" - } - } - }, - "PostAdhocQuerySearchRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "loanDateOption": { - "type": "string", - "example": "approvalDate" - }, - "loanFromDate": { - "type": "string", - "format": "date", - "example": "2013-01-01" - }, - "loanToDate": { - "type": "string", - "format": "date", - "example": "2014-01-27" - }, - "includeOutStandingAmountPercentage": { - "type": "boolean", - "example": true - }, - "outStandingAmountPercentageCondition": { - "type": "string", - "example": "<=" - }, - "outStandingAmountPercentage": { - "type": "integer", - "format": "int64", - "example": 80 - }, - "includeOutstandingAmount": { - "type": "boolean", - "example": true - }, - "outstandingAmountCondition": { - "type": "string", - "example": "between" - }, - "minOutstandingAmount": { - "type": "integer", - "format": "int64", - "example": 100 - }, - "maxOutstandingAmount": { - "type": "integer", - "format": "int64", - "example": 10000 - } - } - }, - "GetAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetAccountTransferTemplateResponse": { - "type": "object", - "properties": { - "accountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetAccountOptions" - } - }, - "fromAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFromAccountOptions" - } - }, - "toAccountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetFromAccountOptions" - } - } - } - }, - "GetFromAccountOptions": { - "type": "object", - "properties": { - "accountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNo": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountType": { - "$ref": "#/definitions/GetAccountOptions" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "ABC" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "HEAD OFFICE" - } - } - }, - "PostNewTransferResponse": { - "type": "object", - "properties": { - "savingsId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetSelfBeneficiariesAccountOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.savings" - }, - "value": { - "type": "string", - "example": "Savings Account" - } - } - }, - "GetSelfBeneficiariesTPTResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Client2Savings" - }, - "officeName": { - "type": "string", - "example": "Test Office" - }, - "clientName": { - "type": "string", - "example": "FN2 LN2" - }, - "accountType": { - "$ref": "#/definitions/GetSelfBeneficiariesAccountOptions" - }, - "accountNumber": { - "type": "integer", - "format": "int64", - "example": 2 - }, - "transferLimit": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetSelfBeneficiariesTPTTemplateResponse": { - "type": "object", - "properties": { - "accountTypeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfBeneficiariesAccountOptions" - } - } - } - }, - "PostSelfBeneficiariesTPTResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 5 - } - } - }, - "PostSelfBeneficiariesTPTRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en_GB" - }, - "name": { - "type": "string", - "example": "beneficiary nick name" - }, - "officeName": { - "type": "string", - "example": "HEAD OFFICE" - }, - "accountNumber": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transferLimit": { - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "PutSelfBeneficiariesChanges": { - "type": "object", - "properties": { - "transferLimit": { - "type": "integer", - "format": "int32", - "example": 1000 - }, - "name": { - "type": "string", - "example": "Client22" - } - } - }, - "PutSelfBeneficiariesTPTBeneficiaryIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "changes": { - "$ref": "#/definitions/PutSelfBeneficiariesChanges" - } - } - }, - "PutSelfBeneficiariesTPTBeneficiaryIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "beneficiary nick name" - }, - "transferLimit": { - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "DeleteSelfBeneficiariesTPTBeneficiaryIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 5 - } - } - }, - "GetSelfClientsChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetSelfClientsChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetSelfClientsChargesPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "name": { - "type": "string", - "example": "Client Fees 2" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSelfClientsChargeTimeType" - }, - "dueDate": { - "type": "string", - "format": "date", - "example": "[2015, 9, 1]" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetSelfClientsChargeCalculationType" - }, - "currency": { - "$ref": "#/definitions/GetSelfClientsSavingsAccountsCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 550 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 550 - }, - "penalty": { - "type": "boolean", - "example": false - }, - "isActive": { - "type": "boolean", - "example": true - }, - "isPaid": { - "type": "boolean", - "example": false - }, - "isWaived": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfClientsClientIdChargesResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfClientsChargesPageItems" - } - } - } - }, - "GetSelfClientsSavingsAccountsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetSelfClientsClientIdChargesChargeIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 5 - }, - "name": { - "type": "string", - "example": "Client Fee 1" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSelfClientsChargeTimeType" - }, - "dueDate": { - "type": "string", - "format": "date", - "example": "[2015, 8, 17]" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetSelfClientsChargeCalculationType" - }, - "currency": { - "$ref": "#/definitions/GetSelfClientsSavingsAccountsCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 0 - }, - "penalty": { - "type": "boolean", - "example": true - }, - "isActive": { - "type": "boolean", - "example": true - }, - "isPaid": { - "type": "boolean", - "example": false - }, - "isWaived": { - "type": "boolean", - "example": true - } - } - }, - "GetSelfClientsClientIdTransactionsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 226 - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "type": { - "$ref": "#/definitions/GetSelfClientsClientIdTransactionsType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2015, 9, 2]" - }, - "currency": { - "$ref": "#/definitions/GetSelfClientsSavingsAccountsCurrency" - }, - "amount": { - "type": "number", - "format": "double", - "example": 22 - }, - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2015, 9, 2]" - }, - "reversed": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfClientsClientIdTransactionsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 20 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfClientsClientIdTransactionsPageItems" - } - } - } - }, - "GetSelfClientsClientIdTransactionsType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "clientTransactionType.payCharge" - }, - "value": { - "type": "string", - "example": "PAY_CHARGE" - } - } - }, - "GetSelfClientsClientIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "type": { - "$ref": "#/definitions/GetSelfClientsClientIdTransactionsType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2015, 8, 17]" - }, - "currency": { - "$ref": "#/definitions/GetSelfClientsSavingsAccountsCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 60 - }, - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2015, 8, 19]" - }, - "reversed": { - "type": "boolean", - "example": true - } - } - }, - "GetSelfClientsClientIdAccountsResponse": { - "type": "object", - "properties": { - "loanAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfClientsLoanAccounts" - } - }, - "savingsAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfClientsSavingsAccounts" - } - } - } - }, - "GetSelfClientsLoanAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "externalId": { - "type": "integer", - "format": "int32", - "example": 456 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productName": { - "type": "string", - "example": "TestOne" - }, - "status": { - "$ref": "#/definitions/GetSelfClientsLoanAccountsStatus" - }, - "loanType": { - "$ref": "#/definitions/GetSelfClientsLoanAccountsType" - }, - "loanCycle": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "GetSelfClientsLoanAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "loanStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - }, - "pendingApproval": { - "type": "boolean", - "example": false - }, - "waitingForDisbursal": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": true - }, - "closedObligationsMet": { - "type": "boolean", - "example": false - }, - "closedWrittenOff": { - "type": "boolean", - "example": false - }, - "closedRescheduled": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "overpaid": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfClientsLoanAccountsType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "loanType.individual" - }, - "value": { - "type": "string", - "example": "Individual" - } - } - }, - "GetSelfClientsSavingsAccounts": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 7 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "productName": { - "type": "string", - "example": "Other product" - }, - "status": { - "$ref": "#/definitions/GetSelfClientsSavingsAccountsStatus" - }, - "currency": { - "$ref": "#/definitions/GetSelfClientsSavingsAccountsCurrency" - } - } - }, - "GetSelfClientsSavingsAccountsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfClientsPageItems": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "status": { - "$ref": "#/definitions/GetSelfClientsStatus" - }, - "active": { - "type": "boolean", - "example": true - }, - "activationDate": { - "type": "string", - "format": "date", - "example": "[2013, 3, 1]" - }, - "fullname": { - "type": "string", - "example": "Small shop" - }, - "displayName": { - "type": "string", - "example": "Small shop" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - } - } - }, - "GetSelfClientsResponse": { - "type": "object", - "properties": { - "totalFilteredRecords": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "pageItems": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfClientsPageItems" - } - } - } - }, - "GetSelfClientsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 300 - }, - "code": { - "type": "string", - "example": "clientStatusType.active" - }, - "value": { - "type": "string", - "example": "Active" - } - } - }, - "GetSelfClientsClientIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 27 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 27 - }, - "status": { - "$ref": "#/definitions/GetSelfClientsStatus" - }, - "active": { - "type": "boolean", - "example": true - }, - "activationDate": { - "type": "string", - "format": "date", - "example": "[2013, 1, 1]" - }, - "firstname": { - "type": "string", - "example": "savings" - }, - "lastname": { - "type": "string", - "example": "test" - }, - "displayName": { - "type": "string", - "example": "savings test" - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "timeline": { - "$ref": "#/definitions/GetSelfClientsTimeline" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "savingsProductName": { - "type": "string", - "example": "account overdraft" - }, - "groups": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "GetSelfClientsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 1, 1]" - }, - "submittedByUsername": { - "type": "string", - "example": "mifos" - }, - "submittedByFirstname": { - "type": "string", - "example": "App" - }, - "submittedByLastname": { - "type": "string", - "example": "Administrator" - }, - "activatedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 1, 1]" - }, - "activatedByUsername": { - "type": "string", - "example": "mifos" - }, - "activatedByFirstname": { - "type": "string", - "example": "App" - }, - "activatedByLastname": { - "type": "string", - "example": "Administrator" - } - } - }, - "GetLoanCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetSelfLoansLoanIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "type": { - "$ref": "#/definitions/GetSelfLoansLoanIdTransactionsType" - }, - "date": { - "type": "string", - "format": "date", - "example": "[2012, 5, 14]" - }, - "manuallyReversed": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetLoanCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 559.88 - }, - "interestPortion": { - "type": "number", - "format": "float", - "example": 559.88 - } - } - }, - "GetSelfLoansLoanIdTransactionsType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "loanTransactionType.repayment" - }, - "value": { - "type": "string", - "example": "Repayment" - }, - "disbursement": { - "type": "boolean", - "example": false - }, - "repaymentAtDisbursement": { - "type": "boolean", - "example": false - }, - "repayment": { - "type": "boolean", - "example": true - }, - "contra": { - "type": "boolean", - "example": false - }, - "waiveInterest": { - "type": "boolean", - "example": false - }, - "waiveCharges": { - "type": "boolean", - "example": false - }, - "writeOff": { - "type": "boolean", - "example": false - }, - "recoveryRepayment": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfLoansChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetSelfLoansChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeTimeType.disbursement" - }, - "value": { - "type": "string", - "example": "Disbursement" - } - } - }, - "GetSelfLoansLoanIdChargesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Loan Processing fee" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSelfLoansChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetSelfLoansChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetLoanCurrency" - }, - "amount": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountPaid": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWaived": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountWrittenOff": { - "type": "number", - "format": "float", - "example": 0 - }, - "amountOutstanding": { - "type": "number", - "format": "float", - "example": 100 - }, - "amountOrPercentage": { - "type": "number", - "format": "float", - "example": 100 - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfLoansLoanIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "status": { - "$ref": "#/definitions/GetLoansLoanIdStatus" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Kampala first Client" - }, - "clientOfficeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "loanProductId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanProductName": { - "type": "string", - "example": "Kampala Product (with cash accounting)" - }, - "loanProductDescription": { - "type": "string", - "example": "Typical Kampala loan product with cash accounting enabled for testing." - }, - "loanPurposeId": { - "type": "integer", - "format": "int32", - "example": 22 - }, - "loanPurposeName": { - "type": "string", - "example": "option.HousingImprovement" - }, - "loanOfficerId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "loanOfficerName": { - "type": "string", - "example": "LoanOfficer, Kampala" - }, - "loanType": { - "$ref": "#/definitions/GetLoansLoanIdLoanType" - }, - "currency": { - "$ref": "#/definitions/GetLoansLoanIdCurrency" - }, - "principal": { - "type": "integer", - "format": "int64", - "example": 1000000 - }, - "termFrequency": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "termPeriodFrequencyType": { - "$ref": "#/definitions/GetLoansLoanIdTermPeriodFrequencyType" - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "$ref": "#/definitions/GetLoansLoanIdRepaymentFrequencyType" - }, - "interestRatePerPeriod": { - "type": "integer", - "format": "int32", - "example": 24 - }, - "interestRateFrequencyType": { - "$ref": "#/definitions/GetLoansLoanIdInterestRateFrequencyType" - }, - "annualInterestRate": { - "type": "integer", - "format": "int32", - "example": 24 - }, - "amortizationType": { - "$ref": "#/definitions/GetLoansLoanIdAmortizationType" - }, - "interestType": { - "$ref": "#/definitions/GetLoansLoanIdInterestType" - }, - "interestCalculationPeriodType": { - "$ref": "#/definitions/GetLoansLoanIdInterestCalculationPeriodType" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "timeline": { - "$ref": "#/definitions/GetLoansLoanIdTimeline" - }, - "summary": { - "$ref": "#/definitions/GetLoansLoanIdSummary" - } - } - }, - "PostSelfLoansResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostSelfLoansData": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "Activation_Date": { - "type": "string", - "example": "01 December 2016 00:00" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy HH:mm" - } - } - }, - "PostSelfLoansDatatables": { - "type": "object", - "properties": { - "registeredTableName": { - "type": "string", - "example": "Date Loan Field" - }, - "data": { - "$ref": "#/definitions/PostSelfLoansData" - } - } - }, - "PostSelfLoansDisbursementData": { - "type": "object", - "properties": { - "expectedDisbursementDate": { - "type": "string", - "example": "01 November 2013" - }, - "principal": { - "type": "integer", - "format": "int64", - "example": 22000 - }, - "approvedPrincipal": { - "type": "integer", - "format": "int64", - "example": 22000 - } - } - }, - "PostSelfLoansRequest": { - "type": "object", - "properties": { - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "locale": { - "type": "string", - "example": "en_GB" - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "principal": { - "type": "number", - "format": "double", - "example": "10,000.00" - }, - "loanTermFrequency": { - "type": "integer", - "format": "int32", - "example": 12 - }, - "loanTermFrequencyType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "loanType": { - "type": "string", - "example": "individual" - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "interestRatePerPeriod": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "amortizationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "interestType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestCalculationPeriodType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "expectedDisbursementDate": { - "type": "string", - "example": "10 Jun 2013" - }, - "submittedOnDate": { - "type": "string", - "example": "10 Jun 2013" - }, - "linkAccountId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "fixedEmiAmount": { - "type": "integer", - "format": "int32", - "example": 1100 - }, - "maxOutstandingLoanBalance": { - "type": "integer", - "format": "int64", - "example": 35000 - }, - "disbursementData": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostSelfLoansDisbursementData" - } - }, - "datatables": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostSelfLoansDatatables" - } - } - } - }, - "PutSelfLoansChanges": { - "type": "object", - "properties": { - "principal": { - "type": "integer", - "format": "int64", - "example": 5000 - }, - "locale": { - "type": "string", - "example": "en" - } - } - }, - "PutSelfLoansLoanIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutSelfLoansChanges" - } - } - }, - "PutSelfLoansLoanIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "productId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "principal": { - "type": "integer", - "format": "int64", - "example": 5000 - }, - "loanTermFrequency": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "loanTermFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "numberOfRepayments": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "repaymentEvery": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "repaymentFrequencyType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestRatePerPeriod": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "interestType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "interestCalculationPeriodType": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amortizationType": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "expectedDisbursementDate": { - "type": "string", - "example": "04 March 2014" - }, - "transactionProcessingStrategyId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostSelfLoansLoanIdChanges": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/PostSelfLoansLoanIdStatus" - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "withdrawnOnDate": { - "type": "string", - "example": "20 September 2011" - }, - "closedOnDate": { - "type": "string", - "example": "20 September 2011" - } - } - }, - "PostSelfLoansLoanIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "loanId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "changes": { - "$ref": "#/definitions/PostSelfLoansLoanIdChanges" - } - } - }, - "PostSelfLoansLoanIdStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 400 - }, - "code": { - "type": "string", - "example": "loanStatusType.withdrawn.by.client" - }, - "value": { - "type": "string", - "example": "Withdrawn by applicant" - }, - "pendingApproval": { - "type": "boolean", - "example": false - }, - "waitingForDisbursal": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closedObligationsMet": { - "type": "boolean", - "example": false - }, - "closedWrittenOff": { - "type": "boolean", - "example": false - }, - "closedRescheduled": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - }, - "overpaid": { - "type": "boolean", - "example": false - } - } - }, - "PostSelfLoansLoanIdRequest": { - "type": "object", - "properties": { - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "withdrawnOnDate": { - "type": "string", - "example": "20 September 2011" - }, - "note": { - "type": "string", - "example": "Reason loan applicant withdrew from application." - } - } - }, - "GetSelfLoansProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Kampala Product (with cash accounting)" - } - } - }, - "GetSelfLoansTemplateResponse": { - "type": "object", - "properties": { - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "Kampala first Client" - }, - "clientOfficeId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "timeline": { - "$ref": "#/definitions/GetSelfLoansTimeline" - }, - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfLoansProductOptions" - } - } - } - }, - "GetSelfLoansTimeline": { - "type": "object", - "properties": { - "expectedDisbursementDate": { - "type": "string", - "format": "date", - "example": "[2013, 3, 8]" - } - } - }, - "PostLinkDelinkAccountsToFromPocketResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 6 - } - } - }, - "GetAccountsLinkedToPocketResponse": { - "type": "object", - "properties": { - "loanAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetPocketLoanAccounts" - } - }, - "savingAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetPocketSavingAccounts" - } - }, - "shareAccounts": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetPocketShareAccounts" - } - } - } - }, - "GetPocketLoanAccounts": { - "type": "object", - "properties": { - "pocketId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "accountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountNumber": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "id": { - "type": "integer", - "format": "int32", - "example": 10 - } - } - }, - "GetPocketSavingAccounts": { - "type": "object", - "properties": { - "pocketId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "accountType": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "accountNumber": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "id": { - "type": "integer", - "format": "int32", - "example": 11 - } - } - }, - "GetPocketShareAccounts": { - "type": "object" - }, - "GetPocketData": { - "type": "object", - "properties": { - "row": { - "type": "string", - "example": "[\"Head Office\", \"000000001\", \"John Doe\" \"2017-03-04\", \"786YYH7\"" - } - } - }, - "GetRunReportColumnHeaders": { - "type": "object", - "properties": { - "columnName": { - "type": "string", - "example": "Office/Branch" - }, - "columnType": { - "type": "string", - "example": "VARCHAR" - }, - "isColumnNullable": { - "type": "boolean", - "example": false - }, - "isColumnPrimaryKey": { - "type": "boolean", - "example": false - }, - "columnValues": { - "type": "string", - "example": "[]" - } - } - }, - "GetRunReportResponse": { - "type": "object", - "properties": { - "columnHeaders": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetRunReportColumnHeaders" - } - }, - "data": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetPocketData" - } - } - } - }, - "GetSelfSavingsAccountsAccountIdTransactionsTransactionIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "transactionType": { - "$ref": "#/definitions/GetSelfSavingsTransactionType" - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "date": { - "type": "string", - "format": "date", - "example": "[2013, 8, 7]" - }, - "currency": { - "$ref": "#/definitions/GetSelfSavingsTransactionCurrency" - }, - "paymentDetailData": { - "$ref": "#/definitions/GetSelfSavingsPaymentDetailData" - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 5000 - }, - "runningBalance": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "reversed": { - "type": "boolean", - "example": true - } - } - }, - "GetSelfSavingsPaymentDetailData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 62 - }, - "paymentType": { - "$ref": "#/definitions/GetSelfSavingsPaymentType" - }, - "accountNumber": { - "type": "integer", - "format": "int32" - }, - "checkNumber": { - "type": "integer", - "format": "int32" - }, - "routingCode": { - "type": "integer", - "format": "int32" - }, - "receiptNumber": { - "type": "integer", - "format": "int32" - }, - "bankNumber": { - "type": "integer", - "format": "int32" - } - } - }, - "GetSelfSavingsPaymentType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 11 - }, - "name": { - "type": "string", - "example": "cash" - } - } - }, - "GetSelfSavingsTransactionCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "inMultiplesOf": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetSelfSavingsTransactionType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "savingsAccountTransactionType.withdrawal" - }, - "value": { - "type": "string", - "example": "Withdrawal" - }, - "deposit": { - "type": "boolean", - "example": false - }, - "withdrawal": { - "type": "boolean", - "example": true - }, - "interestPosting": { - "type": "boolean", - "example": false - }, - "feeDeduction": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfSavingsAccountsAccountIdChargesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "accountId": { - "type": "integer", - "format": "int32", - "example": 57 - }, - "name": { - "type": "string", - "example": "Savings account maintenance fee" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSelfSavingsChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetSelfSavingsChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetSelfSavingsCurrency" - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "amountPaid": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amountWaived": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amountWrittenOff": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amountOutstanding": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "amountOrPercentage": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfSavingsChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetSelfSavingsChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeTimeType.specifiedDueDate" - }, - "value": { - "type": "string", - "example": "Specified due date" - } - } - }, - "GetSelfSavingsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetSelfSavingsAccountsAccountIdChargesSavingsAccountChargeIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "chargeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Passbook fee" - }, - "chargeTimeType": { - "$ref": "#/definitions/GetSelfSavingsChargeTimeType" - }, - "chargeCalculationType": { - "$ref": "#/definitions/GetSelfSavingsChargeCalculationType" - }, - "percentage": { - "type": "number", - "format": "double", - "example": 0 - }, - "amountPercentageAppliedTo": { - "type": "number", - "format": "double", - "example": 0 - }, - "currency": { - "$ref": "#/definitions/GetSelfSavingsCurrency" - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "amountPaid": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amountWaived": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amountWrittenOff": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "amountOutstanding": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "amountOrPercentage": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "penalty": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfSavingsAccountsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "accountNo": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "clientId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "clientName": { - "type": "string", - "example": "small business" - }, - "savingsProductId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "savingsProductName": { - "type": "string", - "example": "Passbook Savings" - }, - "fieldOfficerId": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "status": { - "$ref": "#/definitions/GetSelfSavingsStatus" - }, - "timeline": { - "$ref": "#/definitions/GetSelfSavingsTimeline" - }, - "currency": { - "$ref": "#/definitions/GetSelfSavingsCurrency" - }, - "nominalAnnualInterestRate": { - "type": "number", - "format": "double", - "example": 5 - }, - "interestCompoundingPeriodType": { - "$ref": "#/definitions/GetSelfSavingsInterestCompoundingPeriodType" - }, - "interestPostingPeriodType": { - "$ref": "#/definitions/GetSelfSavingsInterestPostingPeriodType" - }, - "interestCalculationType": { - "$ref": "#/definitions/GetSelfSavingsInterestCalculationType" - }, - "interestCalculationDaysInYearType": { - "$ref": "#/definitions/GetSelfSavingsInterestCalculationDaysInYearType" - }, - "summary": { - "$ref": "#/definitions/GetSelfSavingsSummary" - } - } - }, - "GetSelfSavingsInterestCalculationDaysInYearType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 365 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationDaysInYearType.days365" - }, - "value": { - "type": "string", - "example": "365 Days" - } - } - }, - "GetSelfSavingsInterestCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savingsInterestCalculationType.dailybalance" - }, - "value": { - "type": "string", - "example": "Daily Balance" - } - } - }, - "GetSelfSavingsInterestCompoundingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "savings.interest.period.savingsCompoundingInterestPeriodType.daily" - }, - "value": { - "type": "string", - "example": "Daily" - } - } - }, - "GetSelfSavingsInterestPostingPeriodType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "savings.interest.posting.period.savingsPostingInterestPeriodType.monthly" - }, - "value": { - "type": "string", - "example": "Monthly" - } - } - }, - "GetSelfSavingsStatus": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "savingsAccountStatusType.submitted.and.pending.approval" - }, - "value": { - "type": "string", - "example": "Submitted and pending approval" - }, - "submittedAndPendingApproval": { - "type": "boolean", - "example": true - }, - "approved": { - "type": "boolean", - "example": false - }, - "rejected": { - "type": "boolean", - "example": false - }, - "withdrawnByApplicant": { - "type": "boolean", - "example": false - }, - "active": { - "type": "boolean", - "example": false - }, - "closed": { - "type": "boolean", - "example": false - } - } - }, - "GetSelfSavingsSummary": { - "type": "object", - "properties": { - "currency": { - "$ref": "#/definitions/GetSelfSavingsCurrency" - }, - "accountBalance": { - "type": "integer", - "format": "int32", - "example": 0 - } - } - }, - "GetSelfSavingsTimeline": { - "type": "object", - "properties": { - "submittedOnDate": { - "type": "string", - "format": "date", - "example": "[2013, 3, 1]" - } - } - }, - "GetSelfUserDetailsOrganisationalRole": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 100 - }, - "code": { - "type": "string", - "example": "staffOrganisationalRoleType.programDirector" - }, - "value": { - "type": "string", - "example": "Program Director" - } - } - }, - "GetSelfUserDetailsRoles": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "Super user" - }, - "description": { - "type": "string", - "example": "This role provides all application permissions." - } - } - }, - "PostSelfAuthenticationResponse": { - "type": "object", - "properties": { - "username": { - "type": "string", - "example": "mifos" - }, - "userId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "base64EncodedAuthenticationKey": { - "type": "string", - "example": "bWlmb3M6cGFzc3dvcmQ=" - }, - "authenticated": { - "type": "boolean", - "example": true - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "staffId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "staffDisplayName": { - "type": "string", - "example": "Director, Program" - }, - "organisationalRole": { - "$ref": "#/definitions/GetSelfUserDetailsOrganisationalRole" - }, - "roles": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfUserDetailsRoles" - } - }, - "permissions": { - "type": "array", - "example": "ALL_FUNCTIONS", - "items": { - "type": "string" - } - }, - "isSelfServiceUser": { - "type": "boolean", - "example": true - }, - "clients": { - "type": "array", - "example": "1, 2, 3", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "PutSelfUserChanges": { - "type": "object", - "properties": { - "passwordEncoded": { - "type": "string", - "example": "6a72a630795be86fe926ce540fc45b6b922fe5ba130f185fe806a26b5e5efcdd" - } - } - }, - "PutSelfUserResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int32", - "example": 6 - }, - "changes": { - "$ref": "#/definitions/PutSelfUserChanges" - } - } - }, - "PutSelfUserRequest": { - "type": "object", - "properties": { - "password": { - "type": "string", - "example": "Abcd1234" - }, - "repeatPassword": { - "type": "string", - "example": "Abcd1234" - } - } - }, - "GetSelfUserDetailsResponse": { - "type": "object", - "properties": { - "username": { - "type": "string", - "example": "mifos" - }, - "userId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "base64EncodedAuthenticationKey": { - "type": "string", - "example": "bWlmb3M6cGFzc3dvcmQ=" - }, - "authenticated": { - "type": "boolean", - "example": true - }, - "officeId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "staffId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "staffDisplayName": { - "type": "string", - "example": "Director, Program" - }, - "organisationalRole": { - "$ref": "#/definitions/GetSelfUserDetailsOrganisationalRole" - }, - "roles": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetSelfUserDetailsRoles" - } - }, - "permissions": { - "type": "array", - "example": "ALL_FUNCTIONS", - "items": { - "type": "string" - } - }, - "isSelfServiceUser": { - "type": "boolean", - "example": true - }, - "clients": { - "type": "array", - "example": "[1, 2, 3]", - "items": { - "type": "integer", - "format": "int32" - } - } - } - }, - "PostNewShareApplicationResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 12 - } - } - }, - "GetAccountingMappingOptions": { - "type": "object" - }, - "GetClientIdProductIdAccountingMappings": { - "type": "object", - "properties": { - "shareReferenceId": { - "$ref": "#/definitions/GetShareAccountsShareReferenceId" - }, - "incomeFromFeeAccountId": { - "$ref": "#/definitions/GetShareAccountsIncomeFromFeeAccountId" - }, - "ShareEquityId": { - "$ref": "#/definitions/GetShareAccountsShareEquityId" - }, - "shareSuspenseId": { - "$ref": "#/definitions/GetShareAccountsShareSuspenseId" - } - } - }, - "GetClientIdProductIdChargeOptions": { - "type": "object", - "properties": { - "chargeOptions": { - "$ref": "#/definitions/GetShareAccountsChargeOptions" - } - } - }, - "GetClientIdProductIdLockinPeriodFrequencyTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "shares.lockin.sharePeriodFrequencyType.days" - }, - "value": { - "type": "integer", - "format": "int32", - "example": "Days" - } - } - }, - "GetClientIdProductIdMinimumActivePeriodFrequencyTypeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "shares.lockin.sharePeriodFrequencyType.days" - }, - "value": { - "type": "integer", - "format": "int32", - "example": "Days" - } - } - }, - "GetClientIdProductIdProductOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 3 - }, - "name": { - "type": "string", - "example": "SP" - }, - "shortName": { - "type": "string", - "example": "SP" - }, - "description": { - "type": "string", - "example": "SP1" - }, - "currency": { - "$ref": "#/definitions/GetShareAccountsCurrency" - }, - "totalShares": { - "type": "integer", - "format": "int32", - "example": 1000 - }, - "totalSharesIssued": { - "type": "integer", - "format": "int32", - "example": 900 - }, - "unitPrice": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "shareCapital": { - "type": "integer", - "format": "int32", - "example": 900 - }, - "minimumShares": { - "type": "integer", - "format": "int32", - "example": 8 - }, - "norminalShares": { - "type": "integer", - "format": "int32", - "example": 500 - }, - "maximumShares": { - "type": "integer", - "format": "int32", - "example": 500 - }, - "marketPrice": { - "type": "string", - "example": "[]" - }, - "charges": { - "type": "string", - "example": "[]" - }, - "allowDividendCalculationForInactiveClients": { - "type": "boolean", - "example": false - }, - "lockinPeriod": { - "type": "integer", - "format": "int32", - "example": 50 - }, - "lockinPeriodEnum": { - "$ref": "#/definitions/GetShareAccountsClientIdProductIdLockPeriodTypeEnum" - }, - "minimumActivePeriod": { - "type": "integer", - "format": "int32", - "example": 10 - }, - "minimumActivePeriodForDividendsTypeEnum": { - "$ref": "#/definitions/GetShareAccountsClientIdProductIdMinimumActivePeriodForDividendsTypeEnum" - }, - "accountingRule": { - "$ref": "#/definitions/GetShareAccountsClientIdProductIdAccountingRule" - }, - "accountingMappings": { - "$ref": "#/definitions/GetClientIdProductIdAccountingMappings" - }, - "currencyOptions": { - "$ref": "#/definitions/GetShareAccountsCurrency" - }, - "chargeOptions": { - "$ref": "#/definitions/GetShareAccountsChargeOptions" - }, - "minimumActivePeriodFrequencyTypeOptions": { - "$ref": "#/definitions/GetClientIdProductIdMinimumActivePeriodFrequencyTypeOptions" - }, - "lockinPeriodFrequencyTypeOptions": { - "$ref": "#/definitions/GetClientIdProductIdLockinPeriodFrequencyTypeOptions" - }, - "accountingMappingOptions": { - "$ref": "#/definitions/GetAccountingMappingOptions" - } - } - }, - "GetShareAccountsChargeAppliesTo": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "code": { - "type": "string", - "example": "chargeAppliesTo.shares" - }, - "value": { - "type": "string", - "example": "Shares" - } - } - }, - "GetShareAccountsChargeCalculationType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "code": { - "type": "string", - "example": "chargeCalculationType.flat" - }, - "value": { - "type": "string", - "example": "Flat" - } - } - }, - "GetShareAccountsChargeOptions": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Activation fee" - }, - "active": { - "type": "boolean", - "example": true - }, - "penalty": { - "type": "boolean", - "example": false - }, - "currency": { - "$ref": "#/definitions/GetShareAccountsCurrency" - }, - "amount": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "chargeTimeType": { - "$ref": "#/definitions/GetShareAccountsChargeTimeType" - }, - "chargeAppliesTo": { - "$ref": "#/definitions/GetShareAccountsChargeAppliesTo" - }, - "calculationType": { - "$ref": "#/definitions/GetShareAccountsChargeCalculationType" - }, - "paymentMode": { - "$ref": "#/definitions/GetShareAccountsChargePaymentMode" - } - } - }, - "GetShareAccountsChargePaymentMode": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "chargepaymentmode.regular" - }, - "value": { - "type": "string", - "example": "Regular" - } - } - }, - "GetShareAccountsChargeTimeType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 14 - }, - "code": { - "type": "string", - "example": "chargeTimeType.sharespurchase" - }, - "value": { - "type": "string", - "example": "Share purchase" - } - } - }, - "GetShareAccountsClientIdProductIdAccountingRule": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountingRuleType.cash" - }, - "value": { - "type": "string", - "example": "CASH BASED" - } - } - }, - "GetShareAccountsClientIdProductIdLockPeriodTypeEnum": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "shares.lockin.sharePeriodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "days" - } - } - }, - "GetShareAccountsClientIdProductIdMinimumActivePeriodForDividendsTypeEnum": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 0 - }, - "code": { - "type": "string", - "example": "shares.minimumactive.sharePeriodFrequencyType.days" - }, - "value": { - "type": "string", - "example": "days" - } - } - }, - "GetShareAccountsClientIdProductIdResponse": { - "type": "object", - "properties": { - "productOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientIdProductIdProductOptions" - } - }, - "chargeOptions": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetClientIdProductIdChargeOptions" - } - } - } - }, - "GetShareAccountsCurrency": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "USD" - }, - "name": { - "type": "string", - "example": "US Dollar" - }, - "decimalPlaces": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "displaySymbol": { - "type": "string", - "example": "$" - }, - "nameCode": { - "type": "string", - "example": "currency.USD" - }, - "displayLabel": { - "type": "string", - "example": "US Dollar ($)" - } - } - }, - "GetShareAccountsIncomeFromFeeAccountId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 40 - }, - "name": { - "type": "string", - "example": "Other Operating Income" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 30105 - } - } - }, - "GetShareAccountsShareEquityId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 56 - }, - "name": { - "type": "string", - "example": "Share Equity" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 98 - } - } - }, - "GetShareAccountsShareReferenceId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 32 - }, - "name": { - "type": "string", - "example": "Cash in Hand" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 20301 - } - } - }, - "GetShareAccountsShareSuspenseId": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "name": { - "type": "string", - "example": "Overpayment Liability" - }, - "glCode": { - "type": "integer", - "format": "int32", - "example": 10200 - } - } - }, - "ScorecardData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "userId": { - "type": "integer", - "format": "int64" - }, - "username": { - "type": "string" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "surveyId": { - "type": "integer", - "format": "int64" - }, - "surveyName": { - "type": "string" - }, - "scorecardValues": { - "type": "array", - "items": { - "$ref": "#/definitions/ScorecardValue" - } - } - } - }, - "ScorecardValue": { - "type": "object", - "properties": { - "questionId": { - "type": "integer", - "format": "int64" - }, - "responseId": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "integer", - "format": "int32" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - } - }, - "ComponentData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "key": { - "type": "string" - }, - "text": { - "type": "string" - }, - "description": { - "type": "string" - }, - "sequenceNo": { - "type": "integer", - "format": "int32" - } - } - }, - "QuestionData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "responseDatas": { - "type": "array", - "items": { - "$ref": "#/definitions/ResponseData" - } - }, - "componentKey": { - "type": "string" - }, - "key": { - "type": "string" - }, - "text": { - "type": "string" - }, - "description": { - "type": "string" - }, - "sequenceNo": { - "type": "integer", - "format": "int32" - } - } - }, - "ResponseData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "text": { - "type": "string" - }, - "value": { - "type": "integer", - "format": "int32" - }, - "sequenceNo": { - "type": "integer", - "format": "int32" - } - } - }, - "SurveyData": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "componentDatas": { - "type": "array", - "items": { - "$ref": "#/definitions/ComponentData" - } - }, - "questionDatas": { - "type": "array", - "items": { - "$ref": "#/definitions/QuestionData" - } - }, - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "countryCode": { - "type": "string" - }, - "validFrom": { - "type": "string", - "format": "date-time" - }, - "validTo": { - "type": "string", - "format": "date-time" - } - } - }, - "GetTaxesComponentsCreditAccount": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "name": { - "type": "string", - "example": "ACCOUNT_NAME_7BR9C" - }, - "glCode": { - "type": "string", - "example": "LIABILITY_PA1460364665046" - } - } - }, - "GetTaxesComponentsCreditAccountType": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "code": { - "type": "string", - "example": "accountType.liability" - }, - "value": { - "type": "string", - "example": "LIABILITY" - } - } - }, - "GetTaxesComponentsHistories": { - "type": "object" - }, - "GetTaxesComponentsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "name": { - "type": "string", - "example": "tax component 1" - }, - "percentage": { - "type": "number", - "format": "float", - "example": 10 - }, - "creditAccountType": { - "$ref": "#/definitions/GetTaxesComponentsCreditAccountType" - }, - "creditAccount": { - "$ref": "#/definitions/GetTaxesComponentsCreditAccount" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 11]" - }, - "taxComponentsHistories": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetTaxesComponentsHistories" - } - } - } - }, - "PostTaxesComponentsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostTaxesComponentsRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "tax component 1" - }, - "percentage": { - "type": "number", - "format": "float", - "example": 10 - }, - "creditAccountType": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "creditAcountId": { - "type": "integer", - "format": "int32", - "example": 4 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "startDate": { - "type": "string", - "example": "11 April 2016" - } - } - }, - "PutTaxesComponentsChanges": { - "type": "object", - "properties": { - "percentage": { - "type": "number", - "format": "float", - "example": 15 - }, - "name": { - "type": "string", - "example": "tax component 2" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 15]" - } - } - }, - "PutTaxesComponentsTaxComponentIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutTaxesComponentsChanges" - } - } - }, - "PutTaxesComponentsTaxComponentIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "tax component 2" - }, - "percentage": { - "type": "number", - "format": "float", - "example": 15 - }, - "locale": { - "type": "string", - "example": "en" - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - }, - "startDate": { - "type": "string", - "example": "15 April 2016" - } - } - }, - "GetTaxesGroupResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "name": { - "type": "string", - "example": "tax group 1" - }, - "taxAssociations": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/GetTaxesGroupTaxAssociations" - } - } - } - }, - "GetTaxesGroupTaxAssociations": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "taxComponent": { - "$ref": "#/definitions/GetTaxesGroupTaxComponent" - }, - "startDate": { - "type": "string", - "format": "date", - "example": "[2016, 4, 11]" - } - } - }, - "GetTaxesGroupTaxComponent": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "name": { - "type": "string", - "example": "tax component 2" - } - } - }, - "PutTaxesGroupChanges": { - "type": "object", - "properties": { - "addComponents": { - "type": "array", - "example": "[6]", - "items": { - "type": "integer", - "format": "int32" - } - }, - "modifiedComponents": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PutTaxesGroupModifiedComponents" - } - }, - "name": { - "type": "string", - "example": "tax group 2" - } - } - }, - "PutTaxesGroupModifiedComponents": { - "type": "object", - "properties": { - "endDate": { - "type": "string", - "example": "Apr 22, 2016 12:00:00 AM" - }, - "taxComponentId": { - "type": "integer", - "format": "int32", - "example": 7 - } - } - }, - "PutTaxesGroupTaxGroupIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "changes": { - "$ref": "#/definitions/PutTaxesGroupChanges" - } - } - }, - "PutTaxesGroupTaxComponents": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "taxComponentId": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "endDate": { - "type": "string", - "example": "22 April 2016" - } - } - }, - "PutTaxesGroupTaxGroupIdRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "tax group 2" - }, - "locale": { - "type": "string", - "example": "en" - }, - "taxComponents": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PutTaxesGroupTaxComponents" - } - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - } - } - }, - "PostTaxesGroupResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 1 - } - } - }, - "PostTaxesGroupRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "tax group 1" - }, - "locale": { - "type": "string", - "example": "en" - }, - "taxComponents": { - "type": "array", - "uniqueItems": true, - "items": { - "$ref": "#/definitions/PostTaxesGroupTaxComponents" - } - }, - "dateFormat": { - "type": "string", - "example": "dd MMMM yyyy" - } - } - }, - "PostTaxesGroupTaxComponents": { - "type": "object", - "properties": { - "taxComponentId": { - "type": "integer", - "format": "int32", - "example": 7 - }, - "startDate": { - "type": "string", - "example": "11 April 2016" - } - } - }, - "LookupTableData": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "description": { - "type": "string" - }, - "entries": { - "type": "array", - "items": { - "$ref": "#/definitions/LookupTableEntry" - } - } - } - }, - "LookupTableEntry": { - "type": "object", - "properties": { - "valueFrom": { - "type": "integer", - "format": "int32" - }, - "valueTo": { - "type": "integer", - "format": "int32" - }, - "score": { - "type": "number", - "format": "double" - } - } - }, - "Component": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "survey": { - "$ref": "#/definitions/Survey" - }, - "key": { - "type": "string" - }, - "text": { - "type": "string" - }, - "description": { - "type": "string" - }, - "sequenceNo": { - "type": "integer", - "format": "int32" - }, - "new": { - "type": "boolean" - } - } - }, - "Question": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "survey": { - "$ref": "#/definitions/Survey" - }, - "responses": { - "type": "array", - "items": { - "$ref": "#/definitions/Response" - } - }, - "componentKey": { - "type": "string" - }, - "key": { - "type": "string" - }, - "text": { - "type": "string" - }, - "description": { - "type": "string" - }, - "sequenceNo": { - "type": "integer", - "format": "int32" - }, - "new": { - "type": "boolean" - } - } - }, - "Response": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "question": { - "$ref": "#/definitions/Question" - }, - "text": { - "type": "string" - }, - "value": { - "type": "integer", - "format": "int32" - }, - "sequenceNo": { - "type": "integer", - "format": "int32" - }, - "new": { - "type": "boolean" - } - } - }, - "Scorecard": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "survey": { - "$ref": "#/definitions/Survey" - }, - "question": { - "$ref": "#/definitions/Question" - }, - "response": { - "$ref": "#/definitions/Response" - }, - "appUser": { - "$ref": "#/definitions/AppUser" - }, - "client": { - "$ref": "#/definitions/Client" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "value": { - "type": "integer", - "format": "int32" - }, - "new": { - "type": "boolean" - } - } - }, - "Survey": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "components": { - "type": "array", - "items": { - "$ref": "#/definitions/Component" - } - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/definitions/Question" - } - }, - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "countryCode": { - "type": "string" - }, - "validFrom": { - "type": "string", - "format": "date-time" - }, - "validTo": { - "type": "string", - "format": "date-time" - }, - "new": { - "type": "boolean" - } - } - }, - "PostTemplatesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostTemplatesRequest": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Text" - }, - "entity": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "type": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "text": { - "type": "string", - "example": "This is a loan for {{loan.clientName}}" - }, - "mappers": { - "type": "array", - "items": { - "$ref": "#/definitions/TemplateMapper" - } - } - } - }, - "TemplateMapper": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "mapperorder": { - "type": "integer", - "format": "int32" - }, - "mapperkey": { - "type": "string" - }, - "mappervalue": { - "type": "string" - }, - "new": { - "type": "boolean" - } - } - }, - "PutTemplatesTemplateIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PutTemplatesTemplateIdRequest": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Text" - }, - "entity": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "type": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "text": { - "type": "string", - "example": "This is a loan for {{loan.clientName}}" - }, - "mappers": { - "type": "array", - "items": { - "$ref": "#/definitions/TemplateMapper" - } - } - } - }, - "DeleteTemplatesTemplateIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetTemplatesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Text" - }, - "entity": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "type": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "text": { - "type": "string", - "example": "This is a loan for {{loan.clientName}}" - }, - "mappers": { - "type": "array", - "items": { - "$ref": "#/definitions/TemplateMapper" - } - } - } - }, - "GetTemplatesTemplateIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Text" - }, - "entity": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "type": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "text": { - "type": "string", - "example": "This is a loan for {{loan.clientName}}" - }, - "mappers": { - "type": "array", - "items": { - "$ref": "#/definitions/TemplateMapper" - } - } - } - }, - "GetTemplatesTemplateResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Text" - }, - "entity": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "type": { - "type": "integer", - "format": "int64", - "example": 0 - }, - "text": { - "type": "string", - "example": "This is a loan for {{loan.clientName}}" - }, - "mappers": { - "type": "array", - "items": { - "$ref": "#/definitions/TemplateMapper" - } - } - } - }, - "GetPasswordPreferencesTemplateResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "description": { - "type": "string", - "example": "Password must be at least 1 character and not more that 50 characters long" - }, - "active": { - "type": "boolean", - "example": true - }, - "key": { - "type": "string", - "example": "simple" - } - } - }, - "PutPasswordPreferencesTemplateRequest": { - "type": "object", - "properties": { - "validationPolicyId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetPermissionsResponse": { - "type": "object", - "properties": { - "grouping": { - "type": "string", - "example": "authorisation" - }, - "code": { - "type": "string", - "example": "READ_PERMISSION" - }, - "entityName": { - "type": "string", - "example": "PERMISSION" - }, - "actionName": { - "type": "string", - "example": "READ" - }, - "selected": { - "type": "boolean", - "example": true - } - } - }, - "CommandProcessingResult": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64" - }, - "groupId": { - "type": "integer", - "format": "int64" - }, - "clientId": { - "type": "integer", - "format": "int64" - }, - "loanId": { - "type": "integer", - "format": "int64" - }, - "savingsId": { - "type": "integer", - "format": "int64" - }, - "subResourceId": { - "type": "integer", - "format": "int64" - }, - "transactionId": { - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "productId": { - "type": "integer", - "format": "int64" - }, - "rollbackTransaction": { - "type": "boolean" - } - } - }, - "PutPermissionsRequest": { - "type": "object", - "properties": { - "permissions": { - "type": "string", - "example": "\"CREATE_GUARANTOR\":true,\n \"CREATE_CLIENT\":true" - } - } - }, - "PostRolesResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PostRolesRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Another Role Name" - }, - "description": { - "type": "string", - "example": "A description outlining the purpose of this role in relation to the application." - } - } - }, - "GetRolesRoleIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Super Users" - }, - "description": { - "type": "string", - "example": "This role provides all application permissions." - } - } - }, - "GetRolesResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Super Users" - }, - "description": { - "type": "string", - "example": "This role provides all application permissions." - } - } - }, - "PostRolesRoleIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "GetRolesRoleIdPermissionsResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "example": "Super Users" - }, - "description": { - "type": "string", - "example": "This role provides all application permissions." - }, - "permissionUsageData": { - "type": "array", - "items": { - "$ref": "#/definitions/GetRolesRoleIdPermissionsResponsePermissionData" - } - } - } - }, - "GetRolesRoleIdPermissionsResponsePermissionData": { - "type": "object", - "properties": { - "grouping": { - "type": "string", - "example": "authorisation" - }, - "code": { - "type": "string", - "example": "READ_PERMISSION" - }, - "entityName": { - "type": "string", - "example": "PERMISSION" - }, - "actionName": { - "type": "string", - "example": "READ" - }, - "selected": { - "type": "boolean", - "example": false - } - } - }, - "PostRolesRoleIdPermissionsResponsePermissions": { - "type": "object", - "properties": { - "ALL_FUNCTIONS_READ": { - "type": "string", - "example": "true" - } - } - }, - "PutRolesRoleIdPermissionsResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 8 - }, - "permissions": { - "$ref": "#/definitions/PostRolesRoleIdPermissionsResponsePermissions" - } - } - }, - "PutRolesRoleIdPermissionsRequest": { - "type": "object", - "properties": { - "permissions": { - "$ref": "#/definitions/PostRolesRoleIdPermissionsResponsePermissions" - } - } - }, - "DeleteRolesRoleIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - } - } - }, - "PutRolesRoleIdResponse": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "changes": { - "$ref": "#/definitions/PutRolesRoleIdResponseChanges" - } - } - }, - "PutRolesRoleIdResponseChanges": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "some description(changed)" - } - } - }, - "PutRolesRoleIdRequest": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "some description(changed)" - } - } - }, - "GetUsersResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "username": { - "type": "string", - "example": "mifos" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "firstname": { - "type": "string", - "example": "App" - }, - "lastname": { - "type": "string", - "example": "Administrator" - }, - "email": { - "type": "string", - "example": "demomfi@mifos.org" - }, - "passwordNeverExpires": { - "type": "boolean", - "example": false - }, - "staff": { - "$ref": "#/definitions/StaffData" - }, - "selectedRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - } - } - }, - "GetUsersUserIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "username": { - "type": "string", - "example": "mifos" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "officeName": { - "type": "string", - "example": "Head Office" - }, - "firstname": { - "type": "string", - "example": "App" - }, - "lastname": { - "type": "string", - "example": "Administrator" - }, - "email": { - "type": "string", - "example": "demomfi@mifos.org" - }, - "passwordNeverExpires": { - "type": "boolean", - "example": false - }, - "staff": { - "$ref": "#/definitions/StaffData" - }, - "availableRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - }, - "selectedRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - } - } - }, - "GetUsersTemplateResponse": { - "type": "object", - "properties": { - "allowedOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeData" - } - }, - "availableRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - }, - "selfServiceRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleData" - } - } - } - }, - "PutUsersUserIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 11 - }, - "changes": { - "$ref": "#/definitions/PutUsersUserIdResponseChanges" - } - } - }, - "PutUsersUserIdResponseChanges": { - "type": "object", - "properties": { - "firstname": { - "type": "string", - "example": "Test" - }, - "passwordEncoded": { - "type": "string", - "example": "abc3326b1bb376351c7baeb4175f5e0504e33aadf6a158474a6d71de1befae51" - } - } - }, - "PutUsersUserIdRequest": { - "type": "object", - "properties": { - "firstname": { - "type": "string", - "example": "Test" - }, - "password": { - "type": "string", - "example": "window75" - }, - "repeatPassword": { - "type": "string", - "example": "window75" - } - } - }, - "DeleteUsersUserIdResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 11 - }, - "changes": { - "$ref": "#/definitions/DeleteUsersUserIdResponseChanges" - } - } - }, - "DeleteUsersUserIdResponseChanges": { - "type": "object" - }, - "PostUsersResponse": { - "type": "object", - "properties": { - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "resourceId": { - "type": "integer", - "format": "int64", - "example": 11 - } - } - }, - "PostUsersRequest": { - "type": "object", - "properties": { - "username": { - "type": "string", - "example": "newuser" - }, - "firstname": { - "type": "string", - "example": "Test" - }, - "lastname": { - "type": "string", - "example": "User" - }, - "email": { - "type": "string", - "example": "whatever@mifos.org" - }, - "officeId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "staffId": { - "type": "integer", - "format": "int64", - "example": 1 - }, - "Roles": { - "type": "string", - "example": "[2,3]" - }, - "sendPasswordToEmail": { - "type": "boolean", - "example": true - }, - "isSelfServiceUser": { - "type": "boolean", - "example": true - } - } - } - } -} From 44650034b16f6fbb88a4ff40d7fd6c48fe69b08d Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Thu, 9 Jul 2020 17:16:21 +0530 Subject: [PATCH 068/131] FINERACT-1047 Added integration test for limit param (audit trails) --- .../AuditIntegrationTest.java | 26 +++++++++++++++++++ .../integrationtests/common/AuditHelper.java | 14 ++++++++++ 2 files changed, 40 insertions(+) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java index b9570b5b3..e69b2e999 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java @@ -25,6 +25,7 @@ import io.restassured.specification.RequestSpecification; import io.restassured.specification.ResponseSpecification; import java.util.HashMap; import java.util.List; +import java.util.Random; import org.apache.fineract.integrationtests.common.AuditHelper; import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.OfficeHelper; @@ -102,4 +103,29 @@ public class AuditIntegrationTest { auditHelper.verifyOneAuditOnly(auditsRecieved, officeId, "CREATE", "OFFICE"); } + /** + * + * Here we test that audit request with limit x only returns x entries + */ + @Test + public void checkAuditsWithLimit() { + // Create client + final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); + + // The following loop would ensure database have atleast 8 audits. + for (int i = 0; i < 4; i++) { + // Close client + this.clientHelper.closeClient(clientId); + // Activate client + this.clientHelper.reactivateClient(clientId); + } + + Random rand = new Random(); + for (int i = 0; i < 3; i++) { + // limit contains a number between 1-8 + int limit = rand.nextInt(7) + 1; + auditHelper.verifyLimitParameterfor(limit); + } + } + } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java index cc995c637..0415bc163 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java @@ -25,6 +25,7 @@ import io.restassured.specification.ResponseSpecification; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,6 +56,15 @@ public class AuditHelper { return responseAudits; } + public List getAuditDetails(final int limit) { + + final String AUDIT_URL = "/fineract-provider/api/v1/audits?paged=true&limit=" + Integer.toString(limit) + "&" + + Utils.TENANT_IDENTIFIER; + LinkedHashMap responseAudits = Utils.performServerGet(requestSpec, responseSpec, AUDIT_URL, ""); + return (List) responseAudits.get("pageItems"); + + } + /** * Some audit actions can only be done once Eg: Creation of a client with id 123, hence we verify number of audits * For such operations is "equal" to 1 always @@ -86,4 +96,8 @@ public class AuditHelper { assertEquals(expected, actual, "Error in creating audit!"); } + public void verifyLimitParameterfor(final int limit) { + assertEquals(limit, getAuditDetails(limit).size(), "Incorrect number of audits recieved for limit: " + Integer.toString(limit)); + } + } From 37b8219a03827e45d24a890bf9fe8dd39b40e1f9 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Tue, 14 Jul 2020 03:52:09 +0530 Subject: [PATCH 069/131] FINERACT-1006 Fixes: NullPointerException at SQLInjectionValidator --- .../infrastructure/security/utils/ColumnValidator.java | 4 ++++ .../security/utils/SQLInjectionValidator.java | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java index 18a563b47..18d833a95 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/ColumnValidator.java @@ -29,6 +29,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import org.apache.commons.lang3.StringUtils; import org.apache.fineract.infrastructure.core.service.RoutingDataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -91,6 +92,9 @@ public class ColumnValidator { public void validateSqlInjection(String schema, String... conditions) { for (String condition : conditions) { + if (StringUtils.isBlank(condition)) { + continue; + } SQLInjectionValidator.validateSQLInput(condition); List operator = new ArrayList<>(Arrays.asList("=", ">", "<", "> =", "< =", "! =", "!=", ">=", "<=")); condition = condition.trim().replace("( ", "(").replace(" )", ")").toLowerCase(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionValidator.java index 60ff8e367..ce0c85d78 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLInjectionValidator.java @@ -21,6 +21,7 @@ package org.apache.fineract.infrastructure.security.utils; import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; public class SQLInjectionValidator { @@ -33,6 +34,9 @@ public class SQLInjectionValidator { private static final String SQL_PATTERN = "[a-zA-Z_=,\\-'!><.?\"`% ()0-9*\n\r]*"; public static final void validateSQLInput(final String sqlSearch) { + if (StringUtils.isBlank(sqlSearch)) { + return; + } String lowerCaseSQL = sqlSearch.toLowerCase(); for (String ddl : DDL_COMMANDS) { if (lowerCaseSQL.contains(ddl)) { @@ -118,6 +122,9 @@ public class SQLInjectionValidator { } public static final void validateAdhocQuery(final String sqlSearch) { + if (StringUtils.isBlank(sqlSearch)) { + return; + } String lowerCaseSQL = sqlSearch.toLowerCase().trim(); for (String ddl : DDL_COMMANDS) { if (lowerCaseSQL.startsWith(ddl)) { From b3fb7984f3bbaa1ffd6c905fc73cc4f9175a878a Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Tue, 14 Jul 2020 05:04:25 +0530 Subject: [PATCH 070/131] Update dependency com.diffplug.spotless:spotless-plugin-gradle to v5 --- fineract-provider/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 1c7a6fa4e..19ed2f36b 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -54,7 +54,7 @@ buildscript { classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" - classpath "com.diffplug.spotless:spotless-plugin-gradle:4.5.1" + classpath "com.diffplug.spotless:spotless-plugin-gradle:5.1.0" classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.3" } } @@ -77,7 +77,7 @@ apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin' apply plugin: 'jacoco' apply plugin: "com.gorylenko.gradle-git-properties" apply plugin: "net.ltgt.errorprone" -apply plugin: "com.diffplug.gradle.spotless" +apply plugin: "com.diffplug.spotless" apply plugin: "io.swagger.core.v3.swagger-gradle-plugin" dependencyManagement { From bbb3aad5060cb88f4396b8e55dbde2a761c2e435 Mon Sep 17 00:00:00 2001 From: percyashu Date: Mon, 8 Jun 2020 03:14:01 +0100 Subject: [PATCH 071/131] FINERACT-822 add MissingCasesInEnumSwitch --- .../AccountNumberFormatDataValidator.java | 9 +++++++- ...ntNumberFormatReadPlatformServiceImpl.java | 8 ++++++- .../domain/WorkingDaysEnumerations.java | 5 ++++- .../service/AccountEnumerations.java | 4 +++- .../InterestRateChartEnumerations.java | 9 +++++++- .../portfolio/loanaccount/domain/Loan.java | 7 +++++- .../loanschedule/domain/AprCalculator.java | 5 ++++- ...aultPaymentPeriodsInOneYearCalculator.java | 12 ++++++++-- .../domain/DefaultScheduledDateGenerator.java | 16 +++++++++++--- .../domain/LoanApplicationTerms.java | 12 ++++++++-- .../portfolio/note/api/NotesApiResource.java | 5 +++++ ...WritePlatformServiceJpaRepositoryImpl.java | 10 ++++++++- .../savings/DepositAccountUtils.java | 8 ++++++- .../savings/domain/SavingsAccount.java | 8 ++++++- .../savings/domain/SavingsAccountCharge.java | 22 ++++++++++++++++--- .../ShareAccountDataSerializer.java | 7 +++++- 16 files changed, 126 insertions(+), 21 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java index 080635a6a..09c8a4253 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java @@ -23,6 +23,7 @@ import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -37,6 +38,8 @@ import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; import org.apache.fineract.infrastructure.core.exception.InvalidJsonException; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -45,6 +48,8 @@ public class AccountNumberFormatDataValidator { private final FromJsonHelper fromApiJsonHelper; + private static final Logger LOG = LoggerFactory.getLogger(AccountNumberFormatDataValidator.class); + private static final Set ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>( Arrays.asList(AccountNumberFormatConstants.accountTypeParamName, AccountNumberFormatConstants.prefixTypeParamName)); @@ -125,7 +130,9 @@ public class AccountNumberFormatDataValidator { case GROUP: validAccountNumberPrefixes = AccountNumberFormatEnumerations.accountNumberPrefixesForGroups; break; - default: + case SHARES: + validAccountNumberPrefixes = Collections.emptySet(); + break; } Set validAccountNumberPrefixValues = new HashSet<>(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java index ff8c298a6..d22f02f79 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatReadPlatformServiceImpl.java @@ -34,6 +34,8 @@ import org.apache.fineract.infrastructure.accountnumberformat.exception.AccountN import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.core.domain.JdbcSupport; import org.apache.fineract.infrastructure.core.service.RoutingDataSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; @@ -43,6 +45,8 @@ import org.springframework.stereotype.Service; @Service public class AccountNumberFormatReadPlatformServiceImpl implements AccountNumberFormatReadPlatformService { + private static final Logger LOG = LoggerFactory.getLogger(AccountNumberFormatReadPlatformServiceImpl.class); + private final JdbcTemplate jdbcTemplate; // data mapper @@ -144,7 +148,9 @@ public class AccountNumberFormatReadPlatformServiceImpl implements AccountNumber case GROUP: accountNumberPrefixTypesSet = AccountNumberFormatEnumerations.accountNumberPrefixesForGroups; break; - default: + case SHARES: + // SHARES has no prefix + break; } Object[] array = accountNumberPrefixTypesSet.toArray(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysEnumerations.java index 190a268a2..6da90809b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysEnumerations.java @@ -52,7 +52,10 @@ public class WorkingDaysEnumerations { optionData = new EnumOptionData(RepaymentRescheduleType.MOVE_TO_PREVIOUS_WORKING_DAY.getValue().longValue(), RepaymentRescheduleType.MOVE_TO_PREVIOUS_WORKING_DAY.getCode(), "move to previous working day"); break; - default: + case MOVE_TO_NEXT_MEETING_DAY: + optionData = new EnumOptionData(RepaymentRescheduleType.MOVE_TO_NEXT_MEETING_DAY.getValue().longValue(), + RepaymentRescheduleType.MOVE_TO_NEXT_MEETING_DAY.getCode(), "move to next meeting day"); + break; } return optionData; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountEnumerations.java index 1f59da32b..0cdb61d32 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountEnumerations.java @@ -51,7 +51,9 @@ public class AccountEnumerations { case GLIM: optionData = new EnumOptionData(AccountType.GLIM.getValue().longValue(), AccountType.GLIM.getCode(), "GLIM"); break; - default: + case GSIM: + optionData = new EnumOptionData(AccountType.GSIM.getValue().longValue(), AccountType.GSIM.getCode(), "GSIM"); + break; } return optionData; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartEnumerations.java index 3228093d3..bf0301700 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartEnumerations.java @@ -22,9 +22,13 @@ import java.util.ArrayList; import java.util.List; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class InterestRateChartEnumerations { + private static final Logger LOG = LoggerFactory.getLogger(InterestRateChartEnumerations.class); + public static EnumOptionData periodType(final Integer type) { return periodType(PeriodFrequencyType.fromInt(type)); } @@ -52,7 +56,10 @@ public class InterestRateChartEnumerations { optionData = new EnumOptionData(PeriodFrequencyType.YEARS.getValue().longValue(), PeriodFrequencyType.YEARS.getCode(), "Years"); break; - default: + case WHOLE_TERM: + optionData = new EnumOptionData(PeriodFrequencyType.WHOLE_TERM.getValue().longValue(), + PeriodFrequencyType.WHOLE_TERM.getCode(), "Whole Term"); + break; } return optionData; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index 024ff006e..b8a2850f3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -142,6 +142,8 @@ import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @Entity @@ -150,6 +152,8 @@ import org.springframework.stereotype.Component; @UniqueConstraint(columnNames = { "external_id" }, name = "loan_externalid_UNIQUE") }) public class Loan extends AbstractPersistableCustom { + private static final Logger LOG = LoggerFactory.getLogger(Loan.class); + /** Disable optimistic locking till batch jobs failures can be fixed **/ @Version int version; @@ -4478,7 +4482,8 @@ public class Loan extends AbstractPersistableCustom { break; case INVALID: break; - default: + case WHOLE_TERM: + break; } return dueRepaymentPeriodDate.minusDays(1);// get 2n-1 range date from // startDate diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AprCalculator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AprCalculator.java index 749130247..500bdc074 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AprCalculator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AprCalculator.java @@ -59,7 +59,10 @@ public class AprCalculator { case YEARS: defaultAnnualNominalInterestRate = ratePerPeriod.multiply(BigDecimal.valueOf(1)); break; - default: + case WHOLE_TERM: + break; + case INVALID: + break; } break; case INVALID: diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java index 9fa9baf14..99a7211c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java @@ -22,9 +22,13 @@ import org.apache.fineract.infrastructure.core.domain.LocalDateInterval; import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType; import org.joda.time.Days; import org.joda.time.LocalDate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsInOneYearCalculator { + private static final Logger LOG = LoggerFactory.getLogger(DefaultPaymentPeriodsInOneYearCalculator.class); + @Override public Integer calculate(final PeriodFrequencyType repaymentFrequencyType) { @@ -45,7 +49,9 @@ public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsI case INVALID: paymentPeriodsInOneYear = Integer.valueOf(0); break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement repaymentFrequencyType for WHOLE_TERM"); + break; } return paymentPeriodsInOneYear; } @@ -92,7 +98,9 @@ public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsI case INVALID: fraction = Double.valueOf("0"); break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement repaymentPeriodFrequencyType for WHOLE_TERM"); + break; } return fraction; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java index 1440ba0af..09ee6821f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java @@ -33,9 +33,13 @@ import org.joda.time.LocalDate; import org.joda.time.Months; import org.joda.time.Weeks; import org.joda.time.Years; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { + private static final Logger LOG = LoggerFactory.getLogger(DefaultScheduledDateGenerator.class); + @Override public LocalDate getLastRepaymentDate(final LoanApplicationTerms loanApplicationTerms, final HolidayDetailDTO holidayDetailDTO) { @@ -225,7 +229,9 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { break; case INVALID: break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement getRepaymentPeriodDate for WHOLE_TERM"); + break; } return dueRepaymentPeriodDate; } @@ -265,7 +271,9 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { break; case INVALID: break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement isDateFallsInSchedule for WHOLE_TERM"); + break; } return isScheduledDate; } @@ -300,7 +308,9 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator { break; case INVALID: break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement repaymentPeriodFrequencyType for WHOLE_TERM"); + break; } return idealDisbursementDate; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java index 7bf3d1dad..f1d8fff91 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java @@ -57,9 +57,13 @@ import org.joda.time.Period; import org.joda.time.PeriodType; import org.joda.time.Weeks; import org.joda.time.Years; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public final class LoanApplicationTerms { + private static final Logger LOG = LoggerFactory.getLogger(LoanApplicationTerms.class); + private final ApplicationCurrency currency; private final Calendar loanCalendar; @@ -648,7 +652,9 @@ public final class LoanApplicationTerms { break; case INVALID: break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement getPeriodEndDate for WHOLE_TERM"); + break; } return dueRepaymentPeriodDate; } @@ -1038,7 +1044,9 @@ public final class LoanApplicationTerms { } periodicInterestRate = oneDayOfYearInterestRate.multiply(numberOfDaysInPeriod, mc); break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement periodicInterestRate for WHOLE_TERM"); + break; } break; case SAME_AS_REPAYMENT_PERIOD: diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java index c40ad3deb..26ec4fd50 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/api/NotesApiResource.java @@ -54,6 +54,8 @@ import org.apache.fineract.portfolio.note.data.NoteData; import org.apache.fineract.portfolio.note.domain.NoteType; import org.apache.fineract.portfolio.note.exception.NoteResourceNotSupportedException; import org.apache.fineract.portfolio.note.service.NoteReadPlatformService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -69,6 +71,7 @@ public class NotesApiResource { Arrays.asList("id", "clientId", "groupId", "loanId", "loanTransactionId", "depositAccountId", "savingAccountId", "noteType", "note", "createdById", "createdByUsername", "createdOn", "updatedById", "updatedByUsername", "updatedOn")); + private static final Logger LOG = LoggerFactory.getLogger(NotesApiResource.class); private final PlatformSecurityContext context; private final NoteReadPlatformService readPlatformService; private final DefaultToApiJsonSerializer toApiJsonSerializer; @@ -254,6 +257,8 @@ public class NotesApiResource { resourceDetails.withGroupId(resourceId); break; default: + resourceNameForPermissions = "INVALIDNOTE"; + break; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteWritePlatformServiceJpaRepositoryImpl.java index c679946a1..446e51054 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteWritePlatformServiceJpaRepositoryImpl.java @@ -40,12 +40,15 @@ import org.apache.fineract.portfolio.note.domain.NoteType; import org.apache.fineract.portfolio.note.exception.NoteNotFoundException; import org.apache.fineract.portfolio.note.exception.NoteResourceNotSupportedException; import org.apache.fineract.portfolio.note.serialization.NoteCommandFromApiJsonDeserializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class NoteWritePlatformServiceJpaRepositoryImpl implements NoteWritePlatformService { + private static final Logger LOG = LoggerFactory.getLogger(NoteWritePlatformServiceJpaRepositoryImpl.class); private final NoteRepository noteRepository; private final ClientRepositoryWrapper clientRepository; private final GroupRepository groupRepository; @@ -446,7 +449,12 @@ public class NoteWritePlatformServiceJpaRepositoryImpl implements NoteWritePlatf // break; case SAVING_ACCOUNT: break; - default: + case SHARE_ACCOUNT: + LOG.error("TODO Implement getNoteForDelete for SHARE_ACCOUNT"); + break; + case SAVINGS_TRANSACTION: + LOG.error("TODO Implement getNoteForDelete for SAVINGS_TRANSACTION"); + break; } if (noteForUpdate == null) { throw new NoteNotFoundException(noteId, resourceId, type.name().toLowerCase()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountUtils.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountUtils.java index 26604185f..62e75fa06 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositAccountUtils.java @@ -22,9 +22,13 @@ import org.apache.fineract.portfolio.calendar.domain.CalendarFrequencyType; import org.apache.fineract.portfolio.calendar.service.CalendarUtils; import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType; import org.joda.time.LocalDate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DepositAccountUtils { + private static final Logger LOG = LoggerFactory.getLogger(DepositAccountUtils.class); + public static final int GENERATE_MINIMUM_NUMBER_OF_FUTURE_INSTALMENTS = 5; public static LocalDate calculateNextDepositDate(final LocalDate lastDepositDate, final PeriodFrequencyType frequency, @@ -46,7 +50,9 @@ public class DepositAccountUtils { break; case INVALID: break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement calculateNextDepositDate for WHOLE_TERM"); + break; } return nextDepositDate; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java index 8e9ef3187..211743307 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java @@ -117,6 +117,8 @@ import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.util.CollectionUtils; @Entity @@ -127,6 +129,8 @@ import org.springframework.util.CollectionUtils; @DiscriminatorValue("100") public class SavingsAccount extends AbstractPersistableCustom { + private static final Logger LOG = LoggerFactory.getLogger(SavingsAccount.class); + @Version int version; @@ -2383,7 +2387,9 @@ public class SavingsAccount extends AbstractPersistableCustom { case YEARS: lockedInUntilLocalDate = activationLocalDate.plusYears(this.lockinPeriodFrequency).toDate(); break; - default: + case WHOLE_TERM: + LOG.error("TODO Implement calculateDateAccountIsLockedUntil for WHOLE_TERM"); + break; } return lockedInUntilLocalDate; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java index 9a9f0d7dd..38f318334 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java @@ -51,6 +51,8 @@ import org.apache.fineract.portfolio.charge.domain.ChargeTimeType; import org.apache.fineract.portfolio.charge.exception.SavingsAccountChargeWithoutMandatoryFieldException; import org.joda.time.LocalDate; import org.joda.time.MonthDay; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author dv6 @@ -60,6 +62,8 @@ import org.joda.time.MonthDay; @Table(name = "m_savings_account_charge") public class SavingsAccountCharge extends AbstractPersistableCustom { + private static final Logger LOG = LoggerFactory.getLogger(SavingsAccountCharge.class); + @ManyToOne(optional = false) @JoinColumn(name = "savings_account_id", referencedColumnName = "id", nullable = false) private SavingsAccount savingsAccount; @@ -290,7 +294,15 @@ public class SavingsAccountCharge extends AbstractPersistableCustom { this.amountWaived = null; this.amountWrittenOff = null; break; - default: + case PERCENT_OF_DISBURSEMENT_AMOUNT: + this.percentage = null; + this.amount = null; + this.amountPercentageAppliedTo = null; + this.amountPaid = null; + this.amountOutstanding = BigDecimal.ZERO; + this.amountWaived = null; + this.amountWrittenOff = null; + break; } } @@ -419,7 +431,9 @@ public class SavingsAccountCharge extends AbstractPersistableCustom { this.amountPercentageAppliedTo = null; this.amountOutstanding = null; break; - default: + case PERCENT_OF_DISBURSEMENT_AMOUNT: + LOG.error("TODO Implement update ChargeCalculationType for PERCENT_OF_DISBURSEMENT_AMOUNT"); + break; } } } @@ -493,7 +507,9 @@ public class SavingsAccountCharge extends AbstractPersistableCustom { this.amountPercentageAppliedTo = null; this.amountOutstanding = null; break; - default: + case PERCENT_OF_DISBURSEMENT_AMOUNT: + LOG.error("TODO Implement update ChargeCalculationType for PERCENT_OF_DISBURSEMENT_AMOUNT"); + break; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java index 3be51c4f0..d52125bb3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java @@ -69,12 +69,16 @@ import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class ShareAccountDataSerializer { + private static final Logger LOG = LoggerFactory.getLogger(ShareAccountDataSerializer.class); + private final PlatformSecurityContext platformSecurityContext; private final FromJsonHelper fromApiJsonHelper; @@ -967,7 +971,8 @@ public class ShareAccountDataSerializer { case YEARS: lockinDate = purchaseDate.plusYears(lockinPeriod); break; - default: + case WHOLE_TERM: // Never comes in to this state. + break; } } return lockinDate; From cbad22d57a6d7c7cf92f1a1fa3d5282baed08aa1 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 14 Jul 2020 09:51:26 +0000 Subject: [PATCH 072/131] Update dependency org.apache.bval:org.apache.bval.bundle to v2.0.4 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 19ed2f36b..2ac5c6aca 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -116,7 +116,7 @@ dependencyManagement { dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' dependency 'jakarta.validation:jakarta.validation-api:2.0.2' dependency 'org.apache.activemq:activemq-broker:5.16.0' - dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3' + dependency 'org.apache.bval:org.apache.bval.bundle:2.0.4' dependency 'org.mockito:mockito-core:3.4.0' dependency 'org.mockito:mockito-junit-jupiter:3.4.0' dependency 'io.github.classgraph:classgraph:4.8.87' From 5506f687661847e9c3e2077ad7fb45b634338cf0 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Tue, 14 Jul 2020 09:40:22 +0530 Subject: [PATCH 073/131] FINERACT-1090 Removed top bar and Added Search (swagger) --- .../src/main/resources/static/swagger-ui/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fineract-provider/src/main/resources/static/swagger-ui/index.html b/fineract-provider/src/main/resources/static/swagger-ui/index.html index c21ebe405..3408ce2da 100644 --- a/fineract-provider/src/main/resources/static/swagger-ui/index.html +++ b/fineract-provider/src/main/resources/static/swagger-ui/index.html @@ -42,6 +42,7 @@ url: "fineract.json", dom_id: '#swagger-ui', deepLinking: true, + filter: '', presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset @@ -49,7 +50,7 @@ plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], - layout: "StandaloneLayout" + layout: "BaseLayout" }) // End Swagger UI call region From 737d1f191184c5ce4ccda5df6b3a1bd188c82ada Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Mon, 13 Jul 2020 04:04:51 +0530 Subject: [PATCH 074/131] FINERACT-821 Added and enforced ParameterName checkstyle --- .../config/checkstyle/checkstyle.xml | 11 ++++--- .../integrationtests/FixedDepositTest.java | 6 ++-- .../RecurringDepositTest.java | 6 ++-- .../loans/LoanApplicationTestBuilder.java | 6 ++-- .../common/savings/SavingsAccountHelper.java | 32 +++++++++---------- .../SavingsApplicationTestBuilder.java | 6 ++-- 6 files changed, 34 insertions(+), 33 deletions(-) diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml index 3f29e719e..3c5f03ce8 100644 --- a/fineract-provider/config/checkstyle/checkstyle.xml +++ b/fineract-provider/config/checkstyle/checkstyle.xml @@ -46,6 +46,11 @@ + + + + @@ -221,11 +226,7 @@ - - - - + 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 70ee31936..583f95a0f 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 @@ -2661,16 +2661,16 @@ public class FixedDepositTest { return financialAccount; } - private Account createLiabilityFinancialAccountTransferType(final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID) { + private Account createLiabilityFinancialAccountTransferType(final Integer liabilityTransferFinancialActivityId) { /*** * Create and verify financial account transfer type is created */ final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount(); Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( - LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec, + liabilityTransferFinancialActivityId, liabilityAccountForMapping.getAccountID(), this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); Assertions.assertNotNull(financialActivityAccountId); - assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, + assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId, liabilityAccountForMapping); return liabilityAccountForMapping; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java index b6b4181a3..3f579ea7b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java @@ -3114,16 +3114,16 @@ public class RecurringDepositTest { return financialAccount; } - private Account createLiabilityFinancialAccountTransferType(final Integer LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID) { + private Account createLiabilityFinancialAccountTransferType(final Integer liabilityTransferFinancialActivityId) { /*** * Create and verify financial account transfer type is created */ final Account liabilityAccountForMapping = this.accountHelper.createLiabilityAccount(); Integer financialActivityAccountId = (Integer) financialActivityAccountHelper.createFinancialActivityAccount( - LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, liabilityAccountForMapping.getAccountID(), this.responseSpec, + liabilityTransferFinancialActivityId, liabilityAccountForMapping.getAccountID(), this.responseSpec, CommonConstants.RESPONSE_RESOURCE_ID); Assertions.assertNotNull(financialActivityAccountId); - assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID, + assertFinancialActivityAccountCreation(financialActivityAccountId, liabilityTransferFinancialActivityId, liabilityAccountForMapping); return liabilityAccountForMapping; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java index 9e811821b..72e4c43ba 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/loans/LoanApplicationTestBuilder.java @@ -98,14 +98,14 @@ public class LoanApplicationTestBuilder { return build(map, loanProductId, savingsID); } - public String build(final String ID, final String loanProductId, final String savingsID) { + public String build(final String id, final String loanProductId, final String savingsID) { final HashMap map = new HashMap<>(); if ("group".equals(this.loanType)) { - map.put("groupId", ID); + map.put("groupId", id); } else { - map.put("clientId", ID); + map.put("clientId", id); } return build(map, loanProductId, savingsID); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java index 99567f673..0507f3e92 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java @@ -102,58 +102,58 @@ public class SavingsAccountHelper { return sdf.format(calendar.getTime()); } - public Integer applyForSavingsApplication(final Integer ID, final Integer savingsProductID, final String accountType) { - return applyForSavingsApplicationOnDate(ID, savingsProductID, accountType, CREATED_DATE); + public Integer applyForSavingsApplication(final Integer id, final Integer savingsProductID, final String accountType) { + return applyForSavingsApplicationOnDate(id, savingsProductID, accountType, CREATED_DATE); } - public Integer applyForSavingsApplicationOnDate(final Integer ID, final Integer savingsProductID, final String accountType, + public Integer applyForSavingsApplicationOnDate(final Integer id, final Integer savingsProductID, final String accountType, final String submittedOnDate) { - return applyForSavingsApplicationOnDate(ID, savingsProductID, accountType, null, false, submittedOnDate); + return applyForSavingsApplicationOnDate(id, savingsProductID, accountType, null, false, submittedOnDate); } - public Integer applyForSavingsApplicationWithExternalId(final Integer ID, final Integer savingsProductID, final String accountType, + public Integer applyForSavingsApplicationWithExternalId(final Integer id, final Integer savingsProductID, final String accountType, String externalId, boolean withdrawalFeeForTransfers) { - return applyForSavingsApplicationOnDate(ID, savingsProductID, accountType, externalId, withdrawalFeeForTransfers, CREATED_DATE); + return applyForSavingsApplicationOnDate(id, savingsProductID, accountType, externalId, withdrawalFeeForTransfers, CREATED_DATE); } - public Integer applyForSavingsApplicationOnDate(final Integer ID, final Integer savingsProductID, final String accountType, + public Integer applyForSavingsApplicationOnDate(final Integer id, final Integer savingsProductID, final String accountType, String externalId, boolean withdrawalFeeForTransfers, final String submittedOnDate) { LOG.info("--------------------------------APPLYING FOR SAVINGS APPLICATION--------------------------------"); final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withExternalId(externalId) // .withWithdrawalFeeForTransfers(withdrawalFeeForTransfers) // .withSubmittedOnDate(submittedOnDate) // - .build(ID.toString(), savingsProductID.toString(), accountType); + .build(id.toString(), savingsProductID.toString(), accountType); return Utils.performServerPost(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER, savingsApplicationJSON, "savingsId"); } - public Integer applyForSavingsApplicationWithDatatables(final Integer ID, final Integer savingsProductID, final String accountType, + public Integer applyForSavingsApplicationWithDatatables(final Integer id, final Integer savingsProductID, final String accountType, final String submittedOnDate, final String datatableName) { LOG.info("----------------------------APPLYING FOR SAVINGS APPLICATION WITH DATATABLES----------------------------"); final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withSubmittedOnDate(submittedOnDate) // .withDatatables(getTestDatatableAsJson(datatableName)) // - .build(ID.toString(), savingsProductID.toString(), accountType); + .build(id.toString(), savingsProductID.toString(), accountType); return Utils.performServerPost(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER, savingsApplicationJSON, "savingsId"); } - public Object applyForSavingsApplicationWithFailure(final Integer ID, final Integer savingsProductID, final String accountType, + public Object applyForSavingsApplicationWithFailure(final Integer id, final Integer savingsProductID, final String accountType, final String submittedOnDate, final String responseAttribute) { LOG.info("----------------------------APPLYING FOR SAVINGS APPLICATION WITH ERROR----------------------------"); final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withSubmittedOnDate(submittedOnDate) // - .build(ID.toString(), savingsProductID.toString(), accountType); + .build(id.toString(), savingsProductID.toString(), accountType); return Utils.performServerPost(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL + "?" + Utils.TENANT_IDENTIFIER, savingsApplicationJSON, responseAttribute); } - public HashMap updateSavingsAccount(final Integer ID, final Integer savingsProductID, final Integer savingsId, + public HashMap updateSavingsAccount(final Integer id, final Integer savingsProductID, final Integer savingsId, final String accountType) { final String savingsApplicationJSON = new SavingsApplicationTestBuilder() // .withSubmittedOnDate(CREATED_DATE_PLUS_ONE) // - .build(ID.toString(), savingsProductID.toString(), accountType); + .build(id.toString(), savingsProductID.toString(), accountType); return Utils.performServerPut(this.requestSpec, this.responseSpec, SAVINGS_ACCOUNT_URL + "/" + savingsId + "?" + Utils.TENANT_IDENTIFIER, savingsApplicationJSON, @@ -591,13 +591,13 @@ public class SavingsAccountHelper { } private HashMap performSavingApplicationActions(final String postURLForSavingsTransaction, final String jsonToBeSent, - final Boolean IS_BLOCK) { + final Boolean isBlock) { HashMap status = null; final HashMap response = Utils.performServerPost(this.requestSpec, this.responseSpec, postURLForSavingsTransaction, jsonToBeSent, CommonConstants.RESPONSE_CHANGES); if (response != null) { status = (HashMap) response.get("status"); - if (IS_BLOCK != null && IS_BLOCK) { + if (isBlock != null && isBlock) { status = (HashMap) response.get("subStatus"); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java index 0382f40e6..6666da98e 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/savings/SavingsApplicationTestBuilder.java @@ -43,14 +43,14 @@ public class SavingsApplicationTestBuilder { private List> clientArray = null; private List> savingsArray = null; - public String build(final String ID, final String savingsProductId, final String accountType) { + public String build(final String id, final String savingsProductId, final String accountType) { final HashMap map = new HashMap<>(); map.put("dateFormat", "dd MMMM yyyy"); if (accountType.equals("GROUP")) { - map.put("groupId", ID); + map.put("groupId", id); } else { - map.put("clientId", ID); + map.put("clientId", id); } map.put("productId", savingsProductId); map.put("locale", LOCALE); From 271401cd6b4704609845a4eeade0d5cb8d418d30 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Thu, 16 Jul 2020 18:50:49 +0530 Subject: [PATCH 075/131] FINERACT-821 Added and Enforced LocalVariableName Checkstyle --- .../AuditIntegrationTest.java | 19 ++++++++++++++----- .../integrationtests/common/AuditHelper.java | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java index e69b2e999..327a2fb9a 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java @@ -23,6 +23,7 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.ContentType; import io.restassured.specification.RequestSpecification; import io.restassured.specification.ResponseSpecification; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Random; @@ -103,12 +104,8 @@ public class AuditIntegrationTest { auditHelper.verifyOneAuditOnly(auditsRecieved, officeId, "CREATE", "OFFICE"); } - /** - * - * Here we test that audit request with limit x only returns x entries - */ @Test - public void checkAuditsWithLimit() { + public void checkAuditsWithLimitParam() { // Create client final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); @@ -128,4 +125,16 @@ public class AuditIntegrationTest { } } + @Test + public void checkIfOrderBySupported() { + final List shouldBeSupportedFor = Arrays.asList("checkedOnDate", "officeName", "resourceId", "clientId", "processingResult", + "clientName", "maker", "subresourceId", "checker", "savingsAccountNo", "loanAccountNo", "groupName", "entityName", + "madeOnDate", "id", "loanId", "actionName"); + + for (int i = 0; i < shouldBeSupportedFor.size(); i++) { + auditHelper.verifyOrderBysupported(shouldBeSupportedFor.get(i)); + } + + } + } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java index 0415bc163..b8c5db74d 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/AuditHelper.java @@ -100,4 +100,9 @@ public class AuditHelper { assertEquals(limit, getAuditDetails(limit).size(), "Incorrect number of audits recieved for limit: " + Integer.toString(limit)); } + public void verifyOrderBysupported(final String orderByValue) { + final String AUDIT_URL = "/fineract-provider/api/v1/audits/?paged=true&orderBy=" + orderByValue + "&" + Utils.TENANT_IDENTIFIER; + Utils.performServerGet(requestSpec, responseSpec, AUDIT_URL, ""); + } + } From 7ef3a745308b992c08d5a4b0df17b0638b502b5d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 16 Jul 2020 16:22:11 +0000 Subject: [PATCH 076/131] Update dependency org.apache.openjpa:openjpa to v3.1.2 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 2ac5c6aca..7642010d2 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -47,7 +47,7 @@ buildscript { classpath 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10' classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE' classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0' - classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! + classpath 'org.apache.openjpa:openjpa:3.1.2' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0' classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.4.4" From 9eff82d85bd17427aade162933ab1333b6210898 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Fri, 17 Jul 2020 00:31:25 +0530 Subject: [PATCH 077/131] FINERACT-836 Integration test for swagger-ui --- .../integrationtests/SwaggeruiTest.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java new file mode 100644 index 000000000..da9b9e1b6 --- /dev/null +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.integrationtests; + +import io.restassured.builder.RequestSpecBuilder; +import io.restassured.builder.ResponseSpecBuilder; +import io.restassured.http.ContentType; +import io.restassured.specification.RequestSpecification; +import io.restassured.specification.ResponseSpecification; +import org.apache.fineract.integrationtests.common.Utils; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * @author Manthan Surkar + */ +public class SwaggeruiTest { + + private ResponseSpecification responseSpec; + private RequestSpecification requestSpec; + + @BeforeEach + public void setup() { + Utils.initializeRESTAssured(); + this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); + this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); + } + + @Test + public void testSwaggerUAccess() { + Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui", null); + Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui/index.html", null); + } + +} From 9048d416f5cf4272b7626d50642d1639e67a893a Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Fri, 17 Jul 2020 00:49:07 +0530 Subject: [PATCH 078/131] FINERACT-836 Integration test for swagger-ui --- .../org/apache/fineract/integrationtests/SwaggeruiTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java index da9b9e1b6..da606ad2f 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SwaggeruiTest.java @@ -43,7 +43,7 @@ public class SwaggeruiTest { } @Test - public void testSwaggerUAccess() { + public void testSwaggeruiAccess() { Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui", null); Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui/index.html", null); } From 9d6a2ee9ddcc67460128ac97e1465b4e08a5a6ea Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 17 Jul 2020 07:53:21 +0000 Subject: [PATCH 079/131] Update dependency org.webjars.npm:swagger-ui-dist to v3.29.0 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 7642010d2..c2b6b2b49 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -124,7 +124,7 @@ dependencyManagement { dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' dependency 'javax.cache:cache-api:1.1.1' dependency 'org.mock-server:mockserver-junit-jupiter:5.10.0' - dependency 'org.webjars.npm:swagger-ui-dist:3.28.0' + dependency 'org.webjars.npm:swagger-ui-dist:3.29.0' dependency 'org.webjars:webjars-locator-core:0.46' dependency ('org.dom4j:dom4j:2.1.3') { From 5c1c6a6d73d4537309a2ac2616330ac09458fcc2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 18 Jul 2020 18:04:54 +0000 Subject: [PATCH 080/131] Update dependency org.webjars.npm:swagger-ui-dist to v3.30.0 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index c2b6b2b49..3102c9007 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -124,7 +124,7 @@ dependencyManagement { dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' dependency 'javax.cache:cache-api:1.1.1' dependency 'org.mock-server:mockserver-junit-jupiter:5.10.0' - dependency 'org.webjars.npm:swagger-ui-dist:3.29.0' + dependency 'org.webjars.npm:swagger-ui-dist:3.30.0' dependency 'org.webjars:webjars-locator-core:0.46' dependency ('org.dom4j:dom4j:2.1.3') { From c623ddb8429a68003465d345833956cec2e51263 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 18 Jul 2020 19:55:43 +0000 Subject: [PATCH 081/131] Update dependency org.mockito:mockito-junit-jupiter to v3.4.4 --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 3102c9007..db59ce278 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -118,7 +118,7 @@ dependencyManagement { dependency 'org.apache.activemq:activemq-broker:5.16.0' dependency 'org.apache.bval:org.apache.bval.bundle:2.0.4' dependency 'org.mockito:mockito-core:3.4.0' - dependency 'org.mockito:mockito-junit-jupiter:3.4.0' + dependency 'org.mockito:mockito-junit-jupiter:3.4.4' dependency 'io.github.classgraph:classgraph:4.8.87' dependency 'org.awaitility:awaitility:4.0.3' dependency 'com.github.spotbugs:spotbugs-annotations:4.0.6' From 55b44dbf12af794cb3d7a86c3ec8122d383b7e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Thu, 16 Jul 2020 19:35:33 +0200 Subject: [PATCH 082/131] Update openjpa to v3.1.2 also in dependencyManagement not just buildscript --- fineract-provider/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index db59ce278..fba5a5d70 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -91,7 +91,7 @@ dependencyManagement { // We use the Renovate Bot to automatically propose Pull Requests (PRs) when upgrades for all of these versions are available. dependency 'org.springframework.security.oauth:spring-security-oauth2:2.5.0.RELEASE' - dependency 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated above in buildscript! + dependency 'org.apache.openjpa:openjpa:3.1.2' // when upgrading, also change OpenJPA version repeated above in buildscript! dependency 'com.squareup.retrofit:retrofit:1.9.0' dependency 'com.squareup.okhttp:okhttp:2.7.5' dependency 'com.squareup.okhttp:okhttp-urlconnection:2.7.5' From ec9513c3c798d36eb1b97a068cbcace3d43326a4 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Tue, 14 Jul 2020 04:58:11 +0530 Subject: [PATCH 083/131] FINERACT-821 Added and Enforced LocalVariableName Checkstyle --- .../config/checkstyle/checkstyle.xml | 14 +- .../AccountingScenarioIntegrationTest.java | 14 +- .../ClientLoanIntegrationTest.java | 44 ++--- .../ClientSavingsIntegrationTest.java | 52 +++--- .../integrationtests/FixedDepositTest.java | 8 +- .../RecurringDepositTest.java | 176 +++++++++--------- .../integrationtests/common/ImageHelper.java | 10 +- .../common/SchedulerJobHelper.java | 8 +- .../loanaccount/guarantor/GuarantorTest.java | 94 +++++----- .../core/boot/WebFrontEndConfiguration.java | 4 +- 10 files changed, 212 insertions(+), 212 deletions(-) diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml index 3c5f03ce8..23a3ad6c1 100644 --- a/fineract-provider/config/checkstyle/checkstyle.xml +++ b/fineract-provider/config/checkstyle/checkstyle.xml @@ -185,6 +185,13 @@ + + + + + +