diff --git a/.github/scripts/check-generated-client-method-compatibility.py b/.github/scripts/check-generated-client-method-compatibility.py new file mode 100644 index 00000000000..f6d57a5639f --- /dev/null +++ b/.github/scripts/check-generated-client-method-compatibility.py @@ -0,0 +1,302 @@ +#!/usr/bin/env python3 +# +# 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. +"""Check generated Fineract client API method-name compatibility.""" + +import argparse +import os +import re +import sys +from collections import OrderedDict +from pathlib import Path + + +CLIENT_API_DIRECTORIES = OrderedDict( + [ + ( + "fineract-client", + Path("fineract-client/build/generated/java/src/main/java/org/apache/fineract/client/services"), + ), + ( + "fineract-client-feign", + Path("fineract-client-feign/build/generated/java/src/main/java/org/apache/fineract/client/feign/services"), + ), + ] +) + +INTERFACE_PATTERN = re.compile(r"\binterface\s+([A-Za-z_$][\w$]*)\b") +METHOD_PATTERN = re.compile(r"\b([A-Za-z_$][\w$]*)\s*\(") +TYPE_DECLARATION_PATTERN = re.compile(r"\b(class|interface|enum|record)\b") + + +def strip_comments_and_literals(source): + result = [] + i = 0 + while i < len(source): + if source.startswith("//", i): + i += 2 + while i < len(source) and source[i] != "\n": + i += 1 + if i < len(source): + result.append("\n") + i += 1 + continue + + if source.startswith("/*", i): + i += 2 + while i < len(source) and not source.startswith("*/", i): + if source[i] == "\n": + result.append("\n") + i += 1 + i += 2 + continue + + if source.startswith('"""', i): + result.append('""') + i += 3 + while i < len(source) and not source.startswith('"""', i): + if source[i] == "\n": + result.append("\n") + i += 1 + i += 3 + continue + + if source[i] == '"': + result.append('""') + i += 1 + escaped = False + while i < len(source): + char = source[i] + i += 1 + if escaped: + escaped = False + elif char == "\\": + escaped = True + elif char == '"': + break + continue + + if source[i] == "'": + result.append("''") + i += 1 + escaped = False + while i < len(source): + char = source[i] + i += 1 + if escaped: + escaped = False + elif char == "\\": + escaped = True + elif char == "'": + break + continue + + result.append(source[i]) + i += 1 + + return "".join(result) + + +def strip_annotations(source): + result = [] + i = 0 + while i < len(source): + if source[i] != "@": + result.append(source[i]) + i += 1 + continue + + i += 1 + while i < len(source) and (source[i].isalnum() or source[i] in "_$."): + i += 1 + while i < len(source) and source[i].isspace(): + i += 1 + + if i < len(source) and source[i] == "(": + depth = 1 + i += 1 + while i < len(source) and depth > 0: + if source[i] == "(": + depth += 1 + elif source[i] == ")": + depth -= 1 + i += 1 + + result.append(" ") + + return "".join(result) + + +def method_name_from_member(member): + compact = " ".join(member.split()) + if not compact or "(" not in compact: + return None + if TYPE_DECLARATION_PATTERN.search(compact): + return None + + match = METHOD_PATTERN.search(compact) + if not match: + return None + return match.group(1) + + +def extract_api_methods(java_file): + source = java_file.read_text(encoding="utf-8") + source = strip_annotations(strip_comments_and_literals(source)) + + interface_match = INTERFACE_PATTERN.search(source) + if not interface_match: + return set() + + body_start = source.find("{", interface_match.end()) + if body_start < 0: + return set() + + methods = set() + depth = 1 + member = [] + i = body_start + 1 + while i < len(source) and depth > 0: + char = source[i] + if depth == 1: + if char == "{": + name = method_name_from_member("".join(member)) + if name: + methods.add(name) + member = [] + depth += 1 + elif char == ";": + name = method_name_from_member("".join(member)) + if name: + methods.add(name) + member = [] + elif char == "}": + depth -= 1 + member = [] + else: + member.append(char) + else: + if char == "{": + depth += 1 + elif char == "}": + depth -= 1 + i += 1 + + return methods + + +def collect_api_surface(source_root): + if not source_root.is_dir(): + raise FileNotFoundError(f"Generated API directory does not exist: {source_root}") + + surface = OrderedDict() + for java_file in sorted(source_root.rglob("*Api.java")): + relative_path = java_file.relative_to(source_root).as_posix() + methods = extract_api_methods(java_file) + if methods: + surface[relative_path] = methods + return surface + + +def compare_surfaces(baseline_root, current_root): + violations = [] + for client_name, api_directory in CLIENT_API_DIRECTORIES.items(): + baseline_surface = collect_api_surface(baseline_root / api_directory) + current_surface = collect_api_surface(current_root / api_directory) + + for api_file, baseline_methods in baseline_surface.items(): + current_methods = current_surface.get(api_file, set()) + missing_methods = sorted(baseline_methods - current_methods) + if missing_methods: + violations.append((client_name, api_file, missing_methods)) + + return violations + + +def markdown_methods(methods): + rendered = ", ".join(f"`{method}`" for method in methods[:20]) + if len(methods) > 20: + rendered += f" +{len(methods) - 20} more" + return rendered + + +def build_report(violations): + lines = ["## Generated Client API Method Compatibility", ""] + if not violations: + lines.append("No generated API method names were removed from `fineract-client` or `fineract-client-feign`.") + return "\n".join(lines) + "\n" + + lines.extend( + [ + "The generated client API method names are not backward compatible.", + "", + "Existing generated method names that disappear should be preserved with `alternativeOperationId`.", + "", + "| Client | API | Removed method names |", + "|--------|-----|----------------------|", + ] + ) + + for client_name, api_file, missing_methods in violations: + lines.append(f"| `{client_name}` | `{api_file}` | {markdown_methods(missing_methods)} |") + + lines.extend( + [ + "", + f"**Total: {sum(len(methods) for _, _, methods in violations)} removed method names across {len(violations)} API files.**", + ] + ) + return "\n".join(lines) + "\n" + + +def append_step_summary(report): + summary_file = os.environ.get("GITHUB_STEP_SUMMARY") + if summary_file: + with open(summary_file, "a", encoding="utf-8") as output: + output.write(report) + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument("--baseline-root", required=True, type=Path) + parser.add_argument("--current-root", required=True, type=Path) + parser.add_argument("--report-file", required=True, type=Path) + return parser.parse_args() + + +def main(): + args = parse_args() + violations = compare_surfaces(args.baseline_root, args.current_root) + report = build_report(violations) + + args.report_file.write_text(report, encoding="utf-8") + append_step_summary(report) + print(report) + + if violations: + print( + "::error::Generated client API method names were removed. " + "Add alternativeOperationId entries to preserve backward-compatible methods." + ) + return 1 + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.github/workflows/full-build-ci.yml b/.github/workflows/full-build-ci.yml index b75c43becfa..093857e948d 100644 --- a/.github/workflows/full-build-ci.yml +++ b/.github/workflows/full-build-ci.yml @@ -121,6 +121,12 @@ jobs: secrets: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + run-generated-client-api-method-compatibility: + needs: build-core + uses: ./.github/workflows/verify-generated-client-api-method-compatibility.yml + secrets: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + run-liquibase-backward-compatibility: needs: build-core uses: ./.github/workflows/verify-liquibase-backward-compatibility.yml diff --git a/.github/workflows/verify-generated-client-api-method-compatibility.yml b/.github/workflows/verify-generated-client-api-method-compatibility.yml new file mode 100644 index 00000000000..147370b8dff --- /dev/null +++ b/.github/workflows/verify-generated-client-api-method-compatibility.yml @@ -0,0 +1,98 @@ +name: Verify Generated Client API Method Compatibility + +on: + workflow_call: + secrets: + DEVELOCITY_ACCESS_KEY: + required: false + +permissions: + contents: read + +jobs: + generated-client-method-compatibility-check: + if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-24.04 + timeout-minutes: 60 + + env: + TZ: Asia/Kolkata + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + + steps: + - name: Checkout base branch for baseline + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + repository: ${{ github.event.pull_request.base.repo.full_name }} + ref: ${{ github.event.pull_request.base.ref }} + fetch-depth: 0 + path: baseline + + - name: Checkout base branch for merged PR + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + repository: ${{ github.event.pull_request.base.repo.full_name }} + ref: ${{ github.event.pull_request.base.ref }} + fetch-depth: 0 + path: current + + - name: Merge PR into current base + working-directory: current + env: + PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + + case "$PR_HEAD_SHA" in + ""|*[!0-9a-fA-F]*) + echo "::error::Invalid pull request head SHA: $PR_HEAD_SHA" + exit 1 + ;; + esac + + git fetch "https://github.com/${PR_HEAD_REPO}.git" "$PR_HEAD_SHA" --no-tags + + git merge --no-commit --no-ff FETCH_HEAD + + - name: Set up JDK 21 + uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5 + with: + distribution: 'zulu' + java-version: '21' + + - name: Generate baseline client + working-directory: baseline + run: ./gradlew --no-daemon :fineract-client:cleanupGeneratedJavaFiles -x :fineract-client-feign:cleanupGeneratedJavaFiles + + - name: Generate baseline feign client + working-directory: baseline + run: ./gradlew --no-daemon -x :fineract-client:cleanupGeneratedJavaFiles :fineract-client-feign:cleanupGeneratedJavaFiles + + - name: Generate merged client + working-directory: current + run: ./gradlew --no-daemon :fineract-client:cleanupGeneratedJavaFiles -x :fineract-client-feign:cleanupGeneratedJavaFiles + + - name: Generate merged feign client + working-directory: current + run: ./gradlew --no-daemon -x :fineract-client:cleanupGeneratedJavaFiles :fineract-client-feign:cleanupGeneratedJavaFiles + + - name: Check generated client API method compatibility + run: | + python3 current/.github/scripts/check-generated-client-method-compatibility.py \ + --baseline-root "${GITHUB_WORKSPACE}/baseline" \ + --current-root "${GITHUB_WORKSPACE}/current" \ + --report-file "${GITHUB_WORKSPACE}/generated-client-method-compatibility-report.md" + + - name: Archive generated client compatibility report + if: failure() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: generated-client-method-compatibility-report + path: generated-client-method-compatibility-report.md + if-no-files-found: ignore + retention-days: 5 + compression-level: 9 diff --git a/fineract-accounting/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java b/fineract-accounting/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java index 6fe5be379e5..75a39196388 100644 --- a/fineract-accounting/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java +++ b/fineract-accounting/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java @@ -46,6 +46,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -85,6 +86,7 @@ public class GLClosuresApiResource { Example Requests: glclosures""") + @AlternativeOperationId("retrieveAllClosures") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class)))) public List retrieveAllClosures(@QueryParam("officeId") @Parameter(name = "officeId") final Long officeId) { @@ -102,6 +104,7 @@ public List retrieveAllClosures(@QueryParam("officeId") @Paramete /glclosures/1?fields=officeName,closingDate""") + @AlternativeOperationId("retreiveClosure") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))) public GLClosureData retreiveClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId, @Context final UriInfo uriInfo) { diff --git a/fineract-accounting/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java b/fineract-accounting/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java index 715a36e7a0a..0479f1fbd17 100644 --- a/fineract-accounting/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java +++ b/fineract-accounting/src/main/java/org/apache/fineract/accounting/financialactivityaccount/api/FinancialActivityAccountsApiResource.java @@ -45,6 +45,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -119,6 +120,7 @@ public FinancialActivityAccountData retreive(@PathParam("mappingId") @Parameter( @Operation(summary = "Create a new Financial Activity to Accounts Mapping", operationId = "createGLAccountMappingFinancialActivityAccount", description = """ Mandatory Fields financialActivityId, glAccountId""") + @AlternativeOperationId("createGLAccount") @RequestBody(content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsResponse.class))) public CommandProcessingResult createGLAccount(@Parameter(hidden = true) FinancialActivityAccRequest activityAccRequest) { @@ -133,6 +135,7 @@ public CommandProcessingResult createGLAccount(@Parameter(hidden = true) Financi @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Financial Activity to Account Mapping", operationId = "updateGLAccountMappingFinancialActivityAccount", description = "the API updates the Ledger account linked to a Financial Activity") + @AlternativeOperationId("updateGLAccount") @RequestBody(content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PostFinancialActivityAccountsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.PutFinancialActivityAccountsResponse.class))) public CommandProcessingResult updateGLAccount(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId, @@ -147,6 +150,7 @@ public CommandProcessingResult updateGLAccount(@PathParam("mappingId") @Paramete @Path("{mappingId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Financial Activity to Account Mapping", operationId = "deleteGLAccountMappingFinancialActivityAccount") + @AlternativeOperationId("deleteGLAccount") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FinancialActivityAccountsApiResourceSwagger.DeleteFinancialActivityAccountsResponse.class))) public CommandProcessingResult deleteGLAccount(@PathParam("mappingId") @Parameter(description = "mappingId") final Long mappingId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteOfficeToGLAccountMapping(mappingId).build(); diff --git a/fineract-accounting/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java b/fineract-accounting/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java index d0ed1635036..0c400a852bd 100644 --- a/fineract-accounting/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java +++ b/fineract-accounting/src/main/java/org/apache/fineract/accounting/glaccount/api/GLAccountsApiResource.java @@ -58,6 +58,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -184,6 +185,7 @@ public GLAccountData retreiveAccount(@PathParam("glAccountId") @Parameter(descri Mandatory Fields: name, glCode, type, usage and manualEntriesAllowed """) + @AlternativeOperationId("createGLAccount_1") @RequestBody(content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PostGLAccountsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PostGLAccountsResponse.class))) public CommandProcessingResult createGLAccount(@Parameter(hidden = true) GLAccountCommand glAccountCommand) { @@ -198,6 +200,7 @@ public CommandProcessingResult createGLAccount(@Parameter(hidden = true) GLAccou @Produces({ MediaType.APPLICATION_JSON }) @Operation(tags = { "General Ledger Account" }, summary = "Update a GL Account", operationId = "updateGLAccount", description = "Updates a GL Account") + @AlternativeOperationId("updateGLAccount_1") @RequestBody(content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PutGLAccountsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.PutGLAccountsResponse.class))) public CommandProcessingResult updateGLAccount(@PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId, @@ -212,6 +215,7 @@ public CommandProcessingResult updateGLAccount(@PathParam("glAccountId") @Parame @Produces({ MediaType.APPLICATION_JSON }) @Operation(tags = { "General Ledger Account" }, summary = "Delete a GL Account", operationId = "deleteGLAccount", description = "Deletes a GL Account") + @AlternativeOperationId("deleteGLAccount_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLAccountsApiResourceSwagger.DeleteGLAccountsResponse.class))) public CommandProcessingResult deleteGLAccount( @PathParam("glAccountId") @Parameter(description = "glAccountId") final Long glAccountId) { diff --git a/fineract-accounting/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java b/fineract-accounting/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java index 479d3bbca0c..62c430062ff 100644 --- a/fineract-accounting/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java +++ b/fineract-accounting/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java @@ -44,6 +44,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -110,6 +111,7 @@ public CommandProcessingResult modifyProvisioningEntry(@PathParam("entryId") @Pa @Path("{entryId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieves a Provisioning Entry Metadata", operationId = "retrieveOneProvisioningEntry", description = "Returns the metadata of a generated Provisioning Entry.") + @AlternativeOperationId("retrieveProvisioningEntry") public ProvisioningEntryData retrieveProvisioningEntry(@PathParam("entryId") @Parameter(description = "entryId") final Long entryId) { platformSecurityContext.authenticatedUser(); return provisioningEntriesReadPlatformService.retrieveProvisioningEntryData(entryId); @@ -119,6 +121,7 @@ public ProvisioningEntryData retrieveProvisioningEntry(@PathParam("entryId") @Pa @Path("entries") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Provisioning Entries Loan Products Given a Query", operationId = "retrieveProvisioningEntriesLoanProducts") + @AlternativeOperationId("retrieveProviioningEntries") public Page 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, diff --git a/fineract-accounting/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java b/fineract-accounting/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java index 8d450cd551c..abd44f0047f 100644 --- a/fineract-accounting/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java +++ b/fineract-accounting/src/main/java/org/apache/fineract/accounting/rule/api/AccountingRuleApiResource.java @@ -55,6 +55,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -102,6 +103,7 @@ public class AccountingRuleApiResource { Example Request: accountingrules/template""") + @AlternativeOperationId("retrieveTemplate_1") public AccountingRuleData retrieveTemplate() { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION); return handleTemplate(null); @@ -136,6 +138,7 @@ public List retrieveAllAccountingRules(@Context final UriInf Example Requests: accountingrules/1""") + @AlternativeOperationId("retreiveAccountingRule") public AccountingRuleData retreiveAccountingRule( @PathParam("accountingRuleId") @Parameter(description = "accountingRuleId") final Long accountingRuleId, @Context final UriInfo uriInfo) { diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java index c95f9857eaa..24f7d496732 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/CashierApiResource.java @@ -29,6 +29,7 @@ import java.time.format.DateTimeFormatter; import java.util.Collection; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.organisation.teller.data.CashierData; import org.apache.fineract.organisation.teller.service.TellerManagementReadPlatformService; @@ -45,6 +46,7 @@ public class CashierApiResource { @GET @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List Cashiers", operationId = "retrieveAllCashiers") + @AlternativeOperationId("getCashierData") public Collection getCashierData(@QueryParam("officeId") final Long officeId, @QueryParam("tellerId") final Long tellerId, @QueryParam("staffId") final Long staffId, @QueryParam("date") final String date) { final LocalDate dateRestriction = date != null ? LocalDate.parse(date, DateTimeFormatter.BASIC_ISO_DATE) diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java index 630ad36f413..1a765484971 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java @@ -43,6 +43,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.core.service.DateUtils; @@ -75,6 +76,7 @@ public class TellerApiResource { @GET @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List all tellers", operationId = "retrieveAllTellers", description = "Retrieves list tellers") + @AlternativeOperationId("getTellerData") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class)))) public Collection getTellerData(@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId) { return readPlatformService.getTellers(officeId); @@ -84,6 +86,7 @@ public Collection getTellerData(@QueryParam("officeId") @Parameter(d @Path("{tellerId}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve tellers", operationId = "retrieveOneTeller", description = "") + @AlternativeOperationId("findTeller") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersResponse.class))) public TellerData findTeller(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) { return readPlatformService.findTeller(tellerId); @@ -133,6 +136,7 @@ public CommandProcessingResult deleteTeller(@PathParam("tellerId") @Parameter(de @Path("{tellerId}/cashiers") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List Cashiers", operationId = "retrieveAllCashiersForTeller", description = "") + @AlternativeOperationId("getCashierData_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersResponse.class))) public CashiersForTeller getCashierData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @QueryParam("fromdate") @Parameter(description = "fromdate") final String fromDateStr, @@ -152,6 +156,7 @@ public CashiersForTeller getCashierData(@PathParam("tellerId") @Parameter(descri @Path("{tellerId}/cashiers/{cashierId}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve a cashier", operationId = "retrieveOneCashierForTeller", description = "") + @AlternativeOperationId("findCashierData") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashierIdResponse.class))) public CashierData findCashierData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) { @@ -162,6 +167,7 @@ public CashierData findCashierData(@PathParam("tellerId") @Parameter(description @Path("{tellerId}/cashiers/template") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Find Cashiers", operationId = "retrieveCashierTemplateForTeller", description = "") + @AlternativeOperationId("getCashierTemplate") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersTemplateResponse.class))) public CashierData getCashierTemplate(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId) { @@ -183,6 +189,7 @@ public CashierData getCashierTemplate(@PathParam("tellerId") @Parameter(descript Optional Fields:\s Description/Notes""") + @AlternativeOperationId("createCashier") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class))) public CommandProcessingResult createCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @@ -198,6 +205,7 @@ public CommandProcessingResult createCashier(@PathParam("tellerId") @Parameter(d @Consumes({ MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Update Cashier", operationId = "updateCashierForTeller", description = "") + @AlternativeOperationId("updateCashier") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PutTellersTellerIdCashiersCashierIdResponse.class))) public CommandProcessingResult updateCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @@ -214,6 +222,7 @@ public CommandProcessingResult updateCashier(@PathParam("tellerId") @Parameter(d @Path("{tellerId}/cashiers/{cashierId}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Delete Cashier", operationId = "deleteCashierForTeller", description = "") + @AlternativeOperationId("deleteCashier") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.DeleteTellersTellerIdCashiersCashierIdResponse.class))) public CommandProcessingResult deleteCashier(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) { @@ -262,6 +271,7 @@ public CommandProcessingResult settleCashFromCashier(@PathParam("tellerId") @Par @Path("{tellerId}/cashiers/{cashierId}/transactions") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve Cashier Transactions", operationId = "retrieveCashierTransactions", description = "") + @AlternativeOperationId("getTransactionsForCashier") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsResponse.class))) public Page getTransactionsForCashier( @PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @@ -281,6 +291,7 @@ public Page getTransactionsForCashier( @Path("{tellerId}/cashiers/{cashierId}/summaryandtransactions") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve Transactions With Summary For Cashier", operationId = "retrieveCashierTransactionsWithSummary", description = "") + @AlternativeOperationId("getTransactionsWithSummaryForCashier") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdSummaryAndTransactionsResponse.class))) public CashierTransactionsWithSummaryData getTransactionsWithSummaryForCashier( @PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @@ -302,6 +313,7 @@ public CashierTransactionsWithSummaryData getTransactionsWithSummaryForCashier( @Path("{tellerId}/cashiers/{cashierId}/transactions/template") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve Cashier Transaction Template", operationId = "retrieveTemplateCashierTransaction", description = "") + @AlternativeOperationId("getCashierTxnTemplate") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.GetTellersTellerIdCashiersCashiersIdTransactionsTemplateResponse.class))) public CashierTransactionData getCashierTxnTemplate(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @PathParam("cashierId") @Parameter(description = "cashierId") final Long cashierId) { @@ -313,6 +325,7 @@ public CashierTransactionData getCashierTxnTemplate(@PathParam("tellerId") @Para @Path("{tellerId}/transactions") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List Teller Transactions", operationId = "retrieveAllTransactionsForTeller") + @AlternativeOperationId("getTransactionData") public Collection getTransactionData( @PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerId, @QueryParam("dateRange") @Parameter(description = "dateRange") final String dateRange) { @@ -326,6 +339,7 @@ public Collection getTransactionData( @Path("{tellerId}/transactions/{transactionId}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve Teller Transaction", operationId = "retrieveOneTransactionForTeller") + @AlternativeOperationId("findTransactionData") public TellerTransactionData findTransactionData(@PathParam("tellerId") @Parameter(description = "tellerId") final Long tellerid, @PathParam("transactionId") @Parameter(description = "transactionId") final Long transactionId) { return this.readPlatformService.findTellerTransaction(transactionId); @@ -335,6 +349,7 @@ public TellerTransactionData findTransactionData(@PathParam("tellerId") @Paramet @Path("{tellerId}/journals") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List Teller Journals", operationId = "retrieveAllJournalsForTeller") + @AlternativeOperationId("getJournalData") public Collection 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) { diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java index 6f28e5f6f2f..d6e7193ee97 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerJournalApiResource.java @@ -27,6 +27,7 @@ import jakarta.ws.rs.core.MediaType; import java.util.Collection; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.organisation.teller.data.TellerJournalData; import org.apache.fineract.organisation.teller.service.TellerManagementReadPlatformService; import org.apache.fineract.organisation.teller.util.DateRange; @@ -43,6 +44,7 @@ public class TellerJournalApiResource { @GET @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List Cashier Journals", operationId = "retrieveAllCashierJournals") + @AlternativeOperationId("getJournalData_1") public Collection getJournalData(@QueryParam("officeId") final Long officeId, @QueryParam("tellerId") final Long tellerId, @QueryParam("cashierId") final Long cashierId, @QueryParam("dateRange") final String dateRange) { diff --git a/fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java b/fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java index 81baa76d424..1caf2f8abfc 100644 --- a/fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java +++ b/fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/api/ChargesApiResource.java @@ -42,6 +42,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -93,6 +94,7 @@ public List retrieveAllCharges() { Example Requests: charges/1""") + @AlternativeOperationId("retrieveCharge") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ChargesApiResourceSwagger.GetChargesResponse.class))) public ChargeData retrieveCharge(@PathParam("chargeId") @Parameter(description = "chargeId") final Long chargeId, @Context final UriInfo uriInfo) { @@ -121,6 +123,7 @@ public ChargeData retrieveCharge(@PathParam("chargeId") @Parameter(description = charges/template """) + @AlternativeOperationId("retrieveNewChargeDetails") public ChargeData retrieveNewChargeDetails(@QueryParam("chargeAppliesTo") Long chargeAppliesTo, @QueryParam("chargeTimeType") Long chargeTimeType) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); diff --git a/fineract-client-feign/src/main/resources/templates/java/api.mustache b/fineract-client-feign/src/main/resources/templates/java/api.mustache index 47f42a52442..093f713d55f 100644 --- a/fineract-client-feign/src/main/resources/templates/java/api.mustache +++ b/fineract-client-feign/src/main/resources/templates/java/api.mustache @@ -103,6 +103,38 @@ public interface {{classname}} { }) ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/allParams}}@HeaderMap Map headers); +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}}. + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map headers) { + {{#returnType}}return {{/returnType}}{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}headers); + } + + /** + * {{summary}} + * Alias for {{operationId}} with empty headers. + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + {{#returnType}}return {{/returnType}}{{nickname}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + + /** + * {{summary}} + * Alias for {{operationId}}WithHttpInfo. + * @deprecated Use {{operationId}}WithHttpInfo instead. + */ + @Deprecated + default ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{vendorExtensions.x-alternative-operation-id}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map headers) { + return {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}headers); + } + +{{/vendorExtensions.x-alternative-operation-id}} {{#hasQueryParams}} /** @@ -257,6 +289,58 @@ public interface {{classname}} { }) ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams, @HeaderMap Map headers); +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}} using typed query parameters. + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}{{operationIdCamelCase}}QueryParams queryParams, Map headers) { + {{#returnType}}return {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams, headers); + } + + /** + * {{summary}} + * Alias for {{operationId}} using typed query parameters and empty headers. + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}{{operationIdCamelCase}}QueryParams queryParams) { + {{#returnType}}return {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); + } + + /** + * {{summary}} + * Alias for {{operationId}} using generic query parameters. + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}Map queryParams, Map headers) { + {{#returnType}}return {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams, headers); + } + + /** + * {{summary}} + * Alias for {{operationId}} using generic query parameters and empty headers. + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}Map queryParams) { + {{#returnType}}return {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); + } + + /** + * {{summary}} + * Alias for {{operationId}}WithHttpInfo using typed query parameters. + * @deprecated Use {{operationId}}WithHttpInfo instead. + */ + @Deprecated + default ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{vendorExtensions.x-alternative-operation-id}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}{{operationIdCamelCase}}QueryParams queryParams, Map headers) { + return {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams, headers); + } + +{{/vendorExtensions.x-alternative-operation-id}} /** * A convenience class for generating query parameters for the @@ -321,6 +405,29 @@ public interface {{classname}} { {{#returnType}}return {{/returnType}}{{nickname}}Universal({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams, Map.of()); } +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}}Universal. + * @deprecated Use {{operationId}}Universal instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}Universal({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}Map queryParams, Map headers) { + {{#returnType}}return {{/returnType}}{{nickname}}Universal({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams, headers); + } + + /** + * {{summary}} + * Alias for {{operationId}}Universal with empty headers. + * @deprecated Use {{operationId}}Universal instead. + */ + @Deprecated + default {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{vendorExtensions.x-alternative-operation-id}}Universal({{#allParams}}{{^isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}Map queryParams) { + {{#returnType}}return {{/returnType}}{{nickname}}Universal({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); + } + +{{/vendorExtensions.x-alternative-operation-id}} + {{/operation}} {{/operations}} } diff --git a/fineract-client/src/main/resources/templates/java/api.mustache b/fineract-client/src/main/resources/templates/java/api.mustache index e16793e38de..4a5a691470b 100644 --- a/fineract-client/src/main/resources/templates/java/api.mustache +++ b/fineract-client/src/main/resources/templates/java/api.mustache @@ -73,6 +73,36 @@ public interface {{classname}} { @{{httpMethod}}("{{{path}}}") {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}});{{/-last}}{{/allParams}} +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}}. + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + {{#formParams}} + {{#-first}} + {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}} + {{/-first}} + {{/formParams}} + {{^formParams}} + {{#prioritizedContentTypes}} + {{#-first}} + @Headers({ + "Content-Type:{{{mediaType}}}" + }) + {{/-first}} + {{/prioritizedContentTypes}} + {{/formParams}} + @{{httpMethod}}("{{{path}}}") + {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{vendorExtensions.x-alternative-operation-id}}({{^allParams}});{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}});{{/-last}}{{/allParams}} + +{{/vendorExtensions.x-alternative-operation-id}} + {{/operation}} {{#operation}} @@ -113,6 +143,35 @@ public interface {{classname}} { {{/formParams}} @{{httpMethod}}("{{{path}}}") {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}});{{/-last}}{{/allParams}} +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}}. + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + {{#formParams}} + {{#-first}} + {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}} + {{/-first}} + {{/formParams}} + {{^formParams}} + {{#prioritizedContentTypes}} + {{#-first}} + @Headers({ + "Content-Type:{{{mediaType}}}" + }) + {{/-first}} + {{/prioritizedContentTypes}} + {{/formParams}} + @{{httpMethod}}("{{{path}}}") + {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{vendorExtensions.x-alternative-operation-id}}({{^allParams}});{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}});{{/-last}}{{/allParams}} + +{{/vendorExtensions.x-alternative-operation-id}} {{/required}} {{/isBodyParam}} {{/allParams}} @@ -154,6 +213,37 @@ public interface {{classname}} { @{{httpMethod}}("{{{path}}}") {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}}@HeaderMap Map headers);{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}{{^first}}, {{/first}}@HeaderMap Map headers);{{/-last}}{{/allParams}} +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}} with request headers. + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param headers Custom headers to include in the request + * @return {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + {{#formParams}} + {{#-first}} + {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}} + {{/-first}} + {{/formParams}} + {{^formParams}} + {{#prioritizedContentTypes}} + {{#-first}} + @Headers({ + "Content-Type:{{{mediaType}}}" + }) + {{/-first}} + {{/prioritizedContentTypes}} + {{/formParams}} + @{{httpMethod}}("{{{path}}}") + {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{vendorExtensions.x-alternative-operation-id}}({{^allParams}}@HeaderMap Map headers);{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}{{^first}}, {{/first}}@HeaderMap Map headers);{{/-last}}{{/allParams}} + +{{/vendorExtensions.x-alternative-operation-id}} + {{/operation}} {{#operation}} @@ -194,9 +284,39 @@ public interface {{classname}} { {{/formParams}} @{{httpMethod}}("{{{path}}}") {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}}@HeaderMap Map headers);{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}{{^first}}, {{/first}}@HeaderMap Map headers);{{/-last}}{{/allParams}} +{{#vendorExtensions.x-alternative-operation-id}} + /** + * {{summary}} + * Alias for {{operationId}} with request headers. + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param headers Custom headers to include in the request + * @return {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @deprecated Use {{operationId}} instead. + */ + @Deprecated + {{#formParams}} + {{#-first}} + {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}} + {{/-first}} + {{/formParams}} + {{^formParams}} + {{#prioritizedContentTypes}} + {{#-first}} + @Headers({ + "Content-Type:{{{mediaType}}}" + }) + {{/-first}} + {{/prioritizedContentTypes}} + {{/formParams}} + @{{httpMethod}}("{{{path}}}") + {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{vendorExtensions.x-alternative-operation-id}}({{^allParams}}@HeaderMap Map headers);{{/allParams}}{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}{{^first}}, {{/first}}@HeaderMap Map headers);{{/-last}}{{/allParams}} + +{{/vendorExtensions.x-alternative-operation-id}} {{/required}} {{/isBodyParam}} {{/allParams}} {{/operation}} } -{{/operations}} \ No newline at end of file +{{/operations}} diff --git a/fineract-core/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java b/fineract-core/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java index 442cb8b6eb3..3f3d5452ac4 100644 --- a/fineract-core/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java +++ b/fineract-core/src/main/java/org/apache/fineract/infrastructure/cache/api/CacheApiResource.java @@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.cache.data.CacheSwitchRequest; import org.apache.fineract.infrastructure.cache.data.CacheSwitchResponse; import org.apache.fineract.infrastructure.cache.service.RuntimeDelegatingCacheManager; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -59,13 +60,14 @@ public class CacheApiResource { private final CommandDispatcher dispatcher; @GET - @Operation(summary = "Retrieve Cache Types", description = """ + @Operation(operationId = "retrieveAll_2", summary = "Retrieve Cache Types", description = """ Returns the list of caches. Example Requests: caches """) + @AlternativeOperationId("retrieveAll_4") public Collection retrieveAll() { return cacheService.retrieveAll(); } diff --git a/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/annotation/AlternativeOperationId.java b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/annotation/AlternativeOperationId.java new file mode 100644 index 00000000000..585ada42491 --- /dev/null +++ b/fineract-core/src/main/java/org/apache/fineract/infrastructure/core/annotation/AlternativeOperationId.java @@ -0,0 +1,39 @@ +/** + * 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.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Adds an alternate generated client method name for an OpenAPI operation. + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface AlternativeOperationId { + + /** + * Java method name to generate as an alias for the Swagger {@code operationId}. + * + * @return the alternate operation ID + */ + String value(); +} diff --git a/fineract-core/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java b/fineract-core/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java index 0d649535a0f..79a9c8b5e50 100644 --- a/fineract-core/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java +++ b/fineract-core/src/main/java/org/apache/fineract/portfolio/paymenttype/api/PaymentTypeApiResource.java @@ -34,6 +34,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.portfolio.paymenttype.command.PaymentTypeCreateCommand; import org.apache.fineract.portfolio.paymenttype.command.PaymentTypeDeleteCommand; @@ -110,6 +111,7 @@ public PaymentTypeUpdateResponse updatePaymentType(@PathParam("paymentTypeId") f @Path("{paymentTypeId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Payment Type", operationId = "deleteCodePaymentType", description = "Deletes payment type") + @AlternativeOperationId("deleteCode_1") public PaymentTypeDeleteResponse deleteCode(@PathParam("paymentTypeId") final Long paymentTypeId) { final var command = new PaymentTypeDeleteCommand(); diff --git a/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnerLoanProductAttributesApiResource.java b/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnerLoanProductAttributesApiResource.java index 8f4946eecae..a124b10bbe3 100644 --- a/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnerLoanProductAttributesApiResource.java +++ b/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnerLoanProductAttributesApiResource.java @@ -39,6 +39,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.service.Page; import org.apache.fineract.infrastructure.security.service.PlatformUserRightsContext; @@ -64,6 +65,7 @@ public class ExternalAssetOwnerLoanProductAttributesApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create External Asset Owner Loan Product Attribute", operationId = "createExternalAssetOwnerLoanProductAttribute") + @AlternativeOperationId("postExternalAssetOwnerLoanProductAttribute") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ExternalAssetOwnerLoanProductAttributesApiResourceSwagger.PostExternalAssetOwnerLoanProductAttributeRequest.class))) public CommandProcessingResult postExternalAssetOwnerLoanProductAttribute( @PathParam("loanProductId") @Parameter(description = "loanProductId") final Long loanProductId, @@ -82,6 +84,7 @@ public CommandProcessingResult postExternalAssetOwnerLoanProductAttribute( "External Asset Owner Loan Product Attributes" }, summary = "Retrieve All Loan Product Attributes", operationId = "retrieveAllExternalAssetOwnerLoanProductAttributes", description = "Retrieves all Loan Product Attributes with a given loanProductId", parameters = { @Parameter(name = "loanProductId", description = "loanProductId"), @Parameter(name = "attributeKey", description = "attributeKey") }) + @AlternativeOperationId("getExternalAssetOwnerLoanProductAttributes") public Page getExternalAssetOwnerLoanProductAttributes(@Context final UriInfo uriInfo, @PathParam("loanProductId") @Parameter(description = "loanProductId") final Long loanProductId, @QueryParam("attributeKey") @Parameter(description = "attributeKey") final String attributeKey) { @@ -100,6 +103,7 @@ public Page getExternalAssetOwnerLoan "External Asset Owner Loan Product Attributes" }, summary = "Update a Loan Product Attribute", operationId = "updateExternalAssetOwnerLoanProductAttribute", description = "Updates a loan product attribute with a given loan product id and attribute id", parameters = { @Parameter(name = "loanProductId", description = "loanProductId"), @Parameter(name = "attributeId", description = "attributeId") }) + @AlternativeOperationId("updateLoanProductAttribute") public CommandProcessingResult updateLoanProductAttribute( @PathParam("loanProductId") @Parameter(description = "loanProductId") final Long loanProductId, @PathParam("id") @Parameter(description = "attributeId") final Long attributeId, diff --git a/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnersApiResource.java b/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnersApiResource.java index 9f0a91564a0..8c3975f577e 100644 --- a/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnersApiResource.java +++ b/fineract-investor/src/main/java/org/apache/fineract/investor/api/ExternalAssetOwnersApiResource.java @@ -46,6 +46,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.domain.ExternalId; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; @@ -147,6 +148,7 @@ public CommandProcessingResult transferRequestWithId(@PathParam("id") final Long @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Transfer external asset by external ID", operationId = "transferRequestWithIdByExternalId") + @AlternativeOperationId("transferRequestWithId_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalAssetOwnersApiResourceSwagger.PostInitiateTransferResponse.class))) @ApiResponse(responseCode = "403", description = "Transfer cannot be initiated") public CommandProcessingResult transferRequestWithId(@PathParam("externalId") final String externalId, diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/api/DelinquencyApiResource.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/api/DelinquencyApiResource.java index 16bd8cd9874..887a45b935d 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/api/DelinquencyApiResource.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/api/DelinquencyApiResource.java @@ -41,6 +41,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.StringEnumOptionData; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -72,6 +73,7 @@ public class DelinquencyApiResource { @Path("ranges") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List all Delinquency Ranges", description = "", operationId = "getRanges") + @AlternativeOperationId("getDelinquencyRanges") public List getDelinquencyRanges() { securityContext.authenticatedUser().validateHasReadPermission(DELINQUENCY_BUCKET); return delinquencyResponseMapper.mapRange(this.readPlatformService.retrieveAllDelinquencyRanges()); @@ -81,6 +83,7 @@ public List getDelinquencyRanges() { @Path("ranges/{delinquencyRangeId}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve a specific Delinquency Range based on the Id", description = "", operationId = "getRange") + @AlternativeOperationId("getDelinquencyRange") public DelinquencyRangeResponse getDelinquencyRange( @PathParam("delinquencyRangeId") @Parameter(description = "delinquencyRangeId") final Long delinquencyRangeId) { securityContext.authenticatedUser().validateHasReadPermission(DELINQUENCY_BUCKET); @@ -92,6 +95,7 @@ public DelinquencyRangeResponse getDelinquencyRange( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create Delinquency Range", description = "", operationId = "createRange") + @AlternativeOperationId("createDelinquencyRange") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DelinquencyRangeRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PostDelinquencyRangeResponse.class))) public CommandProcessingResult createDelinquencyRange(final DelinquencyRangeRequest delinquencyRangeRequest) { @@ -107,6 +111,7 @@ public CommandProcessingResult createDelinquencyRange(final DelinquencyRangeRequ @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Delinquency Range based on the Id", description = "", operationId = "updateRange") + @AlternativeOperationId("updateDelinquencyRange") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DelinquencyRangeRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PutDelinquencyRangeResponse.class))) public CommandProcessingResult updateDelinquencyRange( @@ -123,6 +128,7 @@ public CommandProcessingResult updateDelinquencyRange( @Path("ranges/{delinquencyRangeId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Delinquency Range based on the Id", description = "", operationId = "deleteRange") + @AlternativeOperationId("deleteDelinquencyRange") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.DeleteDelinquencyRangeResponse.class))) public CommandProcessingResult deleteDelinquencyRange( @PathParam("delinquencyRangeId") @Parameter(description = "delinquencyRangeId") final Long delinquencyRangeId) { @@ -145,6 +151,7 @@ public DelinquencyBucketTemplateResponse getTemplate() { @Path("buckets") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "List all Delinquency Buckets", description = "", operationId = "getBuckets") + @AlternativeOperationId("getDelinquencyBuckets") public List getDelinquencyBuckets() { securityContext.authenticatedUser().validateHasReadPermission(DELINQUENCY_BUCKET); return delinquencyResponseMapper.mapBucket(this.readPlatformService.retrieveAllDelinquencyBuckets()); @@ -154,6 +161,7 @@ public List getDelinquencyBuckets() { @Path("buckets/{delinquencyBucketId}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve a specific Delinquency Bucket based on the Id", description = "", operationId = "getBucket") + @AlternativeOperationId("getDelinquencyBucket") public DelinquencyBucketResponse getDelinquencyBucket( @PathParam("delinquencyBucketId") @Parameter(description = "delinquencyBucketId") final Long delinquencyBucketId, @Context final UriInfo uriInfo) { @@ -177,6 +185,7 @@ private DelinquencyBucketTemplateResponse handleTemplate() { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create Delinquency Bucket", description = "", operationId = "createBucket") + @AlternativeOperationId("createDelinquencyBucket") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DelinquencyBucketRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PostDelinquencyBucketResponse.class))) @@ -193,6 +202,7 @@ public CommandProcessingResult createDelinquencyBucket(final DelinquencyBucketRe @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Delinquency Bucket based on the Id", description = "", operationId = "updateBucket") + @AlternativeOperationId("updateDelinquencyBucket") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DelinquencyBucketRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PutDelinquencyBucketResponse.class))) @@ -210,6 +220,7 @@ public CommandProcessingResult updateDelinquencyBucket( @Path("buckets/{delinquencyBucketId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete Delinquency Bucket based on the Id", description = "", operationId = "deleteBucket") + @AlternativeOperationId("deleteDelinquencyBucket") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.DeleteDelinquencyBucketResponse.class))) public CommandProcessingResult deleteDelinquencyBucket( diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/api/LoanInterestPauseApiResource.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/api/LoanInterestPauseApiResource.java index a24dd216088..b277bb63c4f 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/api/LoanInterestPauseApiResource.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/api/LoanInterestPauseApiResource.java @@ -41,6 +41,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.interestpauses.data.InterestPauseRequestDto; @@ -66,6 +67,7 @@ public class LoanInterestPauseApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a new interest pause period for a loan", operationId = "createLoanInterestPause", description = "Allows users to define a period during which no interest will be accrued for a specific loan.") + @AlternativeOperationId("createInterestPause") @ApiResponse(responseCode = "200", description = "Command successfully processed", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult createInterestPause(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @RequestBody(required = true) final InterestPauseRequestDto request) { @@ -82,6 +84,7 @@ public CommandProcessingResult createInterestPause(@PathParam("loanId") @Paramet @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a new interest pause for a loan using external ID", operationId = "createLoanInterestPauseByExternalId", description = "Allows users to define a period during which no interest will be accrued for a specific loan using the external loan ID.") + @AlternativeOperationId("createInterestPauseByExternalId") @ApiResponse(responseCode = "200", description = "Command successfully processed", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult createInterestPauseByExternalId( @PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -99,6 +102,7 @@ public CommandProcessingResult createInterestPauseByExternalId( @Path("/{loanId}/interest-pauses") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve all interest pause periods for a loan", operationId = "retrieveAllLoanInterestPauses", description = "Fetches a list of all active interest pause periods for a specific loan.") + @AlternativeOperationId("retrieveInterestPauses") @ApiResponse(responseCode = "200", description = "List of interest pause periods", content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterestPauseResponseDto.class)))) public List retrieveInterestPauses( @PathParam("loanId") @Parameter(description = "loanId") final Long loanId) { @@ -112,6 +116,7 @@ public List retrieveInterestPauses( @Path("/external-id/{loanExternalId}/interest-pauses") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve all interest pause periods for a loan using external ID", operationId = "retrieveAllLoanInterestPausesByExternalId", description = "Fetches a list of all active interest pause periods for a specific loan using the external loan ID.") + @AlternativeOperationId("retrieveInterestPausesByExternalId") @ApiResponse(responseCode = "200", description = "List of interest pause periods", content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterestPauseResponseDto.class)))) public List retrieveInterestPausesByExternalId( @PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId) { @@ -124,6 +129,7 @@ public List retrieveInterestPausesByExternalId( @DELETE @Path("/{loanId}/interest-pauses/{variationId}") @Operation(summary = "Delete an interest pause period", operationId = "deleteLoanInterestPause", description = "Deletes a specific interest pause period by its variation ID.") + @AlternativeOperationId("deleteInterestPause") @ApiResponse(responseCode = "204", description = "No Content") public Response deleteInterestPause(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @PathParam("variationId") @Parameter(description = "variationId") final Long variationId) { @@ -140,6 +146,7 @@ public Response deleteInterestPause(@PathParam("loanId") @Parameter(description @DELETE @Path("/external-id/{loanExternalId}/interest-pauses/{variationId}") @Operation(summary = "Delete an interest pause period by external id", operationId = "deleteLoanInterestPauseByExternalId", description = "Deletes a specific interest pause period by its variation ID.") + @AlternativeOperationId("deleteInterestPauseByExternalId") @ApiResponse(responseCode = "204", description = "No Content") public Response deleteInterestPauseByExternalId( @PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -159,6 +166,7 @@ public Response deleteInterestPauseByExternalId( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update an interest pause period", operationId = "updateLoanInterestPause", description = "Updates a specific interest pause period by its variation ID.") + @AlternativeOperationId("updateInterestPause") @ApiResponse(responseCode = "200", description = "Command successfully processed", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult updateInterestPause(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @PathParam("variationId") @Parameter(description = "variationId") final Long variationId, @@ -177,6 +185,7 @@ public CommandProcessingResult updateInterestPause(@PathParam("loanId") @Paramet @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update an interest pause period by external id", operationId = "updateLoanInterestPauseByExternalId", description = "Updates a specific interest pause period by its variation ID.") + @AlternativeOperationId("updateInterestPauseByExternalId") @ApiResponse(responseCode = "200", description = "Command successfully processed", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult updateInterestPauseByExternalId( @PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java index 6dcd948d72d..f95d3672f42 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanScheduleApiResource.java @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -70,6 +71,7 @@ public class LoanScheduleApiResource { + "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'") + @AlternativeOperationId("calculateLoanScheduleOrSubmitVariableSchedule") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanScheduleApiResourceSwagger.PostLoansLoanIdScheduleRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanScheduleApiResourceSwagger.PostLoansLoanIdScheduleResponse.class))) public String calculateLoanScheduleOrSubmitVariableSchedule(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java index 14bd09cb5cc..afc1346bacb 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/api/RescheduleLoansApiResource.java @@ -42,6 +42,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; @@ -74,6 +75,7 @@ public class RescheduleLoansApiResource { @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve all reschedule loan reasons", operationId = "retrieveAllRescheduleLoanReasons", description = "Retrieve all reschedule loan reasons as a template") + @AlternativeOperationId("retrieveTemplate_10") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.GetRescheduleReasonsTemplateResponse.class))) public String retrieveTemplate(@Context final UriInfo uriInfo) { @@ -90,6 +92,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo) { @Path("{scheduleId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve loan reschedule request by schedule id", operationId = "retrieveOneRescheduleLoan", description = "Retrieve loan reschedule request by schedule id") + @AlternativeOperationId("readLoanRescheduleRequest") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse.class))) public String readLoanRescheduleRequest(@Context final UriInfo uriInfo, @PathParam("scheduleId") final Long scheduleId, @QueryParam("command") final String command) { @@ -113,6 +116,7 @@ public String readLoanRescheduleRequest(@Context final UriInfo uriInfo, @PathPar @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create loan reschedule request", operationId = "createRescheduleLoan", description = "Create a loan reschedule request.") + @AlternativeOperationId("createLoanRescheduleRequest") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.PostCreateRescheduleLoansRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.PostCreateRescheduleLoansResponse.class))) public String createLoanRescheduleRequest(final String apiRequestBodyAsJson) { @@ -129,6 +133,7 @@ public String createLoanRescheduleRequest(final String apiRequestBodyAsJson) { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update loan reschedule request", operationId = "updateRescheduleLoan", description = "Update a loan reschedule request by either approving/rejecting it.") + @AlternativeOperationId("updateLoanRescheduleRequest") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.PostUpdateRescheduleLoansRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.PostUpdateRescheduleLoansResponse.class))) public String updateLoanRescheduleRequest(@PathParam("scheduleId") final Long scheduleId, @QueryParam("command") final String command, @@ -170,6 +175,7 @@ private boolean compareIgnoreCase(String firstString, String secondString) { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve all reschedule requests", operationId = "retrieveAllRescheduleLoans", description = "Retrieve all reschedule requests.") + @AlternativeOperationId("retrieveAllRescheduleRequest") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = RescheduleLoansApiResourceSwagger.GetLoanRescheduleRequestResponse.class)))) public String retrieveAllRescheduleRequest(@Context final UriInfo uriInfo, @QueryParam("command") final String command, @QueryParam("loanId") Long loanId) { diff --git a/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java b/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java index 8e876b8de63..89d48356606 100644 --- a/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java +++ b/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java @@ -27,6 +27,7 @@ import jakarta.ws.rs.core.MediaType; import java.sql.Date; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.mix.service.MixReportXBRLBuilder; import org.apache.fineract.mix.service.MixReportXBRLResultService; import org.springframework.stereotype.Component; @@ -44,6 +45,7 @@ public class MixReportApiResource { @GET @Produces({ MediaType.APPLICATION_XML }) @Operation(summary = "Retrieve Mix XBRL report", operationId = "retrieveMixReport") + @AlternativeOperationId("retrieveXBRLReport") public String retrieveXBRLReport(@QueryParam("startDate") final Date startDate, @QueryParam("endDate") final Date endDate, @QueryParam("currency") final String currency) { diff --git a/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java b/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java index 3d1166c6895..250bd3fc840 100644 --- a/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java +++ b/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyApiResource.java @@ -26,6 +26,7 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.mix.data.MixTaxonomyData; import org.apache.fineract.mix.service.MixTaxonomyReadService; import org.springframework.stereotype.Component; @@ -41,6 +42,7 @@ public class MixTaxonomyApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Mix Taxonomies", operationId = "retrieveAllMixTaxonomies") + @AlternativeOperationId("retrieveAll_14") public List retrieveAll() { return readTaxonomyService.retrieveAll(); } diff --git a/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java b/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java index 7fa833f4ca8..1285a7e50c1 100644 --- a/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java +++ b/fineract-mix/src/main/java/org/apache/fineract/mix/api/MixTaxonomyMappingApiResource.java @@ -29,6 +29,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.mix.command.MixTaxonomyMappingUpdateCommand; import org.apache.fineract.mix.data.MixTaxonomyMappingData; import org.apache.fineract.mix.data.MixTaxonomyMappingUpdateRequest; @@ -48,6 +49,7 @@ public class MixTaxonomyMappingApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Mix Taxonomy Mapping", operationId = "retrieveMixTaxonomyMapping") + @AlternativeOperationId("retrieveTaxonomyMapping") public MixTaxonomyMappingData retrieveTaxonomyMapping() { return this.readTaxonomyMappingService.retrieveTaxonomyMapping(); } @@ -56,6 +58,7 @@ public MixTaxonomyMappingData retrieveTaxonomyMapping() { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Mix Taxonomy Mapping", operationId = "updateMixTaxonomyMapping") + @AlternativeOperationId("updateTaxonomyMapping") public MixTaxonomyMappingUpdateResponse updateTaxonomyMapping(final MixTaxonomyMappingUpdateRequest request) { // TODO support multiple configuration file loading; this is the legacy behavior if (request.getId() == null) { diff --git a/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/InternalProgressiveLoanApiResource.java b/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/InternalProgressiveLoanApiResource.java index 929a47c1cff..12b19bf6bb6 100644 --- a/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/InternalProgressiveLoanApiResource.java +++ b/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/InternalProgressiveLoanApiResource.java @@ -31,6 +31,7 @@ import jakarta.ws.rs.core.MediaType; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.boot.FineractProfiles; import org.apache.fineract.portfolio.loanaccount.domain.Loan; import org.apache.fineract.portfolio.loanaccount.domain.LoanRepositoryWrapper; @@ -71,6 +72,7 @@ public void afterPropertiesSet() throws Exception { @Produces({ MediaType.APPLICATION_JSON }) @Path("{loanId}/model") @Operation(summary = "Fetch ProgressiveLoanInterestScheduleModel", operationId = "retrieveOneInternalProgressiveLoan", description = "DO NOT USE THIS IN PRODUCTION!") + @AlternativeOperationId("fetchModel") public ProgressiveLoanInterestScheduleModel fetchModel(@PathParam("loanId") @Parameter(description = "loanId") long loanId) { Loan loan = loanRepository.findOneWithNotFoundDetection(loanId); if (!loan.isProgressiveSchedule()) { @@ -90,6 +92,7 @@ private ProgressiveLoanInterestScheduleModel reprocessTransactionsAndGetModel(fi @Path("{loanId}/model") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update and Save ProgressiveLoanInterestScheduleModel", operationId = "updateInternalProgressiveLoan", description = "DO NOT USE THIS IN PRODUCTION!") + @AlternativeOperationId("updateModel") @Transactional public ProgressiveLoanInterestScheduleModel updateModel(@PathParam("loanId") @Parameter(description = "loanId") long loanId) { Loan loan = loanRepository.findOneWithNotFoundDetection(loanId); 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 dde8c0483f3..a8aaa9e655a 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 @@ -54,6 +54,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.DateParam; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -106,6 +107,7 @@ public class JournalEntriesApiResource { + "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") + @AlternativeOperationId("retrieveAll_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.GetJournalEntriesTransactionIdResponse.class))) public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, 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 9b01321dd4b..3dc2b3b7f68 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,6 +18,7 @@ */ package org.apache.fineract.adhocquery.api; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.Consumes; @@ -40,6 +41,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -64,6 +66,8 @@ public class AdHocApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveAll_1") + @AlternativeOperationId("retrieveAll_2") public List retrieveAll() { this.context.authenticatedUser(); 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 078cf5d244f..e835e30899d 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 @@ -49,6 +49,7 @@ import org.apache.fineract.infrastructure.accountnumberformat.domain.EntityAccountType; import org.apache.fineract.infrastructure.accountnumberformat.service.AccountNumberFormatConstants; import org.apache.fineract.infrastructure.accountnumberformat.service.AccountNumberFormatReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -77,6 +78,7 @@ public class AccountNumberFormatsApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Account number format Template", operationId = "retrieveTemplateAccountNumberFormat", 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") + @AlternativeOperationId("retrieveTemplate_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsResponseTemplate.class))) public String retrieveTemplate(@Context final UriInfo uriInfo) { @@ -93,6 +95,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo) { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Account number formats", operationId = "retrieveAllAccountNumberFormats", description = "Example Requests:\n" + "\n" + "accountnumberformats\n" + "\n" + "\n" + "accountnumberformats?fields=accountType,prefixType") + @AlternativeOperationId("retrieveAll_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class)))) public String retrieveAll(@Context final UriInfo uriInfo) { @@ -111,6 +114,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @Operation(summary = "Retrieve an Account number format", operationId = "retrieveOneAccountNumberFormat", description = "Example Requests:\n" + "\n" + "accountnumberformats/1\n" + "\n" + "\n" + "accountnumberformats/1?template=true\n" + "\n" + "\n" + "accountnumberformats/1?fields=accountType,prefixType") + @AlternativeOperationId("retrieveOne") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.GetAccountNumberFormatsIdResponse.class))) public String retrieveOne(@Context final UriInfo uriInfo, @PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId) { @@ -135,6 +139,7 @@ public String retrieveOne(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create an Account number format", operationId = "createAccountNumberFormat", description = "Note: You may associate a single Account number format for a given account type\n" + "Mandatory Fields for Account number formats\n" + "accountType") + @AlternativeOperationId("create") @RequestBody(content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PostAccountNumberFormatsResponse.class))) public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -154,6 +159,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update an Account number format", operationId = "updateAccountNumberFormat") + @AlternativeOperationId("update_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.PutAccountNumberFormatsResponse.class))) public String update( @@ -174,6 +180,7 @@ public String update( @Path("{accountNumberFormatId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete an Account number format", operationId = "deleteAccountNumberFormat", description = "Note: Account numbers created while this format was active would remain unchanged.") + @AlternativeOperationId("delete") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountNumberFormatsApiResourceSwagger.DeleteAccountNumberFormatsResponse.class))) public String delete( @PathParam("accountNumberFormatId") @Parameter(description = "accountNumberFormatId") final Long accountNumberFormatId) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java index f301496b02b..8271e1af43a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java @@ -40,6 +40,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.campaigns.email.data.EmailData; import org.apache.fineract.infrastructure.campaigns.email.service.EmailReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.DateParam; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -155,6 +156,7 @@ public String retrieveFailedEmail(@QueryParam("offset") final Integer offset, @Q @POST @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create an email message", operationId = "createEmail") + @AlternativeOperationId("create_1") public String create(final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createEmail().withJson(apiRequestBodyAsJson).build(); @@ -167,6 +169,7 @@ public String create(final String apiRequestBodyAsJson) { @GET @Path("{resourceId}") @Operation(summary = "Retrieve an email message", operationId = "retrieveOneEmail") + @AlternativeOperationId("retrieveOne_1") public String retrieveOne(@PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) { final EmailData emailMessage = readPlatformService.retrieveOne(resourceId); @@ -179,6 +182,7 @@ public String retrieveOne(@PathParam("resourceId") final Long resourceId, @Conte @Path("{resourceId}") @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update an email message", operationId = "updateEmail") + @AlternativeOperationId("update_2") public String update(@PathParam("resourceId") final Long resourceId, final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateEmail(resourceId).withJson(apiRequestBodyAsJson).build(); @@ -191,6 +195,7 @@ public String update(@PathParam("resourceId") final Long resourceId, final Strin @DELETE @Path("{resourceId}") @Operation(summary = "Delete an email message", operationId = "deleteEmail") + @AlternativeOperationId("delete_1") public String delete(@PathParam("resourceId") final Long resourceId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteEmail(resourceId).build(); 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 fc3a81ca54f..3c66c71b151 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 @@ -44,6 +44,7 @@ import org.apache.fineract.infrastructure.campaigns.email.data.PreviewCampaignMessage; import org.apache.fineract.infrastructure.campaigns.email.service.EmailCampaignReadPlatformService; import org.apache.fineract.infrastructure.campaigns.email.service.EmailCampaignWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.JsonQuery; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -84,6 +85,7 @@ public class EmailCampaignApiResource { @Path("{resourceId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve an email campaign", operationId = "retrieveOneEmailCampaign") + @AlternativeOperationId("retrieveOneCampaign") public String retrieveOneCampaign(@PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -96,6 +98,7 @@ public String retrieveOneCampaign(@PathParam("resourceId") final Long resourceId @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List all email campaigns", operationId = "retrieveAllEmailCampaigns") + @AlternativeOperationId("retrieveAllCampaign") public String retrieveAllCampaign(@Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -110,6 +113,7 @@ public String retrieveAllCampaign(@Context final UriInfo uriInfo) { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create an email campaign", operationId = "createEmailCampaign") + @AlternativeOperationId("createCampaign") public String createCampaign(final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createEmailCampaign().withJson(apiRequestBodyAsJson).build(); @@ -124,6 +128,7 @@ public String createCampaign(final String apiRequestBodyAsJson, @Context final U @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update an email campaign", operationId = "updateEmailCampaign") + @AlternativeOperationId("updateCampaign") public String updateCampaign(@PathParam("resourceId") final Long campaignId, final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { @@ -140,6 +145,7 @@ public String updateCampaign(@PathParam("resourceId") final Long campaignId, fin @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Activate, close, or reactivate an email campaign", operationId = "handleCommandsEmailCampaign") + @AlternativeOperationId("activate") public String activate(@PathParam("resourceId") final Long campaignId, @QueryParam("command") final String commandParam, final String apiRequestBodyAsJson) { final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson); @@ -164,6 +170,7 @@ public String activate(@PathParam("resourceId") final Long campaignId, @QueryPar @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Preview email campaign message", operationId = "previewEmailCampaign") + @AlternativeOperationId("preview") public String preview(final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -179,6 +186,7 @@ public String preview(final String apiRequestBodyAsJson, @Context final UriInfo @GET @Path("template") @Operation(summary = "Retrieve email campaign template", operationId = "retrieveAllTemplatesEmailCampaign") + @AlternativeOperationId("template_1") public String template(@Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -191,6 +199,7 @@ public String template(@Context final UriInfo uriInfo) { @GET @Path("template/{resourceId}") @Operation(summary = "Retrieve an email campaign template detail by ID", operationId = "retrieveOneTemplateEmailCampaign") + @AlternativeOperationId("retrieveOneTemplate") public String retrieveOneTemplate(@PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -203,6 +212,7 @@ public String retrieveOneTemplate(@PathParam("resourceId") final Long resourceId @DELETE @Path("{resourceId}") @Operation(summary = "Delete an email campaign", operationId = "deleteEmailCampaign") + @AlternativeOperationId("delete_2") public String delete(@PathParam("resourceId") final Long resourceId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteEmailCampaign(resourceId).build(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailConfigurationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailConfigurationApiResource.java index b46afec56d8..a28e0170ff5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailConfigurationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailConfigurationApiResource.java @@ -34,6 +34,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.campaigns.email.data.EmailConfigurationData; import org.apache.fineract.infrastructure.campaigns.email.service.EmailConfigurationReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -56,6 +57,7 @@ public class EmailConfigurationApiResource { @GET @Operation(summary = "List all email configurations", operationId = "retrieveAllEmailConfigurations") + @AlternativeOperationId("retrieveAll_5") public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -69,6 +71,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @PUT @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update email configuration", operationId = "updateEmailConfiguration") + @AlternativeOperationId("updateConfiguration") public String updateConfiguration(@Context final UriInfo uriInfo, final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateEmailConfiguration().withJson(apiRequestBodyAsJson).build(); 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 c5b566034ac..491eb8895bf 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 @@ -54,6 +54,7 @@ import org.apache.fineract.infrastructure.campaigns.sms.data.dto.SmsCampaignUpdateDto; import org.apache.fineract.infrastructure.campaigns.sms.service.SmsCampaignReadPlatformService; import org.apache.fineract.infrastructure.campaigns.sms.service.SmsCampaignWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.JsonQuery; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -90,6 +91,7 @@ public class SmsCampaignApiResource { smscampaigns/template""") + @AlternativeOperationId("template_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SmsCampaignData.class))) public SmsCampaignData template() { platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME); @@ -105,6 +107,7 @@ public SmsCampaignData template() { Mandatory Fields for Cash based on selected report id paramValue in json format""") + @AlternativeOperationId("createCampaign_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CommandWrapper.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult createCampaign(@Parameter(hidden = true) final SmsCampaignCreationDto smsCampaignCreationDto) { @@ -122,6 +125,7 @@ public CommandProcessingResult createCampaign(@Parameter(hidden = true) final Sm smscampaigns/1 """) + @AlternativeOperationId("retrieveCampaign") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SmsCampaignData.class))) public SmsCampaignData retrieveCampaign(@PathParam("resourceId") final Long resourceId) { platformSecurityContext.authenticatedUser().validateHasReadPermission(SmsCampaignConstants.RESOURCE_NAME); @@ -134,6 +138,7 @@ public SmsCampaignData retrieveCampaign(@PathParam("resourceId") final Long reso Example Requests: smscampaigns""") + @AlternativeOperationId("retrieveAllEmails_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SmsCampaignData.class))) public Page retrieveAllEmails(@QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder) { @@ -148,6 +153,7 @@ public Page retrieveAllEmails(@QueryParam("offset") final Integ @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Campaign", operationId = "updateSmsCampaign") + @AlternativeOperationId("updateCampaign_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CommandWrapper.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult updateCampaign(@PathParam("campaignId") final Long campaignId, @@ -162,6 +168,7 @@ public CommandProcessingResult updateCampaign(@PathParam("campaignId") final Lon @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "SMS Campaign", operationId = "handleCommandsSmsCampaign", description = "Activates | Deactivates | Reactivates") + @AlternativeOperationId("handleCommands") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult handleCommands(@PathParam("campaignId") final Long campaignId, @QueryParam("command") final String commandParam, @Parameter(hidden = true) SmsCampaignHandlerDto campaignHandlerDto) { @@ -174,6 +181,7 @@ public CommandProcessingResult handleCommands(@PathParam("campaignId") final Lon @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Preview SMS Campaign message", operationId = "previewSmsCampaign") + @AlternativeOperationId("preview_1") public CampaignPreviewData preview(SmsCampaignPreviewDto previewDto) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); final String strPreviewDtoJson = toApiJsonSerializer.serialize(previewDto); @@ -185,6 +193,7 @@ public CampaignPreviewData preview(SmsCampaignPreviewDto previewDto) { @DELETE @Path("{campaignId}") @Operation(summary = "Delete a SMS Campaign", operationId = "deleteSmsCampaign", description = "Note: Only closed SMS Campaigns can be deleted") + @AlternativeOperationId("delete_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) public CommandProcessingResult delete(@PathParam("campaignId") final Long campaignId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSmsCampaign(campaignId).build(); 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 a9bdd472173..d306f28d9b0 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 @@ -47,6 +47,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.codes.data.CodeData; import org.apache.fineract.infrastructure.codes.service.CodeReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -78,6 +79,7 @@ public class CodesApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Codes", operationId = "retrieveAllCodes", description = "Returns the list of codes.\n" + "\n" + "Example Requests:\n" + "\n" + "codes") + @AlternativeOperationId("retrieveCodes") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class)))) public String retrieveCodes(@Context final UriInfo uriInfo) { @@ -109,6 +111,7 @@ public String createCode(@Parameter(hidden = true) final String apiRequestBodyAs @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Code", operationId = "retrieveOneCode", description = "Returns the details of a Code.\n" + "\n" + "Example Requests:\n" + "\n" + "codes/1") + @AlternativeOperationId("retrieveCode") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class))) public String retrieveCode(@PathParam("codeId") @Parameter(description = "codeId") final Long codeId, @Context final UriInfo uriInfo) { @@ -123,6 +126,7 @@ public String retrieveCode(@PathParam("codeId") @Parameter(description = "codeId @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Code", operationId = "retrieveOneCodeByName", description = "Returns the details of a Code.\n" + "\n" + "Example Requests:\n" + "\n" + "codes/1") + @AlternativeOperationId("retrieveCodeByName") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CodesApiResourceSwagger.GetCodesResponse.class))) public String retrieveCodeByName(@PathParam("codeName") @Parameter(description = "codeName") final String codeName, @Context final UriInfo uriInfo) { 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 10f16b8b9b9..6cb75df50ce 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 @@ -41,6 +41,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.configuration.data.ExternalServicesPropertiesData; import org.apache.fineract.infrastructure.configuration.service.ExternalServicesPropertiesReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -67,6 +68,7 @@ public class ExternalServicesConfigurationApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve External Services Configuration", operationId = "retrieveExternalServicesConfiguration", 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") + @AlternativeOperationId("retrieveOne_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ExternalServicesPropertiesData.class))) public String retrieveOne(@PathParam("servicename") @Parameter(description = "servicename") final String serviceName, @Context final UriInfo uriInfo) { @@ -84,6 +86,7 @@ public String retrieveOne(@PathParam("servicename") @Parameter(description = "se @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update External Service", operationId = "updateExternalServicesConfiguration", description = "Updates the external Service Configuration for a Service Name.\n" + "\n" + "Example: \n" + "\n" + "externalservice/S3") + @AlternativeOperationId("updateExternalServiceProperties") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ExternalServicesConfigurationApiResourceSwagger.PutExternalServiceRequest.class))) @ApiResponse(responseCode = "200", description = "OK") public String updateExternalServiceProperties( 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 c91dee8e417..37d72dee53b 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 @@ -46,6 +46,7 @@ import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationData; import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData; import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -101,6 +102,7 @@ public String retrieveConfiguration(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Global Configuration", operationId = "retrieveOneGlobalConfiguration", description = "Returns a global enable/disable configurations.\n" + "\n" + "Example Requests:\n" + "\n" + "configurations/1") + @AlternativeOperationId("retrieveOne_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationPropertyData.class))) public String retrieveOne(@PathParam("configId") @Parameter(description = "configId") final Long configId, @Context final UriInfo uriInfo) { @@ -134,6 +136,7 @@ public String retrieveOneByName(@PathParam("name") @Parameter(description = "nam @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Global Configuration", operationId = "updateGlobalConfiguration", description = "Updates an enable/disable global configuration item.") + @AlternativeOperationId("updateConfiguration_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class))) public String updateConfiguration(@PathParam("configId") @Parameter(description = "configId") final Long configId, diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/InternalConfigurationsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/InternalConfigurationsApiResource.java index bd1ca019765..0eb08dc9378 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/InternalConfigurationsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/InternalConfigurationsApiResource.java @@ -32,6 +32,7 @@ import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty; import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper; import org.apache.fineract.infrastructure.configuration.service.MoneyHelperInitializationService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.boot.FineractProfiles; import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant; import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil; @@ -67,6 +68,7 @@ public void afterPropertiesSet() throws Exception { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update internal global configuration", operationId = "updateInternalGlobalConfiguration") + @AlternativeOperationId("updateGlobalConfiguration") @SuppressFBWarnings("SLF4J_SIGN_ONLY_FORMAT") public Response updateGlobalConfiguration(@PathParam("configName") String configName, @PathParam("configValue") Long configValue) { log.warn("------------------------------------------------------------"); 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 5410214bf79..6747b32ef8f 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 @@ -46,6 +46,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder; @@ -287,6 +288,7 @@ Gets the entries (if they exist) for data tables that are one to many with the a datatables/extra_family_details/1?order=`Date of Birth` desc datatables/extra_client_details/1?genericResultSet=true""") + @AlternativeOperationId("getDatatable_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class))) public String getDatatable(@PathParam("datatable") @Parameter(description = "datatable") final String datatable, @PathParam("apptableId") @Parameter(description = "apptableId") final Long apptableId, 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 98dd726b280..46e35e81590 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 @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ToApiJsonSerializer; import org.apache.fineract.infrastructure.core.service.Page; @@ -66,6 +67,7 @@ public class EntityDatatableChecksApiResource { + "\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") + @AlternativeOperationId("retrieveAll_6") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.PageGetEntityDatatableChecksResponse.class))) public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @Parameter(description = "status") final Integer status, @QueryParam("entity") @Parameter(description = "entity") final String entity, @@ -84,6 +86,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("status") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Entity-Datatable Checks Template", operationId = "retrieveTemplateEntityDatatableChecks", 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") + @AlternativeOperationId("getTemplate") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.GetEntityDatatableChecksTemplateResponse.class))) public String getTemplate(@Context final UriInfo uriInfo) { @@ -111,6 +114,7 @@ public String createEntityDatatableCheck(@Parameter(hidden = true) final String @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete Entity-Datatable Checks", operationId = "deleteEntityDatatableCheck", description = "Deletes an existing Entity-Datatable Check") + @AlternativeOperationId("deleteDatatable_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = EntityDatatableChecksApiResourceSwagger.DeleteEntityDatatableChecksTemplateResponse.class))) public String deleteDatatable( @PathParam("entityDatatableCheckId") @Parameter(description = "entityDatatableCheckId") final long entityDatatableCheckId, 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 bf3ad1571df..7d2d66a9014 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 @@ -45,6 +45,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -76,6 +77,7 @@ public class ReportsApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Reports", operationId = "retrieveAllReports", description = "Lists all reports and their parameters.\n" + "\n" + "Example Request:\n" + "\n" + "reports") + @AlternativeOperationId("retrieveReportList") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsResponse.class)))) public String retrieveReportList(@Context final UriInfo uriInfo) { @@ -92,6 +94,7 @@ public String retrieveReportList(@Context final UriInfo uriInfo) { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Report\n", operationId = "retrieveOneReport", description = "Example Requests:\n" + "\n" + "reports/1\n" + "\n" + "\n" + "reports/1?template=true") + @AlternativeOperationId("retrieveReport") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsResponse.class))) public String retrieveReport(@PathParam("id") @Parameter(description = "id") final Long id, @Context final UriInfo uriInfo) { @@ -113,6 +116,7 @@ public String retrieveReport(@PathParam("id") @Parameter(description = "id") fin @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Report Template", operationId = "retrieveTemplateReport", 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") + @AlternativeOperationId("retrieveOfficeTemplate") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ReportsApiResourceSwagger.GetReportsTemplateResponse.class))) public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) { 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 d0aef5bf8bf..051a7a2c9fe 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,6 +18,7 @@ */ package org.apache.fineract.infrastructure.entityaccess.api; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; @@ -35,6 +36,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -61,6 +63,8 @@ public class FineractEntityApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveAll_3") + @AlternativeOperationId("retrieveAll_7") public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(FineractEntityApiResourceConstants.FINERACT_ENTITY_RESOURCE_NAME); @@ -73,6 +77,8 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @GET @Path("/{mapId}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveOne") + @AlternativeOperationId("retrieveOne_4") public String retrieveOne(@PathParam("mapId") final Long mapId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(FineractEntityApiResourceConstants.FINERACT_ENTITY_RESOURCE_NAME); @@ -135,6 +141,8 @@ public String updateMap(@PathParam("mapId") final Long mapId, final String apiRe @DELETE @Path("{mapId}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "delete") + @AlternativeOperationId("delete_4") public String delete(@PathParam("mapId") final Long mapId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // 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 de3c24cb45a..653d2a822bd 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 @@ -41,6 +41,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.hooks.command.HookCreateCommand; import org.apache.fineract.infrastructure.hooks.command.HookDeleteCommand; import org.apache.fineract.infrastructure.hooks.command.HookUpdateCommand; @@ -68,6 +69,7 @@ public class HookApiResource { @GET @Operation(summary = "Retrieve Hooks", operationId = "retrieveAllHooks", description = "Returns the list of hooks") + @AlternativeOperationId("retrieveHooks") public Collection retrieveHooks(@Context final UriInfo uriInfo) { return readPlatformService.retrieveAllHooks(); } @@ -75,6 +77,7 @@ public Collection retrieveHooks(@Context final UriInfo uriInfo) { @GET @Path("{hookId}") @Operation(summary = "Retrieve a Hook", operationId = "retrieveOneHook", description = "Returns the details of a Hook.") + @AlternativeOperationId("retrieveHook") public HookData retrieveHook(@PathParam("hookId") @Parameter(description = "hookId") final Long hookId, @QueryParam("template") @DefaultValue("false") @Parameter(description = "template") Boolean template) { var hook = readPlatformService.retrieveHook(hookId); @@ -92,6 +95,7 @@ public HookData retrieveHook(@PathParam("hookId") @Parameter(description = "hook @GET @Path("template") @Operation(summary = "Retrieve Hooks Template", operationId = "retrieveTemplateHook", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications.") + @AlternativeOperationId("template_3") public HookDetailsData template() { return readPlatformService.retrieveNewHookDetails(null); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/instancemode/api/InstanceModeApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/instancemode/api/InstanceModeApiResource.java index b43d46a1cab..0e02a6646b9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/instancemode/api/InstanceModeApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/instancemode/api/InstanceModeApiResource.java @@ -32,6 +32,7 @@ import jakarta.ws.rs.core.Response; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.boot.FineractProfiles; import org.apache.fineract.infrastructure.core.config.FineractProperties; import org.springframework.beans.factory.InitializingBean; @@ -63,6 +64,7 @@ public void afterPropertiesSet() throws Exception { @PUT @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Changes the Fineract instance mode", operationId = "updateInstanceMode", description = "") + @AlternativeOperationId("changeMode") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = InstanceModeApiResourceSwagger.ChangeInstanceModeRequest.class))) @ApiResponse(responseCode = "200", description = "OK") @SuppressFBWarnings("SLF4J_SIGN_ONLY_FORMAT") 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 1642800e94f..8ffb738d687 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 @@ -35,6 +35,7 @@ import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.UriInfo; import org.apache.commons.lang3.StringUtils; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -69,6 +70,7 @@ public SchedulerApiResource(final PlatformSecurityContext context, final JobRegi @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Scheduler Status", operationId = "retrieveSchedulerStatus", description = "Returns the scheduler status.\n" + "\n" + "Example Requests:\n" + "\n" + "scheduler") + @AlternativeOperationId("retrieveStatus") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SchedulerApiResourceSwagger.GetSchedulerResponse.class))) public String retrieveStatus(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SchedulerJobApiConstants.SCHEDULER_RESOURCE_NAME); @@ -83,6 +85,7 @@ public String retrieveStatus(@Context final UriInfo uriInfo) { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Activate Scheduler Jobs | Suspend Scheduler Jobs", operationId = "handleCommandsScheduler", description = "Activates the scheduler job service. | Suspends the scheduler job service.") + @AlternativeOperationId("changeSchedulerStatus") @ApiResponse(responseCode = "200", description = "POST : scheduler?command=start\n\n" + "\n" + "POST : scheduler?command=stop") public Response changeSchedulerStatus( @QueryParam(SchedulerJobApiConstants.COMMAND) @Parameter(description = "command") final String commandParam) { 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 79df8a3d421..f5522e18778 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 @@ -52,6 +52,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.IdTypeResolver; import org.apache.fineract.infrastructure.core.config.FineractProperties; @@ -91,6 +92,7 @@ public class SchedulerJobApiResource { @GET @Operation(summary = "Retrieve Scheduler Jobs", operationId = "retrieveAllSchedulerJobs", description = "Returns the list of jobs.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs") + @AlternativeOperationId("retrieveAll_8") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SchedulerJobApiResourceSwagger.GetJobsResponse.class)))) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(SCHEDULER_RESOURCE_NAME); @@ -103,6 +105,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @Path("{" + SchedulerJobApiConstants.JOB_ID + "}") @Operation(summary = "Retrieve a Job", operationId = "retrieveOneSchedulerJob", description = "Returns the details of a Job.\n" + "\n" + "Example Requests:\n" + "\n" + "jobs/5") + @AlternativeOperationId("retrieveOne_5") @ApiResponse(responseCode = "200", description = "OK", 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) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReader.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReader.java index 4721d10fd2a..de50637c31f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReader.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReader.java @@ -30,14 +30,21 @@ import java.util.List; import java.util.Map; import java.util.Set; +import javax.lang.model.SourceVersion; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; public final class FineractOperationIdReader extends Reader { + public static final String ALTERNATIVE_OPERATION_ID_EXTENSION = "x-alternative-operation-id"; + // Check explicit @Operation ids first, then let Swagger build the spec. @Override public OpenAPI read(Set> classes, Map resources) { ExplicitOperationValidator.validate(classes); - return super.read(classes, resources); + OpenAPI openAPI = super.read(classes, resources); + OperationIdValidator.validate(openAPI); + AlternativeOperationIdExtension.apply(classes, openAPI); + return openAPI; } static final class ExplicitOperationValidator { @@ -74,6 +81,116 @@ static void validate(Set> classes) { } } + static final class OperationIdValidator { + + static void validate(OpenAPI openAPI) { + Map> operationIds = collectOperationIds(openAPI); + + List duplicates = operationIds.entrySet().stream().filter(e -> e.getValue().size() > 1) + .map(e -> e.getKey() + " -> " + String.join(", ", e.getValue())).sorted().toList(); + if (!duplicates.isEmpty()) { + throw new IllegalStateException("Duplicate OpenAPI operationIds detected:\n - " + String.join("\n - ", duplicates)); + } + } + + static Map> collectOperationIds(OpenAPI openAPI) { + Map> operationIds = new LinkedHashMap<>(); + if (openAPI == null || openAPI.getPaths() == null) { + return operationIds; + } + + openAPI.getPaths().forEach((path, pathItem) -> pathItem.readOperationsMap().forEach((httpMethod, operation) -> { + String operationId = trimToNull(operation.getOperationId()); + if (operationId != null) { + operationIds.computeIfAbsent(operationId, ignored -> new ArrayList<>()).add(httpMethod + " " + path); + } + })); + return operationIds; + } + } + + static final class AlternativeOperationIdExtension { + + static void apply(Set> classes, OpenAPI openAPI) { + Map alternativeOperationIds = collect(classes); + Map> operationIds = OperationIdValidator.collectOperationIds(openAPI); + validateAlternativeOperationIdTargets(alternativeOperationIds, operationIds); + + if (alternativeOperationIds.isEmpty() || openAPI == null || openAPI.getPaths() == null) { + return; + } + + openAPI.getPaths().values().forEach(pathItem -> pathItem.readOperations().forEach(operation -> { + String alternativeOperationId = alternativeOperationIds.get(operation.getOperationId()); + if (alternativeOperationId != null) { + operation.addExtension(ALTERNATIVE_OPERATION_ID_EXTENSION, alternativeOperationId); + } + })); + } + + private static Map collect(Set> classes) { + Map alternativeOperationIds = new LinkedHashMap<>(); + Map> duplicateAlternativeOperationIds = new LinkedHashMap<>(); + + for (Class resourceClass : classes) { + if (resourceClass.getAnnotation(Path.class) == null) { + continue; + } + + for (Method method : resourceClass.getMethods()) { + Operation operation = method.getAnnotation(Operation.class); + String operationId = trimToNull(operation == null ? null : operation.operationId()); + + AlternativeOperationId alternativeOperationId = method.getAnnotation(AlternativeOperationId.class); + if (alternativeOperationId == null) { + continue; + } + + String source = resourceClass.getSimpleName() + "#" + method.getName(); + if (!hasHttpMethod(method)) { + throw new IllegalStateException("@AlternativeOperationId can only be used on JAX-RS resource methods: " + source); + } + + String value = trimToNull(alternativeOperationId.value()); + if (value == null) { + throw new IllegalStateException("@AlternativeOperationId value must not be blank: " + source); + } + if (!SourceVersion.isIdentifier(value) || SourceVersion.isKeyword(value)) { + throw new IllegalStateException( + "@AlternativeOperationId must be a valid Java method name: " + source + " -> " + value); + } + + String resolvedOperationId = operationId == null ? method.getName() : operationId; + if (resolvedOperationId.equals(value)) { + continue; + } + + duplicateAlternativeOperationIds.computeIfAbsent(value, ignored -> new ArrayList<>()).add(source); + alternativeOperationIds.put(resolvedOperationId, value); + } + } + + List duplicates = duplicateAlternativeOperationIds.entrySet().stream().filter(e -> e.getValue().size() > 1) + .map(e -> e.getKey() + " -> " + String.join(", ", e.getValue())).sorted().toList(); + if (!duplicates.isEmpty()) { + throw new IllegalStateException( + "Duplicate explicit OpenAPI alternativeOperationIds detected:\n - " + String.join("\n - ", duplicates)); + } + return alternativeOperationIds; + } + + private static void validateAlternativeOperationIdTargets(Map alternativeOperationIds, + Map> operationIds) { + List missing = alternativeOperationIds.keySet().stream().filter(operationId -> !operationIds.containsKey(operationId)) + .sorted().toList(); + if (!missing.isEmpty()) { + throw new IllegalStateException( + "OpenAPI alternativeOperationIds could not be matched to operationIds:\n - " + String.join("\n - ", missing)); + } + } + + } + // GET, POST, etc. are meta-annotated with @HttpMethod. private static boolean hasHttpMethod(Method method) { for (Annotation annotation : method.getAnnotations()) { 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 526a1b3563d..922b52204b3 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 @@ -42,6 +42,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -125,6 +126,7 @@ public String deleteReportMailingJob(@PathParam("entityId") @Parameter(descripti @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Report Mailing Job", operationId = "retrieveOneReportMailingJob", description = "Example Requests:\n" + "\n" + "reportmailingjobs/1\n" + "\n" + "\n" + "reportmailingjobs/1?template=true") + @AlternativeOperationId("retrieveReportMailingJob") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsResponse.class))) public String retrieveReportMailingJob(@PathParam("entityId") @Parameter(description = "entityId") final Long entityId, @Context final UriInfo uriInfo) { @@ -149,6 +151,7 @@ public String retrieveReportMailingJob(@PathParam("entityId") @Parameter(descrip @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Report Mailing Job Details Template", operationId = "retrieveTemplateReportMailingJob", 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") + @AlternativeOperationId("retrieveReportMailingJobTemplate") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ReportMailingJobApiResourceSwagger.GetReportMailingJobsTemplate.class))) public String retrieveReportMailingJobTemplate(@Context final UriInfo uriInfo) { this.platformSecurityContext.authenticatedUser() 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 d5f2aaa0fe0..5869b262a54 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 @@ -32,6 +32,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.UriInfo; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -60,6 +61,7 @@ public class ReportMailingJobRunHistoryApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Report Mailing Job History", operationId = "retrieveAllReportMailingJobRunHistory", description = "The list capability of report mailing job history can support pagination and sorting.\n" + "\n" + "Example Requests:\n" + "\n" + "reportmailingjobrunhistory/1") + @AlternativeOperationId("retrieveAllByReportMailingJobId") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ReportMailingJobRunHistoryData.class))) public String retrieveAllByReportMailingJobId(@Context final UriInfo uriInfo, @QueryParam("reportMailingJobId") @Parameter(description = "reportMailingJobId") final Long reportMailingJobId, 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 8c128f49d88..f9f9bf5710b 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 @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.DateFormat; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -69,6 +70,7 @@ public class SmsApiResource { @GET @Operation(summary = "List all SMS messages", operationId = "retrieveAllSms") + @AlternativeOperationId("retrieveAll_10") public List retrieveAll() { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); return readPlatformService.retrieveAll(); @@ -77,6 +79,7 @@ public List retrieveAll() { @POST @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a SMS message", operationId = "createSms") + @AlternativeOperationId("create_2") public CommandProcessingResult create(final SmsCreationRequest smsCreationRequest) { final CommandWrapper commandRequest = new CommandWrapperBuilder().createSms() .withJson(apiJsonSerializer.serialize(smsCreationRequest)).build(); @@ -86,6 +89,7 @@ public CommandProcessingResult create(final SmsCreationRequest smsCreationReques @GET @Path("{resourceId}") @Operation(summary = "Retrieve a SMS message", operationId = "retrieveOneSms") + @AlternativeOperationId("retrieveOne_6") public SmsData retrieveOne(@PathParam("resourceId") final Long resourceId) { return readPlatformService.retrieveOne(resourceId); } @@ -114,6 +118,7 @@ public Page retrieveAllSmsByStatus(@PathParam("campaignId") final Long @Path("{resourceId}") @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a SMS message", operationId = "updateSms") + @AlternativeOperationId("update_3") public CommandProcessingResult update(@PathParam("resourceId") final Long resourceId, final SmsUpdateRequest smsUpdateRequest) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateSms(resourceId) .withJson(apiJsonSerializer.serialize(smsUpdateRequest)).build(); @@ -123,6 +128,7 @@ public CommandProcessingResult update(@PathParam("resourceId") final Long resour @DELETE @Path("{resourceId}") @Operation(summary = "Delete a SMS message", operationId = "deleteSms") + @AlternativeOperationId("delete_5") public CommandProcessingResult delete(@PathParam("resourceId") final Long resourceId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteSms(resourceId).build(); return commandsSourceWritePlatformService.logCommandSource(commandRequest); 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 ab365c4d423..16cc46a295d 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,6 +18,7 @@ */ package org.apache.fineract.infrastructure.survey.api; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET; @@ -31,6 +32,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -55,6 +57,8 @@ public class LikelihoodApiResource { @GET @Path("{ppiName}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveAll_5") + @AlternativeOperationId("retrieveAll_11") public String retrieveAll(@PathParam("ppiName") final String ppiName) { this.context.authenticatedUser().validateHasReadPermission(PovertyLineApiConstants.POVERTY_LINE_RESOURCE_NAME); @@ -67,6 +71,8 @@ public String retrieveAll(@PathParam("ppiName") final String ppiName) { @GET @Path("{ppiName}/{likelihoodId}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieve_1") + @AlternativeOperationId("retrieve") public String retrieve(@PathParam("likelihoodId") final Long likelihoodId, @PathParam("ppiName") final String ppiName) { this.context.authenticatedUser().validateHasReadPermission(PovertyLineApiConstants.POVERTY_LINE_RESOURCE_NAME); @@ -80,6 +86,8 @@ public String retrieve(@PathParam("likelihoodId") final Long likelihoodId, @Path @Path("{ppiName}/{likelihoodId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "update_2") + @AlternativeOperationId("update_4") public String update(@PathParam("likelihoodId") final Long likelihoodId, final String apiRequestBodyAsJson, @PathParam("ppiName") final String ppiName) { 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 bea106c454c..fdf3970a602 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,6 +18,7 @@ */ package org.apache.fineract.infrastructure.survey.api; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; @@ -25,6 +26,7 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.infrastructure.survey.data.LikeliHoodPovertyLineData; @@ -46,6 +48,8 @@ public class PovertyLineApiResource { @GET @Path("{ppiName}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveAll_6") + @AlternativeOperationId("retrieveAll_12") public String retrieveAll(@PathParam("ppiName") final String ppiName) { this.context.authenticatedUser().validateHasReadPermission(PovertyLineApiConstants.POVERTY_LINE_RESOURCE_NAME); @@ -58,6 +62,8 @@ public String retrieveAll(@PathParam("ppiName") final String ppiName) { @GET @Path("{ppiName}/{likelihoodId}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveAll_7") + @AlternativeOperationId("retrieveAll_13") public String retrieveAll(@PathParam("ppiName") final String ppiName, @PathParam("likelihoodId") final Long likelihoodId) { this.context.authenticatedUser().validateHasReadPermission(PovertyLineApiConstants.POVERTY_LINE_RESOURCE_NAME); 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 2ca0ca7689d..3babb36889c 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 @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.dataqueries.data.GenericResultsetData; @@ -70,6 +71,7 @@ public class SurveyApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve surveys", operationId = "retrieveAllSurveys", description = "Retrieve surveys. This allows to retrieve the list of survey tables registered .") + @AlternativeOperationId("retrieveSurveys") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SurveyApiResourceSwagger.GetSurveyResponse.class)))) public String retrieveSurveys() { @@ -83,6 +85,7 @@ public String retrieveSurveys() { @Path("{surveyName}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve survey", operationId = "retrieveOneSurvey", description = "Lists a registered survey table details and the Apache Fineract Core application table they are registered to.") + @AlternativeOperationId("retrieveSurvey") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.GetSurveyResponse.class))) public String retrieveSurvey(@PathParam("surveyName") @Parameter(description = "surveyName") final String surveyName) { @@ -100,6 +103,7 @@ public String retrieveSurvey(@PathParam("surveyName") @Parameter(description = " @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create an entry in the survey table", operationId = "createSurveyEntry", description = "Insert and entry in a survey table (full fill the survey)." + "\n" + "\n" + "Refer Link for sample Body: [ https://fineract.apache.org/docs/legacy/#survey_create ] ") + @AlternativeOperationId("createDatatableEntry_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdResponse.class))) public String createDatatableEntry(@PathParam("surveyName") @Parameter(description = "surveyName") final String datatable, 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 1915da69f12..0cfe0b8553e 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 @@ -34,6 +34,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.UriInfo; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; import org.apache.fineract.infrastructure.core.serialization.ToApiJsonSerializer; @@ -89,6 +90,7 @@ public String getAllNotifications(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Notification Read Status", operationId = "updateNotificationReadStatus", description = "Updates the read status of all notifications for the authenticated user.", tags = { "Notification" }) + @AlternativeOperationId("update_5") public void update() { this.context.authenticatedUser(); this.notificationReadPlatformService.updateNotificationReadStatus(); 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 b8480a4360e..5e622e4caf1 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 @@ -48,6 +48,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.DateParam; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -82,6 +83,7 @@ public class HolidaysApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a Holiday", operationId = "createHoliday", description = "Mandatory Fields: " + "name, description, fromDate, toDate, repaymentsRescheduledTo, offices") + @AlternativeOperationId("createNewHoliday") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysResponse.class))) public String createNewHoliday(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -99,6 +101,7 @@ public String createNewHoliday(@Parameter(hidden = true) final String apiRequest @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Activate a Holiday", operationId = "handleCommandsHoliday", 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.") + @AlternativeOperationId("handleCommands_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysHolidayIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PostHolidaysHolidayIdResponse.class))) public String handleCommands(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId, @@ -130,6 +133,7 @@ public String handleCommands(@PathParam("holidayId") @Parameter(description = "h @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Holiday", operationId = "retrieveOneHoliday", description = "Example Requests:\n" + "\n" + "holidays/1") + @AlternativeOperationId("retrieveOne_7") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.GetHolidaysResponse.class))) public String retrieveOne(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId, @Context final UriInfo uriInfo) { @@ -148,6 +152,7 @@ public String retrieveOne(@PathParam("holidayId") @Parameter(description = "holi @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Holiday", operationId = "updateHoliday", 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.") + @AlternativeOperationId("update_6") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PutHolidaysHolidayIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = HolidaysApiResourceSwagger.PutHolidaysHolidayIdResponse.class))) public String update(@PathParam("holidayId") @Parameter(description = "holidayId") final Long holidayId, @@ -164,6 +169,7 @@ public String update(@PathParam("holidayId") @Parameter(description = "holidayId @Path("{holidayId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Holiday", operationId = "deleteHoliday", description = "This API allows to delete a holiday. This is a soft delete the deleted holiday status is marked as deleted.") + @AlternativeOperationId("delete_6") @ApiResponse(responseCode = "200", description = "OK", 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(); 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 256610cabd0..6cbd537728a 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,6 +18,7 @@ */ package org.apache.fineract.organisation.office.api; +import io.swagger.v3.oas.annotations.Operation; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; import jakarta.ws.rs.GET; @@ -36,6 +37,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -102,6 +104,8 @@ public String transferMoneyFrom(final String apiRequestBodyAsJson) { @DELETE @Path("{transactionId}") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "delete_2") + @AlternativeOperationId("delete_7") public String delete(@PathParam("transactionId") final Long transactionId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteOfficeTransaction(transactionId).build(); 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 0409502aba3..a50e4045d76 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 @@ -52,6 +52,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.UploadRequest; @@ -98,6 +99,7 @@ public class OfficesApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Offices", operationId = "retrieveAllOffices", description = "Example Requests:\n" + "\n" + "offices\n" + "\n" + "\n" + "offices?fields=id,name,openingDate") + @AlternativeOperationId("retrieveOffices") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesResponse.class)))) public String retrieveOffices(@Context final UriInfo uriInfo, @DefaultValue("false") @QueryParam("includeAllOffices") @Parameter(description = "includeAllOffices") final boolean onlyManualEntries, @@ -118,6 +120,7 @@ public String retrieveOffices(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Office Details Template", operationId = "retrieveTemplateOffice", 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") + @AlternativeOperationId("retrieveOfficeTemplate_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesTemplateResponse.class))) public String retrieveOfficeTemplate(@Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -149,6 +152,7 @@ public String createOffice(@Parameter(hidden = true) final String apiRequestBody @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve an Office", operationId = "retrieveOneOffice", description = "Example Requests:\n" + "\n" + "offices/1\n" + "\n" + "\n" + "offices/1?template=true\n" + "\n" + "\n" + "offices/1?fields=id,name,parentName") + @AlternativeOperationId("retrieveOffice") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.GetOfficesResponse.class))) public String retrieveOffice(@PathParam("officeId") @Parameter(description = "officeId") final Long officeId, @Context final UriInfo uriInfo) { @@ -168,6 +172,7 @@ public String retrieveOffice(@PathParam("officeId") @Parameter(description = "of @Operation(summary = "Retrieve an Office using external id", operationId = "retrieveOneOfficeByExternalId", description = "Example Requests:\n" + "\n" + "offices/external-id/asd123\n" + "\n" + "\n" + "offices/external-id/asd123?template=true\n" + "\n" + "\n" + "offices/external-id/asd123?fields=id,name,parentName") + @AlternativeOperationId("retrieveOfficeByExternalId") public OfficesApiResourceSwagger.GetOfficesResponse retrieveOfficeByExternalId( @PathParam("externalId") @Parameter(description = "externalId") final String externalId, @Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -202,6 +207,7 @@ public String updateOffice(@PathParam("officeId") @Parameter(description = "offi @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Office", operationId = "updateOfficeByExternalId", description = "") + @AlternativeOperationId("updateOfficeWithExternalId") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = OfficesApiResourceSwagger.PutOfficesOfficeIdRequest.class))) public OfficesApiResourceSwagger.PutOfficesOfficeIdResponse updateOfficeWithExternalId( @Parameter(description = "externalId") @PathParam("externalId") final String externalId, 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 4c645aefc4b..f54261b17d7 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,6 +18,7 @@ */ package org.apache.fineract.organisation.provisioning.api; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; @@ -33,6 +34,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.organisation.provisioning.data.ProvisioningCategoryData; @@ -51,6 +53,8 @@ public class ProvisioningCategoryApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveAll_8") + @AlternativeOperationId("retrieveAll_15") public List retrieveAll() { platformSecurityContext.authenticatedUser(); return provisioningCategoryReadPlatformService.retrieveAllProvisionCategories(); 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 3b1d2547adf..95d8b75f84d 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 @@ -42,6 +42,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -66,6 +67,8 @@ public class ProvisioningCriteriaApiResource { @GET @Path("template") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "retrieveTemplate_1") + @AlternativeOperationId("retrieveTemplate_3") public ProvisioningCriteriaData retrieveTemplate() { platformSecurityContext.authenticatedUser(); return provisioningCriteriaReadPlatformService.retrievePrivisiongCriteriaTemplate(); @@ -75,6 +78,7 @@ public ProvisioningCriteriaData retrieveTemplate() { @Path("{criteriaId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieves a Provisioning Criteria", operationId = "retrieveOneProvisioningCriteria", description = "Retrieves a Provisioning Criteria") + @AlternativeOperationId("retrieveProvisioningCriteria") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaCriteriaIdResponse.class))) public ProvisioningCriteriaData retrieveProvisioningCriteria( @PathParam("criteriaId") @Parameter(description = "criteriaId") final Long criteriaId, @Context final UriInfo uriInfo) { @@ -90,6 +94,7 @@ public ProvisioningCriteriaData retrieveProvisioningCriteria( @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieves all created Provisioning Criterias", operationId = "retrieveAllProvisioningCriteria", description = "Retrieves all created Provisioning Criterias") + @AlternativeOperationId("retrieveAllProvisioningCriterias") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProvisioningCriteriaApiResourceSwagger.GetProvisioningCriteriaResponse.class)))) public List retrieveAllProvisioningCriterias() { platformSecurityContext.authenticatedUser(); 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 3758e13d1df..abaf722eaf4 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 @@ -46,6 +46,7 @@ import org.apache.fineract.command.core.CommandDispatcher; import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.organisation.office.data.OfficeData; import org.apache.fineract.organisation.office.service.OfficeReadPlatformService; import org.apache.fineract.organisation.staff.command.StaffCreateCommand; @@ -89,6 +90,7 @@ public class StaffApiResource { By default it Returns all the ACTIVE Staff. Otherwise a status can be provided like e.g. status=INACTIVE, then it returns all INACTIVE staff or status=ALL returns both ACTIVE and INACTIVE staff. """) + @AlternativeOperationId("retrieveAll_16") public List retrieveAll(@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, @@ -106,6 +108,7 @@ public List retrieveAll(@QueryParam("officeId") @Parameter(descriptio - /staff/1 """) + @AlternativeOperationId("retrieveOne_8") public StaffData retrieveOne(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId, @DefaultValue("false") @QueryParam("template") @Parameter(description = "template", hidden = true) boolean template) { StaffData staff = readPlatformService.retrieveStaff(staffId); @@ -126,6 +129,7 @@ public StaffData retrieveOne(@PathParam("staffId") @Parameter(description = "sta @Path("downloadtemplate") @Produces("application/vnd.ms-excel") @Operation(summary = "Download bulk import template", operationId = "getBulkTemplateStaff") + @AlternativeOperationId("getTemplate_1") public Response getTemplate(@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, @QueryParam("dateFormat") @Parameter(description = "dateFormat") final String dateFormat) { return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.STAFF.toString(), officeId, null, dateFormat); @@ -147,6 +151,7 @@ public Response getTemplate(@QueryParam("officeId") @Parameter(description = "of - isLoanOfficer - isActive """) + @AlternativeOperationId("create_3") public StaffCreateResponse createStaff(@RequestBody(required = true) @Valid StaffCreateRequest request) { final var command = new StaffCreateCommand(); @@ -161,6 +166,7 @@ public StaffCreateResponse createStaff(@RequestBody(required = true) @Valid Staf @Path("{staffId}") @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Staff Member", operationId = "updateStaff", description = "Updates the details of a staff member.") + @AlternativeOperationId("update_7") public StaffUpdateResponse updateStaff(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId, @RequestBody(required = true) @Valid StaffUpdateRequest request) { request.setId(staffId); 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 aa0236d7609..91ab7b64652 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 @@ -31,6 +31,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.organisation.workingdays.command.WorkingDaysUpdateCommand; import org.apache.fineract.organisation.workingdays.data.WorkingDaysData; import org.apache.fineract.organisation.workingdays.data.WorkingDaysUpdateRequest; @@ -56,6 +57,7 @@ public class WorkingDaysApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Working days", operationId = "retrieveAllWorkingDays", description = "Example Requests:\n" + "\n" + "workingdays") + @AlternativeOperationId("retrieveAll_17") public WorkingDaysData retrieveAll() { return this.workingDaysReadPlatformService.retrieve(); } @@ -65,6 +67,7 @@ public WorkingDaysData retrieveAll() { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Working Day", operationId = "updateWorkingDay", description = "Mandatory Fields\n" + "recurrence,repaymentRescheduleType,extendTermForDailyRepayments,locale") + @AlternativeOperationId("update_8") public WorkingDaysUpdateResponse update(@Valid WorkingDaysUpdateRequest request) { final var command = new WorkingDaysUpdateCommand(); @@ -83,6 +86,7 @@ public WorkingDaysUpdateResponse update(@Valid WorkingDaysUpdateRequest request) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Working Days Template", operationId = "retrieveTemplateWorkingDays", 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") + @AlternativeOperationId("template_4") public WorkingDaysData template() { return this.workingDaysReadPlatformService.repaymentRescheduleType(); } 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 782b935e324..115354b4543 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 @@ -38,6 +38,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.core.service.Page; @@ -68,6 +69,7 @@ public class AccountTransfersApiResource { + "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") + @AlternativeOperationId("template_5") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class))) public AccountTransferData template(@BeanParam AccountTransSearchParam accountTransSearchParam) { @@ -84,6 +86,7 @@ public AccountTransferData template(@BeanParam AccountTransSearchParam accountTr @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create new Transfer", operationId = "createAccountTransfer", description = "Ability to create new transfer of monetary funds from one account to another.") + @AlternativeOperationId("create_4") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransferRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersResponse.class))) public CommandProcessingResult create(@Parameter(hidden = true) AccountTransferRequest accountTransferRequest) { @@ -97,6 +100,7 @@ public CommandProcessingResult create(@Parameter(hidden = true) AccountTransferR @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List account transfers", operationId = "retrieveAllAccountTransfers", description = "Lists account's transfers\n\n" + "Example Requests:\n\n" + "\n\n" + "accounttransfers") + @AlternativeOperationId("retrieveAll_18") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.class))) public Page retrieveAll(@QueryParam("externalId") @Parameter(description = "externalId") final String externalId, @QueryParam("offset") @Parameter(description = "offset") final Integer offset, @@ -118,6 +122,7 @@ public Page retrieveAll(@QueryParam("externalId") @Paramete @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve account transfer", operationId = "retrieveOneAccountTransfer", description = "Retrieves account transfer\n\n" + "Example Requests :\n\n" + "\n\n" + "accounttransfers/1") + @AlternativeOperationId("retrieveOne_9") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.GetAccountTransfersPageItems.class))) public AccountTransferData retrieveOne(@PathParam("transferId") @Parameter(description = "transferId") final Long transferId) { context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME); @@ -130,6 +135,7 @@ public AccountTransferData retrieveOne(@PathParam("transferId") @Parameter(descr @Operation(summary = "Retrieve Refund of an Active Loan by Transfer Template", operationId = "retrieveTemplateRefundByTransfer", 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") + @AlternativeOperationId("templateRefundByTransfer") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateRefundByTransferResponse.class))) public AccountTransferData templateRefundByTransfer(@BeanParam AccountTransSearchParam accountTransSearchParam) { context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME); @@ -145,6 +151,7 @@ public AccountTransferData templateRefundByTransfer(@BeanParam AccountTransSearc @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Refund of an Active Loan by Transfer", operationId = "refundByTransfer", description = "Ability to refund an active loan by transferring to a savings account.") + @AlternativeOperationId("templateRefundByTransferPost") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransferRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.PostAccountTransfersRefundByTransferResponse.class))) public CommandProcessingResult templateRefundByTransferPost(@Parameter(hidden = true) AccountTransferRequest accountTransferRequest) { 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 b9af56216e5..01b960b6344 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 @@ -46,6 +46,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; @@ -94,6 +95,7 @@ public class StandingInstructionApiResource { + "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") + @AlternativeOperationId("template_6") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsTemplateResponse.class))) public StandingInstructionData template(@BeanParam StandingInstructionSearchParam instructionParam) { context.authenticatedUser().validateHasReadPermission(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME); @@ -108,6 +110,7 @@ public StandingInstructionData template(@BeanParam StandingInstructionSearchPara @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create new Standing Instruction", operationId = "createStandingInstruction", description = "Ability to create new instruction for transfer of monetary funds from one account to another") + @AlternativeOperationId("create_5") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = StandingInstructionCreationRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PostStandingInstructionsResponse.class))) public CommandProcessingResult create(@Parameter(hidden = true) StandingInstructionCreationRequest creationRequest) { @@ -125,6 +128,7 @@ public CommandProcessingResult create(@Parameter(hidden = true) StandingInstruct + "\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") + @AlternativeOperationId("update_9") @RequestBody(content = @Content(schema = @Schema(implementation = StandingInstructionUpdatesRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.PutStandingInstructionsStandingInstructionIdResponse.class))) public CommandProcessingResult update( @@ -143,6 +147,7 @@ public CommandProcessingResult update( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Standing Instructions", operationId = "retrieveAllStandingInstructions", description = "Example Requests:\n" + "\n" + "standinginstructions") + @AlternativeOperationId("retrieveAll_19") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsResponse.class))) public Page retrieveAll( @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, @@ -177,6 +182,7 @@ public Page retrieveAll( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Standing Instruction", operationId = "retrieveOneStandingInstruction", description = "Example Requests :\n" + "\n" + "standinginstructions/1") + @AlternativeOperationId("retrieveOne_10") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionApiResourceSwagger.GetStandingInstructionsStandingInstructionIdResponse.class))) public StandingInstructionData retrieveOne( @PathParam("standingInstructionId") @Parameter(description = "standingInstructionId") final Long standingInstructionId, 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 7120175922e..4b746c01674 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 @@ -32,6 +32,7 @@ import java.time.LocalDate; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.DateParam; import org.apache.fineract.infrastructure.core.data.DateFormat; import org.apache.fineract.infrastructure.core.service.Page; @@ -56,6 +57,7 @@ public class StandingInstructionHistoryApiResource { @Operation(summary = "Standing Instructions Logged History", operationId = "retrieveAllStandingInstructionHistory", 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") + @AlternativeOperationId("retrieveAll_20") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StandingInstructionHistoryApiResourceSwagger.GetStandingInstructionRunHistoryResponse.class))) public Page retrieveAll( @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, 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 9b2c44c5a52..5cceab22e99 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 @@ -45,6 +45,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.UploadRequest; @@ -80,6 +81,7 @@ public class AccountsApiResource { @Operation(summary = "Retrieve Share Account Template", operationId = "retrieveTemplateShareAccount", 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") + @AlternativeOperationId("template_7") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeTemplateResponse.class))) public ShareAccountData template(@PathParam("type") @Parameter(description = "type") final String accountType, @QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, @@ -93,6 +95,7 @@ public ShareAccountData template(@PathParam("type") @Parameter(description = "ty @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a share application/account", operationId = "retrieveOneShareAccount", description = "Retrieves a share application/account\n\n" + "Example Requests :\n" + "\n" + "shareaccount/1") + @AlternativeOperationId("retrieveAccount") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeAccountIdResponse.class))) public ShareAccountData retrieveAccount(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @PathParam("type") @Parameter(description = "type") final String accountType, @Context final UriInfo uriInfo) { @@ -104,6 +107,7 @@ public ShareAccountData retrieveAccount(@PathParam("accountId") @Parameter(descr @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List share applications/accounts", operationId = "retrieveAllShareAccounts", description = "Lists share applications/accounts\n\n" + "Example Requests:\n" + "\n" + "shareaccount") + @AlternativeOperationId("retrieveAllAccounts_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.GetAccountsTypeResponse.class))) public Page retrieveAllAccounts(@PathParam("type") @Parameter(description = "type") final String accountType, @QueryParam("offset") @Parameter(description = "offset") final Integer offset, @@ -118,6 +122,7 @@ public Page retrieveAllAccounts(@PathParam("type") @Parameter(descr + "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") + @AlternativeOperationId("createAccount") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeResponse.class))) public CommandProcessingResult createAccount(@PathParam("type") @Parameter(description = "type") final String accountType, @@ -151,6 +156,7 @@ public CommandProcessingResult createAccount(@PathParam("type") @Parameter(descr + "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://fineract.apache.org/docs/legacy/#shareaccounts") + @AlternativeOperationId("handleCommands_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdResponse.class))) public CommandProcessingResult handleCommands(@PathParam("type") @Parameter(description = "type") final String accountType, @@ -168,6 +174,7 @@ public CommandProcessingResult handleCommands(@PathParam("type") @Parameter(desc @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Modify a share application", operationId = "updateShareAccount", 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") + @AlternativeOperationId("updateAccount") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PutAccountsTypeAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PutAccountsTypeAccountIdResponse.class))) public CommandProcessingResult updateAccount(@PathParam("type") @Parameter(description = "type") final String accountType, @@ -183,6 +190,7 @@ public CommandProcessingResult updateAccount(@PathParam("type") @Parameter(descr @Path("downloadtemplate") @Produces("application/vnd.ms-excel") @Operation(summary = "Download share accounts bulk imports template", operationId = "getShareAccountTemplate") + @AlternativeOperationId("getSharedAccountsTemplate") public Response getSharedAccountsTemplate(@QueryParam("officeId") final Long officeId, @QueryParam("dateFormat") final String dateFormat, @PathParam("type") @Parameter(description = "type") final String accountType) { @@ -193,6 +201,7 @@ public Response getSharedAccountsTemplate(@QueryParam("officeId") final Long off @Path("uploadtemplate") @Consumes(MediaType.MULTIPART_FORM_DATA) @Operation(summary = "Upload share accounts bulk imports data", operationId = "postShareAccountTemplate") + @AlternativeOperationId("postSharedAccountsTemplate") @RequestBody(description = "Upload shared accounts template", content = { @Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) }) public Long postSharedAccountsTemplate(@FormDataParam("file") InputStream uploadedInputStream, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/api/CalendarsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/api/CalendarsApiResource.java index 85495f8aac8..8e8eac0ad7e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/api/CalendarsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/api/CalendarsApiResource.java @@ -49,6 +49,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -113,6 +114,7 @@ public CalendarData retrieveCalendar(@PathParam("calendarId") final Long calenda @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Calendars by Entity", operationId = "retrieveCalendarsByEntityId") + @AlternativeOperationId("retrieveCalendarsByEntity") public List retrieveCalendarsByEntity(@PathParam("entityType") final String entityType, @PathParam("entityId") final Long entityId, @Context final UriInfo uriInfo, @DefaultValue("all") @QueryParam("calendarType") final String calendarType) { @@ -138,6 +140,7 @@ public List retrieveCalendarsByEntity(@PathParam("entityType") fin @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Calendar Template", operationId = "retrieveTemplateCalendar") + @AlternativeOperationId("retrieveNewCalendarDetails") public CalendarData retrieveNewCalendarDetails(@Context final UriInfo uriInfo, @PathParam("entityType") final String entityType, @PathParam("entityId") final Long entityId) { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java index 76b383ffee7..1288debbe62 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java @@ -39,6 +39,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -64,6 +65,7 @@ public class ClientAddressApiResource { @Path("addresses/template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client address template", operationId = "retrieveTemplateClientAddress") + @AlternativeOperationId("getAddressesTemplate") public AddressData getAddressesTemplate() { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); return readPlatformService.retrieveTemplate(); @@ -76,6 +78,7 @@ public AddressData getAddressesTemplate() { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create an address for a Client", operationId = "createClientAddress", description = "Mandatory Fields : \n" + "type and clientId") + @AlternativeOperationId("addClientAddress") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientAddressRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientAddressApiResourcesSwagger.PostClientClientIdAddressesResponse.class))) public CommandProcessingResult addClientAddress(@QueryParam("type") @Parameter(description = "type") final long addressTypeId, @@ -97,6 +100,7 @@ public CommandProcessingResult addClientAddress(@QueryParam("type") @Parameter(d clients/1/addresses?status=false,true&&type=1,2,3""") + @AlternativeOperationId("getAddresses_1") public List 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) { 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 8c467177ef2..01bf74f1a43 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 @@ -45,6 +45,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -114,6 +115,7 @@ private boolean is(final String commandParam, final String commandValue) { @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client charge template", operationId = "retrieveTemplateClientCharge") + @AlternativeOperationId("retrieveTemplate_4") public String retrieveTemplate(@Context final UriInfo uriInfo, @PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { @@ -132,6 +134,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Client Charge", operationId = "retrieveOneClientCharge", description = "Example Requests:\n" + "clients/1/charges/1\n" + "\n" + "\n" + "clients/1/charges/1?fields=name,id") + @AlternativeOperationId("retrieveClientCharge") @ApiResponse(responseCode = "200", description = "OK", 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) { @@ -162,6 +165,7 @@ public String retrieveClientCharge(@PathParam("clientId") @Parameter(description @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Add Client Charge", operationId = "createClientCharge", description = " This API associates a Client charge with an implicit Client account\n" + "Mandatory Fields : \n" + "chargeId and dueDate \n" + "Optional Fields : \n" + "amount") + @AlternativeOperationId("applyClientCharge") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.PostClientsClientIdChargesRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientChargesApiResourceSwagger.PostClientsClientIdChargesResponse.class))) public String applyClientCharge(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientFamilyMembersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientFamilyMembersApiResource.java index 5ef45336771..c4969f8b2fc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientFamilyMembersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientFamilyMembersApiResource.java @@ -36,6 +36,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -60,6 +61,7 @@ public class ClientFamilyMembersApiResource { @Path("/{familyMemberId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a client family member", operationId = "retrieveOneClientFamilyMember") + @AlternativeOperationId("getFamilyMember") public ClientFamilyMembersData getFamilyMember(@PathParam("familyMemberId") final Long familyMemberId, @PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { @@ -71,6 +73,7 @@ public ClientFamilyMembersData getFamilyMember(@PathParam("familyMemberId") fina @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List all client family members", operationId = "retrieveAllClientFamilyMembers") + @AlternativeOperationId("getFamilyMembers") public List getFamilyMembers(@PathParam("clientId") final long clientId) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); return this.readPlatformService.getClientFamilyMembers(clientId); @@ -80,6 +83,7 @@ public List getFamilyMembers(@PathParam("clientId") fin @Path("/template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client family member template", operationId = "retrieveTemplateClientFamilyMember") + @AlternativeOperationId("getTemplate_2") public ClientFamilyMembersData getTemplate(@PathParam("clientId") final long clientId) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); return this.readPlatformService.retrieveTemplate(); @@ -90,6 +94,7 @@ public ClientFamilyMembersData getTemplate(@PathParam("clientId") final long cli @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a client family member", operationId = "updateClientFamilyMember") + @AlternativeOperationId("updateClientFamilyMembers") public CommandProcessingResult updateClientFamilyMembers(@PathParam("familyMemberId") final long familyMemberId, ClientFamilyMemberRequest clientFamilyMemberRequest, @PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { @@ -103,6 +108,7 @@ public CommandProcessingResult updateClientFamilyMembers(@PathParam("familyMembe @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Add a client family member", operationId = "createClientFamilyMember") + @AlternativeOperationId("addClientFamilyMembers") public CommandProcessingResult addClientFamilyMembers(@PathParam("clientId") final long clientid, ClientFamilyMemberRequest clientFamilyMemberRequest) { final CommandWrapper commandRequest = new CommandWrapperBuilder().addFamilyMembers(clientid) @@ -115,6 +121,7 @@ public CommandProcessingResult addClientFamilyMembers(@PathParam("clientId") fin @Path("/{familyMemberId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a client family member", operationId = "deleteClientFamilyMember") + @AlternativeOperationId("deleteClientFamilyMembers") public CommandProcessingResult deleteClientFamilyMembers(@PathParam("familyMemberId") final long familyMemberId, @PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteFamilyMembers(familyMemberId).build(); 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 5ee370d37c1..0b2477c9fd3 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 @@ -47,6 +47,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -97,6 +98,7 @@ public List retrieveAllClientIdentifiers( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Client Identifier Details Template", operationId = "retrieveTemplateClientIdentifier", 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") + @AlternativeOperationId("newClientIdentifierDetails") public ClientIdentifierData newClientIdentifierDetails( @PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { @@ -141,6 +143,7 @@ public CommandProcessingResult createClientIdentifier(@PathParam("clientId") @Pa @Operation(summary = "Retrieve a Client Identifier", operationId = "retrieveOneClientIdentifier", 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") + @AlternativeOperationId("retrieveClientIdentifiers") @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, @@ -165,6 +168,7 @@ public String retrieveClientIdentifiers(@PathParam("clientId") @Parameter(descri @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Client Identifier", operationId = "updateClientIdentifier", description = "Updates a Client Identifier") + @AlternativeOperationId("updateClientIdentifer") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientIdentifierRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientIdentifiersApiResourceSwagger.PutClientsClientIdIdentifiersIdentifierIdResponse.class))) public CommandProcessingResult updateClientIdentifer(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, 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 dfd65cc8c98..2ee1cc06f9b 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 @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.domain.ExternalId; @@ -120,6 +121,7 @@ public String undoClientTransaction(@PathParam("clientId") @Parameter(descriptio @Operation(summary = "List Client Transactions", operationId = "retrieveAllClientTransactionsByClientExternalId", description = "The list capability of client transaction can support pagination." + "\n\n" + "Example Requests:\n\n" + "clients/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions\n\n" + "clients/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions?offset=10&limit=50") + @AlternativeOperationId("retrieveAllClientTransactions_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsResponse.class))) public String retrieveAllClientTransactions( @PathParam("clientExternalId") @Parameter(description = "clientExternalId") final String clientExternalId, @@ -143,6 +145,7 @@ public String retrieveAllClientTransactions( @Operation(summary = "Retrieve a Client Transaction", operationId = "retrieveClientTransactionByClientExternalId", description = "Example Requests:\n" + "clients/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions/1\n" + "\n" + "\n" + "clients/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions/1?fields=id,officeName") + @AlternativeOperationId("retrieveClientTransaction_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsTransactionIdResponse.class))) public String retrieveClientTransaction( @PathParam("clientExternalId") @Parameter(description = "clientExternalId") final String clientExternalId, @@ -166,6 +169,7 @@ public String retrieveClientTransaction( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Client Transaction", operationId = "undoClientTransactionByClientExternalId", description = "Undoes a Client Transaction") + @AlternativeOperationId("undoClientTransaction_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.PostClientsClientIdTransactionsTransactionIdResponse.class))) public String undoClientTransaction( @PathParam("clientExternalId") @Parameter(description = "clientExternalId") final String clientExternalId, @@ -189,6 +193,7 @@ public String undoClientTransaction( @Operation(summary = "Retrieve a Client Transaction", operationId = "retrieveClientTransactionByTransactionExternalId", description = "Example Requests:\n" + "clients/1/transactions/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854\n" + "\n" + "\n" + "clients/1/transactions/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854?fields=id,officeName") + @AlternativeOperationId("retrieveClientTransaction_1") @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("transactionExternalId") @Parameter(description = "transactionExternalId") final String transactionExternalId, @@ -214,6 +219,7 @@ public String retrieveClientTransaction(@PathParam("clientId") @Parameter(descri + "clients/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854\n" + "\n" + "\n" + "clients/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854?fields=id,officeName") + @AlternativeOperationId("retrieveClientTransaction_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsTransactionIdResponse.class))) public String retrieveClientTransaction( @PathParam("clientExternalId") @Parameter(description = "clientExternalId") final String clientExternalId, @@ -242,6 +248,7 @@ public String retrieveClientTransaction( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Client Transaction", operationId = "undoClientTransactionByTransactionExternalId", description = "Undoes a Client Transaction") + @AlternativeOperationId("undoClientTransaction_1") @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("transactionExternalId") @Parameter(description = "transactionExternalId") final String transactionExternalId, @@ -262,6 +269,7 @@ public String undoClientTransaction(@PathParam("clientId") @Parameter(descriptio @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Client Transaction", operationId = "undoClientTransactionByClientAndTransactionExternalId", description = "Undoes a Client Transaction") + @AlternativeOperationId("undoClientTransaction_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientTransactionsApiResourceSwagger.PostClientsClientIdTransactionsTransactionIdResponse.class))) public String undoClientTransaction( @PathParam("clientExternalId") @Parameter(description = "clientExternalId") final String clientExternalId, 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 2940461e555..5a31c0bab6b 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 @@ -49,6 +49,7 @@ import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.UploadRequest; @@ -102,6 +103,7 @@ public class ClientsApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Client Details Template", operationId = "retrieveTemplateClient", 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") + @AlternativeOperationId("retrieveTemplate_5") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsTemplateResponse.class))) public String retrieveTemplate(@Context final UriInfo uriInfo, @Parameter(description = "officeId") @QueryParam("officeId") final Long officeId, @@ -132,6 +134,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo, @Operation(summary = "List Clients", operationId = "retrieveAllClients", 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") + @AlternativeOperationId("retrieveAll_21") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsResponse.class))) public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, @@ -158,6 +161,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Client", operationId = "retrieveOneClient", description = "Example Requests:\n" + "\n" + "clients/1\n" + "\n" + "\n" + "clients/1?template=true\n" + "\n" + "\n" + "clients/1?fields=id,displayName,officeName") + @AlternativeOperationId("retrieveOne_11") @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, @@ -173,6 +177,7 @@ public String retrieveOne(@PathParam("clientId") @Parameter(description = "clien + "\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") + @AlternativeOperationId("create_6") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsResponse.class))) public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -195,6 +200,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson + "\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.") + @AlternativeOperationId("update_10") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PutClientsClientIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PutClientsClientIdResponse.class))) public String update(@Parameter(description = "clientId") @PathParam("clientId") final Long clientId, @@ -206,6 +212,7 @@ public String update(@Parameter(description = "clientId") @PathParam("clientId") @Path("{clientId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Client", operationId = "deleteClient", 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.") + @AlternativeOperationId("delete_8") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.DeleteClientsClientIdResponse.class))) public String delete(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId) { return deleteClient(clientId, null); @@ -245,6 +252,7 @@ public String delete(@PathParam("clientId") @Parameter(description = "clientId") + "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'") + @AlternativeOperationId("activate_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsClientIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsClientIdResponse.class))) public String activate(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @@ -259,6 +267,7 @@ public String activate(@PathParam("clientId") @Parameter(description = "clientId @Operation(summary = "Retrieve client accounts overview", operationId = "retrieveAllClientAccounts", 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") + @AlternativeOperationId("retrieveAssociatedAccounts") @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, @@ -293,6 +302,7 @@ public String postClientTemplate(@QueryParam("legalFormType") final String legal @Path("{clientId}/obligeedetails") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client obligee details", operationId = "retrieveClientObligeeDetails", description = "Retrieve client obligee details") + @AlternativeOperationId("retrieveObligeeDetails") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientObligeeDetailsResponse.class))) @ApiResponse(responseCode = "400", description = "Bad Request") public String retrieveObligeeDetails(@PathParam("clientId") final Long clientId, @Context final UriInfo uriInfo) { @@ -303,6 +313,7 @@ public String retrieveObligeeDetails(@PathParam("clientId") final Long clientId, @Path("{clientId}/transferproposaldate") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client transfer template", operationId = "retrieveClientTransferTemplate", description = "Retrieve client transfer template") + @AlternativeOperationId("retrieveTransferTemplate") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientTransferProposalDateResponse.class))) @ApiResponse(responseCode = "400", description = "Bad Request") public String retrieveTransferTemplate(@PathParam("clientId") final Long clientId, @Context final UriInfo uriInfo) { @@ -315,6 +326,7 @@ public String retrieveTransferTemplate(@PathParam("clientId") final Long clientI @Operation(summary = "Retrieve a Client by External Id", operationId = "retrieveOneClientByExternalId", description = "Example Requests:\n" + "\n" + "clients/123-456\n" + "\n" + "\n" + "clients/123-456?template=true\n" + "\n" + "\n" + "clients/123-456?fields=id,displayName,officeName") + @AlternativeOperationId("retrieveOne_12") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsClientIdResponse.class))) public String retrieveOne(@PathParam("externalId") @Parameter(description = "externalId") final String externalId, @Context final UriInfo uriInfo, @@ -328,6 +340,7 @@ public String retrieveOne(@PathParam("externalId") @Parameter(description = "ext @Operation(summary = "Retrieve client accounts overview", operationId = "retrieveAllClientAccountsByExternalId", 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/123-456/accounts\n" + "\n" + "clients/123-456/accounts?fields=loanAccounts,savingsAccounts") + @AlternativeOperationId("retrieveAssociatedAccounts_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientsClientIdAccountsResponse.class))) @ApiResponse(responseCode = "400", description = "Bad Request") public String retrieveAssociatedAccounts(@PathParam("externalId") @Parameter(description = "externalId") final String externalId, @@ -343,6 +356,7 @@ public String retrieveAssociatedAccounts(@PathParam("externalId") @Parameter(des + "\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.") + @AlternativeOperationId("update_11") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PutClientsClientIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PutClientsClientIdResponse.class))) public String update(@Parameter(description = "externalId") @PathParam("externalId") final String externalId, @@ -384,6 +398,7 @@ public String update(@Parameter(description = "externalId") @PathParam("external + "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'") + @AlternativeOperationId("applyCommand") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsClientIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.PostClientsClientIdResponse.class))) public String applyCommand(@PathParam("externalId") @Parameter(description = "externalId") final String externalId, @@ -396,6 +411,7 @@ public String applyCommand(@PathParam("externalId") @Parameter(description = "ex @Path("/external-id/{externalId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Client", operationId = "deleteClientByExternalId", 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.") + @AlternativeOperationId("delete_9") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.DeleteClientsClientIdResponse.class))) public String delete(@PathParam("externalId") @Parameter(description = "externalId") final String externalId) { return deleteClient(null, externalId); @@ -405,6 +421,7 @@ public String delete(@PathParam("externalId") @Parameter(description = "external @Path("/external-id/{externalId}/obligeedetails") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client obligee details", operationId = "retrieveClientObligeeDetailsByExternalId", description = "Retrieve client obligee details using the client external Id") + @AlternativeOperationId("retrieveObligeeDetails_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientObligeeDetailsResponse.class))) @ApiResponse(responseCode = "400", description = "Bad Request") public String retrieveObligeeDetails(@PathParam("externalId") final String externalId, @Context final UriInfo uriInfo) { @@ -415,6 +432,7 @@ public String retrieveObligeeDetails(@PathParam("externalId") final String exter @Path("/external-id/{externalId}/transferproposaldate") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve client transfer template", operationId = "retrieveClientTransferTemplateByExternalId", description = "Retrieve client transfer template using the client external Id") + @AlternativeOperationId("retrieveTransferTemplate_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientsApiResourceSwagger.GetClientTransferProposalDateResponse.class))) @ApiResponse(responseCode = "400", description = "Bad Request") public String retrieveTransferTemplate(@PathParam("externalId") final String externalId, @Context final UriInfo uriInfo) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/InternalClientInformationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/InternalClientInformationApiResource.java index 9839f6869b5..09df22f4f91 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/InternalClientInformationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/InternalClientInformationApiResource.java @@ -36,6 +36,7 @@ import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.boot.FineractProfiles; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -74,6 +75,7 @@ public void afterPropertiesSet() { @Path("{clientId}/audit") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Get internal client audit fields", operationId = "getInternalClientAuditFields") + @AlternativeOperationId("getClientAuditFields") @SuppressFBWarnings("SLF4J_SIGN_ONLY_FORMAT") public String getClientAuditFields(@Context final UriInfo uriInfo, @PathParam("clientId") Long clientId) { log.warn("------------------------------------------------------------"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/v2/search/ClientSearchV2ApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/v2/search/ClientSearchV2ApiResource.java index 5a302e88dd8..7e1e8539d7f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/v2/search/ClientSearchV2ApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/v2/search/ClientSearchV2ApiResource.java @@ -27,6 +27,7 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.service.PagedRequest; import org.apache.fineract.portfolio.client.service.search.domain.ClientSearchData; import org.apache.fineract.portfolio.client.service.search.domain.ClientTextSearch; @@ -47,6 +48,7 @@ public class ClientSearchV2ApiResource implements ClientSearchV2Api { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Search Clients by text", operationId = "searchClientsByText") + @AlternativeOperationId("searchByText") public Page searchByText(@Parameter PagedRequest request) { return delegate.searchByText(request); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/ClientCollateralManagementApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/ClientCollateralManagementApiResource.java index bd9f92a3a4b..925767840eb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/ClientCollateralManagementApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/ClientCollateralManagementApiResource.java @@ -37,6 +37,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.portfolio.collateralmanagement.command.ClientCollateralCreateCommand; import org.apache.fineract.portfolio.collateralmanagement.command.ClientCollateralDeleteCommand; import org.apache.fineract.portfolio.collateralmanagement.command.ClientCollateralUpdateCommand; @@ -64,6 +65,7 @@ public class ClientCollateralManagementApiResource { @GET @Operation(summary = "Get Clients Collateral Products", operationId = "getClientCollateralProducts", description = "Get Collateral Product of a Client") + @AlternativeOperationId("getClientCollateral") public List getClientCollateral( @PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @QueryParam("prodId") @Parameter(description = "prodId") final Long prodId) { @@ -89,6 +91,7 @@ public List getClientCollateralTemplate( @POST @Operation(summary = "Add New Collateral For a Client", operationId = "addClientCollateral", description = "Add New Collateral For a Client") + @AlternativeOperationId("addCollateral") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralCreateResponse.class))) public ClientCollateralCreateResponse addCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, ClientCollateralCreateRequest request) { @@ -101,6 +104,7 @@ public ClientCollateralCreateResponse addCollateral(@PathParam("clientId") @Para @PUT @Path("{collateralId}") @Operation(summary = "Update New Collateral of a Client", operationId = "updateClientCollateral", description = "Update New Collateral of a Client") + @AlternativeOperationId("updateCollateral_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralUpdateResponse.class))) public ClientCollateralUpdateResponse updateCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId, @@ -115,6 +119,7 @@ public ClientCollateralUpdateResponse updateCollateral(@PathParam("clientId") @P @DELETE @Path("{collateralId}") @Operation(summary = "Delete Client Collateral", operationId = "deleteClientCollateral", description = "Delete Client Collateral") + @AlternativeOperationId("deleteCollateral_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ClientCollateralDeleteResponse.class))) public ClientCollateralDeleteResponse deleteCollateral(@PathParam("clientId") @Parameter(description = "clientId") final Long clientId, @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/CollateralManagementApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/CollateralManagementApiResource.java index fc33c590b05..a705b2713c8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/CollateralManagementApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/api/CollateralManagementApiResource.java @@ -34,6 +34,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.organisation.monetary.data.CurrencyData; import org.apache.fineract.organisation.monetary.service.CurrencyReadPlatformService; import org.apache.fineract.portfolio.collateralmanagement.command.CollateralProductCreateCommand; @@ -92,7 +93,8 @@ public List getCollateralTemplate() { @PUT @Path("{collateralId}") - @Operation(summary = "Update Collateral", description = "Update Collateral") + @Operation(operationId = "updateCollateral_1", summary = "Update Collateral", description = "Update Collateral") + @AlternativeOperationId("updateCollateral_2") public CollateralProductUpdateResponse updateCollateral( @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId, @Valid CollateralProductUpdateRequest request) { @@ -104,7 +106,8 @@ public CollateralProductUpdateResponse updateCollateral( @DELETE @Path("{collateralId}") - @Operation(summary = "Delete a Collateral", description = "Delete Collateral") + @Operation(operationId = "deleteCollateral_1", summary = "Delete a Collateral", description = "Delete Collateral") + @AlternativeOperationId("deleteCollateral_2") public CollateralProductDeleteResponse deleteCollateral( @PathParam("collateralId") @Parameter(description = "collateralId") final Long collateralId) { final var request = CollateralProductDeleteRequest.builder().collateralId(collateralId).build(); 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 d4e78e1af8a..96ee759f0f5 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 @@ -55,6 +55,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.DateParam; @@ -130,6 +131,7 @@ public class CentersApiResource { centers/template?officeId=2""") + @AlternativeOperationId("retrieveTemplate_6") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersTemplateResponse.class))) public String retrieveTemplate(@Context final UriInfo uriInfo, @@ -177,6 +179,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo, centers?orderBy=name&sortOrder=DESC""") + @AlternativeOperationId("retrieveAll_23") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersResponse.class))) public String retrieveAll(@Context final UriInfo uriInfo, @@ -235,6 +238,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, centers/1?associations=groupMembers""") + @AlternativeOperationId("retrieveOne_14") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.GetCentersCenterIdResponse.class))) public String retrieveOne(@Context final UriInfo uriInfo, @@ -293,6 +297,7 @@ public String retrieveOne(@Context final UriInfo uriInfo, Mandatory Fields: name, officeId, active, activationDate (if active=true) Optional Fields: externalId, staffId, groupMembers""") + @AlternativeOperationId("create_7") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersResponse.class))) @@ -312,6 +317,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Center", operationId = "updateCenter", description = "Updates a Center") + @AlternativeOperationId("update_12") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PutCentersCenterIdResponse.class))) @@ -330,6 +336,7 @@ public String update(@PathParam("centerId") @Parameter(description = "centerId") @Path("{centerId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Center", operationId = "deleteCenter", description = "A Center can be deleted if it is in pending state and has no association - groups, loans or savings") + @AlternativeOperationId("delete_10") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.DeleteCentersCenterIdResponse.class))) public String delete(@PathParam("centerId") @Parameter(description = "centerId") final Long centerId) { @@ -370,6 +377,7 @@ This API allows associating existing groups to a center. The groups are listed f This Api allows the loan officer to perform bulk repayments of JLG loans for a center on a given meeting date. Showing Request/Response for Close a Center""") + @AlternativeOperationId("activate_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CentersApiResourceSwagger.PostCentersCenterIdResponse.class))) @@ -433,6 +441,7 @@ private boolean is(final String commandParam, final String commandValue) { centers/9/accounts""") + @AlternativeOperationId("retrieveGroupAccount") @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) { @@ -452,6 +461,7 @@ public String retrieveGroupAccount(@PathParam("centerId") @Parameter(description @Path("downloadtemplate") @Produces("application/vnd.ms-excel") @Operation(summary = "Download Centers Bulk Template", operationId = "getBulkTemplateCenter") + @AlternativeOperationId("getCentersTemplate") public Response getCentersTemplate(@QueryParam("officeId") final Long officeId, @QueryParam("staffId") final Long staffId, @QueryParam("dateFormat") final String dateFormat) { return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.CENTERS.toString(), officeId, staffId, dateFormat); @@ -461,6 +471,7 @@ public Response getCentersTemplate(@QueryParam("officeId") final Long officeId, @Path("uploadtemplate") @Consumes(MediaType.MULTIPART_FORM_DATA) @Operation(summary = "Upload Centers Bulk Template", operationId = "postBulkTemplateCenter") + @AlternativeOperationId("postCentersTemplate") @RequestBody(description = "Upload centers template", content = { @Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) }) public String postCentersTemplate(@FormDataParam("file") InputStream uploadedInputStream, 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 72bbbcca8a5..6d42b6d5305 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 @@ -56,6 +56,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.JsonQuery; @@ -139,6 +140,7 @@ public class GroupsApiResource { + "\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") + @AlternativeOperationId("retrieveTemplate_7") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.GetGroupsTemplateResponse.class))) public String retrieveTemplate(@Context final UriInfo uriInfo, @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, @@ -179,6 +181,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo, @Operation(summary = "List Groups", operationId = "retrieveAllGroups", 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") + @AlternativeOperationId("retrieveAll_24") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.GetGroupsResponse.class))) public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("officeId") @Parameter(description = "officeId") final Long officeId, @@ -219,6 +222,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Group", operationId = "retrieveOneGroup", description = "Retrieve group information.\n\n" + "Example Requests:\n\n" + "\n\n" + "groups/1\n\n" + "\n\n" + "groups/1?associations=clientMembers") + @AlternativeOperationId("retrieveOne_15") @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, @@ -320,6 +324,7 @@ public String retrieveOne(@Context final UriInfo uriInfo, @PathParam("groupId") @Operation(summary = "Create a Group", operationId = "createGroup", description = "Creates a Group\n\n" + "Mandatory Fields: name, officeId, active, activationDate (if active=true)\n\n" + "Optional Fields: externalId, staffId, clientMembers") + @AlternativeOperationId("create_8") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsResponse.class))) public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -338,6 +343,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Unassign a Staff", operationId = "unassignLoanOfficerGroup", description = "Allows you to unassign the Staff.\n\n" + "Mandatory Fields: staffId") + @AlternativeOperationId("unassignLoanOfficer") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdCommandUnassignStaffRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdCommandUnassignStaffResponse.class))) public String unassignLoanOfficer(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, @@ -357,6 +363,7 @@ public String unassignLoanOfficer(@PathParam("groupId") @Parameter(description = @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Group", operationId = "updateGroup", description = "Updates a Group") + @AlternativeOperationId("update_13") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PutGroupsGroupIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PutGroupsGroupIdResponse.class))) public String update(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, @@ -374,6 +381,7 @@ public String update(@PathParam("groupId") @Parameter(description = "groupId") f @Path("{groupId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Group", operationId = "deleteGroup", description = "A group can be deleted if it is in pending state and has no associations - clients, loans or savings") + @AlternativeOperationId("delete_11") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.DeleteGroupsGroupIdResponse.class))) public String delete(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId) { @@ -419,6 +427,7 @@ public String delete(@PathParam("groupId") @Parameter(description = "groupId") f + "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") + @AlternativeOperationId("activateOrGenerateCollectionSheet") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GroupsApiResourceSwagger.PostGroupsGroupIdResponse.class))) public String activateOrGenerateCollectionSheet(@PathParam("groupId") @Parameter(description = "groupId") final Long groupId, @@ -495,6 +504,7 @@ private boolean is(final String commandParam, final String commandValue) { @Operation(summary = "Retrieve Group accounts overview", operationId = "retrieveAccountsGroup", 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") + @AlternativeOperationId("retrieveAccounts") @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) { @@ -514,6 +524,7 @@ public String retrieveAccounts(@PathParam("groupId") @Parameter(description = "g @Path("downloadtemplate") @Produces("application/vnd.ms-excel") @Operation(summary = "Download Groups Bulk Template", operationId = "getBulkTemplateGroup") + @AlternativeOperationId("getGroupsTemplate") public Response getGroupsTemplate(@QueryParam("officeId") final Long officeId, @QueryParam("staffId") final Long staffId, @QueryParam("dateFormat") final String dateFormat) { return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.GROUPS.toString(), officeId, staffId, dateFormat); @@ -523,6 +534,7 @@ public Response getGroupsTemplate(@QueryParam("officeId") final Long officeId, @ @Path("uploadtemplate") @Consumes(MediaType.MULTIPART_FORM_DATA) @Operation(summary = "Upload Groups Bulk Template", operationId = "postBulkTemplateGroup") + @AlternativeOperationId("postGroupTemplate") @RequestBody(description = "Upload group template", content = { @Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) }) public String postGroupTemplate(@FormDataParam("file") InputStream uploadedInputStream, @@ -537,6 +549,7 @@ public String postGroupTemplate(@FormDataParam("file") InputStream uploadedInput @Path("{groupId}/glimaccounts") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve GLIM Accounts for Group", operationId = "retrieveGlimAccountsGroup") + @AlternativeOperationId("retrieveglimAccounts") public String retrieveglimAccounts(@PathParam("groupId") final Long groupId, @QueryParam("parentLoanAccountNo") final String parentLoanAccountNo, @Context final UriInfo uriInfo) { context.authenticatedUser().validateHasReadPermission("GROUP"); @@ -560,6 +573,7 @@ public String retrieveglimAccounts(@PathParam("groupId") final Long groupId, @Path("{groupId}/gsimaccounts") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve GSIM Accounts for Group", operationId = "retrieveGsimAccountsGroup") + @AlternativeOperationId("retrieveGsimAccounts") public String retrieveGsimAccounts(@PathParam("groupId") final Long groupId, @QueryParam("parentGSIMAccountNo") final String parentGSIMAccountNo, @QueryParam("parentGSIMId") final Long parentGSIMId, @Context final UriInfo uriInfo) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsLevelApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsLevelApiResource.java index fbad3bf166b..c3742ed1059 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsLevelApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/api/GroupsLevelApiResource.java @@ -26,6 +26,7 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.group.data.GroupLevelData; import org.apache.fineract.portfolio.group.service.GroupLevelReadPlatformService; @@ -43,6 +44,7 @@ public class GroupsLevelApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve All Group Levels", operationId = "retrieveAllGroupLevels") + @AlternativeOperationId("retrieveAllGroups") public List retrieveAllGroups() { this.context.authenticatedUser().validateHasReadPermission("GROUP"); 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 2df192ebe4a..40cb14e1bfe 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 @@ -36,6 +36,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.portfolio.interestratechart.command.InterestRateChartSlabsCreateCommand; import org.apache.fineract.portfolio.interestratechart.command.InterestRateChartSlabsDeleteCommand; import org.apache.fineract.portfolio.interestratechart.command.InterestRateChartSlabsUpdateCommand; @@ -65,6 +66,7 @@ public class InterestRateChartSlabsApiResource { @GET @Path("template") @Operation(summary = "Retrieve Chart Slab Template", operationId = "retrieveTemplateInterestRateChartSlab") + @AlternativeOperationId("template_8") public InterestRateChartSlabData template(@PathParam("chartId") final Long chartId) { return interestRateChartSlabsReadService.retrieveTemplate(); } @@ -72,6 +74,7 @@ public InterestRateChartSlabData template(@PathParam("chartId") final Long chart @GET @Operation(summary = "Retrieve all Slabs", operationId = "retrieveAllInterestRateChartSlabs", description = "Retrieve list of slabs associated with a chart\n" + "\n" + "Example Requests:\n" + "\n" + "interestratecharts/1/chartslabs") + @AlternativeOperationId("retrieveAll_25") public List retrieveAll(@PathParam("chartId") final Long chartId) { return interestRateChartSlabsReadService.retrieveAll(chartId); } @@ -85,6 +88,7 @@ public List retrieveAll(@PathParam("chartId") final L - interestratecharts/1/chartslabs/1 """) + @AlternativeOperationId("retrieveOne_16") public InterestRateChartSlabData retrieveOne(@PathParam("chartId") final Long chartId, @PathParam("chartSlabId") final Long chartSlabId) { return interestRateChartSlabsReadService.retrieveOne(chartId, chartSlabId); @@ -110,6 +114,7 @@ public InterestRateChartSlabData retrieveOne(@PathParam("chartId") final Long ch - interestratecharts/1/chartslabs """) + @AlternativeOperationId("create_9") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsCreateResponse.class))) public InterestRateChartSlabsCreateResponse create(@PathParam("chartId") final Long chartId, final InterestRateChartSlabsCreateRequest request) { @@ -124,6 +129,7 @@ public InterestRateChartSlabsCreateResponse create(@PathParam("chartId") final L @Path("{chartSlabId}") @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Slab", operationId = "updateInterestRateChartSlab", description = "It updates the Slab from chart") + @AlternativeOperationId("update_14") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsUpdateResponse.class))) public InterestRateChartSlabsUpdateResponse update(@PathParam("chartId") final Long chartId, @PathParam("chartSlabId") final Long chartSlabId, final InterestRateChartSlabsUpdateRequest request) { @@ -141,6 +147,7 @@ public InterestRateChartSlabsUpdateResponse update(@PathParam("chartId") final L @DELETE @Path("{chartSlabId}") @Operation(summary = "Delete a Slab", operationId = "deleteInterestRateChartSlab", description = "Delete a Slab from a chart") + @AlternativeOperationId("delete_12") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartSlabsDeleteResponse.class))) public InterestRateChartSlabsDeleteResponse delete(@PathParam("chartId") final Long chartId, @PathParam("chartSlabId") final Long chartSlabId) { 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 08639d50c9e..b5d605adf31 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 @@ -39,6 +39,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants; import org.apache.fineract.portfolio.interestratechart.command.InterestRateChartCreateCommand; import org.apache.fineract.portfolio.interestratechart.command.InterestRateChartDeleteCommand; @@ -70,6 +71,7 @@ public class InterestRateChartsApiResource { 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: Field Defaults Allowed Value Lists Example Request: interestratecharts/template """) + @AlternativeOperationId("template_9") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.GetInterestRateChartsTemplateResponse.class))) public InterestRateChartData template() { return chartReadPlatformService.template(); @@ -80,6 +82,7 @@ public InterestRateChartData template() { Retrieve list of charts associated with a term deposit product(FD or RD). Example Requests: interestratecharts?productId=1 """) + @AlternativeOperationId("retrieveAll_26") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.class)))) public Collection retrieveAll(@QueryParam("productId") final Long productId) { @@ -90,6 +93,7 @@ public Collection retrieveAll(@QueryParam("productId") fi @Path("{chartId}") @Operation(summary = "Retrieve a Chart", operationId = "retrieveOneInterestRateChart", description = "It retrieves the Interest Rate Chart\n" + "Example Requests:\n" + "\n" + "interestratecharts/1") + @AlternativeOperationId("retrieveOne_17") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartsApiResourceSwagger.GetInterestRateChartsResponse.class))) public InterestRateChartData retrieveOne(@PathParam("chartId") final Long chartId, @QueryParam("associations") final String associations) { @@ -105,6 +109,7 @@ public InterestRateChartData retrieveOne(@PathParam("chartId") final Long chartI @POST @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a Chart", operationId = "createInterestRateChart", description = "Creates a new chart which can be attached to a term deposit products (FD or RD).") + @AlternativeOperationId("create_10") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartCreateResponse.class))) public InterestRateChartCreateResponse create(final InterestRateChartCreateRequest request) { @@ -118,6 +123,7 @@ public InterestRateChartCreateResponse create(final InterestRateChartCreateReque @Path("{chartId}") @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Chart", operationId = "updateInterestRateChart", description = "It updates the chart") + @AlternativeOperationId("update_15") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartUpdateResponse.class))) public InterestRateChartUpdateResponse update(@PathParam("chartId") final Long chartId, final InterestRateChartUpdateRequest request) { request.setId(chartId); @@ -130,6 +136,7 @@ public InterestRateChartUpdateResponse update(@PathParam("chartId") final Long c @DELETE @Path("{chartId}") @Operation(summary = "Delete a Chart", operationId = "deleteInterestRateChart", description = "It deletes the chart") + @AlternativeOperationId("delete_13") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = InterestRateChartDeleteResponse.class))) public InterestRateChartDeleteResponse delete(@PathParam("chartId") final Long chartId) { final var command = new InterestRateChartDeleteCommand(); 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 4e83d58a700..e4745522dd7 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 @@ -47,6 +47,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.domain.ExternalId; @@ -108,6 +109,7 @@ public String retrieveAllLoanCharges(@PathParam("loanId") @Parameter(description @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Loan Charges", operationId = "retrieveAllLoanChargesByLoanExternalId", 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") + @AlternativeOperationId("retrieveAllLoanCharges_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class)))) public String retrieveAllLoanCharges( @PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -121,6 +123,7 @@ public String retrieveAllLoanCharges( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Loan Charges Template", operationId = "retrieveTemplateLoanCharge", 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") + @AlternativeOperationId("retrieveTemplate_8") @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) { @@ -133,6 +136,7 @@ public String retrieveTemplate(@PathParam("loanId") @Parameter(description = "lo @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Loan Charges Template", operationId = "retrieveTemplateLoanChargeByLoanExternalId", 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") + @AlternativeOperationId("retrieveTemplate_9") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesTemplateResponse.class))) public String retrieveTemplate(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @Context final UriInfo uriInfo) { @@ -145,6 +149,7 @@ public String retrieveTemplate(@PathParam("loanExternalId") @Parameter(descripti @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Loan Charge", operationId = "retrieveOneLoanCharge", description = "Retrieves Loan Charge according to the Loan ID and Loan Charge ID" + "Example Requests:\n" + "\n" + "/loans/1/charges/1\n" + "\n" + "\n" + "/loans/1/charges/1?fields=name,amountOrPercentage") + @AlternativeOperationId("retrieveLoanCharge") @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("loanChargeId") @Parameter(description = "loanChargeId") final Long loanChargeId, @Context final UriInfo uriInfo) { @@ -158,6 +163,7 @@ public String retrieveLoanCharge(@PathParam("loanId") @Parameter(description = " @Operation(summary = "Retrieve a Loan Charge", operationId = "retrieveOneLoanChargeByChargeExternalId", description = "Retrieves Loan Charge according to the Loan ID and Loan Charge External ID" + "Example Requests:\n" + "\n" + "/loans/1/charges/1\n" + "\n" + "\n" + "/loans/1/charges/external-id/1?fields=name,amountOrPercentage") + @AlternativeOperationId("retrieveLoanCharge_1") @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("loanChargeExternalId") @Parameter(description = "loanChargeExternalId") final String loanChargeExternalId, @@ -171,6 +177,7 @@ public String retrieveLoanCharge(@PathParam("loanId") @Parameter(description = " @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Loan Charge", operationId = "retrieveOneLoanChargeByLoanExternalId", description = "Retrieves Loan Charge according to the Loan external ID and Loan Charge ID" + "Example Requests:\n" + "\n" + "/loans/1/charges/1\n" + "\n" + "\n" + "/loans/1/charges/1?fields=name,amountOrPercentage") + @AlternativeOperationId("retrieveLoanCharge_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class))) public String retrieveLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @PathParam("loanChargeId") @Parameter(description = "loanChargeId") final Long loanChargeId, @Context final UriInfo uriInfo) { @@ -183,6 +190,7 @@ public String retrieveLoanCharge(@PathParam("loanExternalId") @Parameter(descrip @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Loan Charge", operationId = "retrieveOneLoanChargeByLoanAndChargeExternalId", description = "Retrieves Loan Charge according to the Loan External ID and Loan Charge External ID" + "Example Requests:\n" + "\n" + "/loans/1/charges/1\n" + "\n" + "\n" + "/loans/1/charges/1?fields=name,amountOrPercentage") + @AlternativeOperationId("retrieveLoanCharge_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.GetLoansLoanIdChargesChargeIdResponse.class))) public String retrieveLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @PathParam("loanChargeExternalId") @Parameter(description = "loanChargeExternalId") final String loanChargeExternalId, @@ -196,6 +204,7 @@ public String retrieveLoanCharge(@PathParam("loanExternalId") @Parameter(descrip @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a Loan Charge (no command provided) or Pay a charge (command=pay)", operationId = "createOrPayLoanCharge", description = "Creates a Loan Charge | Pay a Loan Charge") + @AlternativeOperationId("executeLoanCharge") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesResponse.class))) public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @@ -210,6 +219,7 @@ public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "l @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a Loan Charge (no command provided) or Pay a charge (command=pay)", operationId = "executeLoanChargeByLoanExternalId", description = "Creates a Loan Charge | Pay a Loan Charge") + @AlternativeOperationId("executeLoanCharge_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesResponse.class))) public String executeLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -224,6 +234,7 @@ public String executeLoanCharge(@PathParam("loanExternalId") @Parameter(descript @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Pay / Waive / Adjustment for Loan Charge", operationId = "executeLoanChargeOnExistingCharge", description = "Loan Charge will be paid if the loan is linked with a savings account | Waive Loan Charge | Add Charge Adjustment") + @AlternativeOperationId("executeLoanCharge_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdResponse.class))) public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @@ -239,6 +250,7 @@ public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "l @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Pay / Waive / Adjustment for Loan Charge", operationId = "executeLoanChargeByChargeExternalId", description = "Loan Charge will be paid if the loan is linked with a savings account | Waive Loan Charge | Add Charge Adjustment") + @AlternativeOperationId("executeLoanCharge_3") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdResponse.class))) public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @@ -254,6 +266,7 @@ public String executeLoanCharge(@PathParam("loanId") @Parameter(description = "l @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Pay / Waive / Adjustment for Loan Charge", operationId = "executeLoanChargeByLoanExternalIdOnExistingCharge", description = "Loan Charge will be paid if the loan is linked with a savings account | Waive Loan Charge | Add Charge Adjustment") + @AlternativeOperationId("executeLoanCharge_4") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdResponse.class))) public String executeLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -269,6 +282,7 @@ public String executeLoanCharge(@PathParam("loanExternalId") @Parameter(descript @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Pay / Waive / Adjustment for Loan Charge", operationId = "executeLoanChargeByLoanAndChargeExternalId", description = "Loan Charge will be paid if the loan is linked with a savings account | Waive Loan Charge | Add Charge Adjustment") + @AlternativeOperationId("executeLoanCharge_5") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PostLoansLoanIdChargesChargeIdResponse.class))) public String executeLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -298,6 +312,7 @@ public String updateLoanCharge(@PathParam("loanId") @Parameter(description = "lo @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Loan Charge", operationId = "updateLoanChargeByChargeExternalId", description = "Currently Loan Charges may be updated only if the Loan is not yet approved") + @AlternativeOperationId("updateLoanCharge_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdResponse.class))) public String updateLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId, @@ -312,6 +327,7 @@ public String updateLoanCharge(@PathParam("loanId") @Parameter(description = "lo @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Loan Charge", operationId = "updateLoanChargeByLoanExternalId", description = "Currently Loan Charges may be updated only if the Loan is not yet approved") + @AlternativeOperationId("updateLoanCharge_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdResponse.class))) public String updateLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -326,6 +342,7 @@ public String updateLoanCharge(@PathParam("loanExternalId") @Parameter(descripti @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Loan Charge", operationId = "updateLoanChargeByLoanAndChargeExternalId", description = "Currently Loan Charges may be updated only if the Loan is not yet approved") + @AlternativeOperationId("updateLoanCharge_3") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.PutLoansLoanIdChargesChargeIdResponse.class))) public String updateLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @@ -350,6 +367,7 @@ public String deleteLoanCharge(@PathParam("loanId") @Parameter(description = "lo @Path("{loanId}/charges/external-id/{loanChargeExternalId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Loan Charge", operationId = "deleteLoanChargeByChargeExternalId", description = "Note: Currently, A Loan Charge may only be removed from Loans that are not yet approved.") + @AlternativeOperationId("deleteLoanCharge_1") @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("loanChargeExternalId") @Parameter(description = "loanChargeExternalId") final String loanChargeExternalId) { @@ -361,6 +379,7 @@ public String deleteLoanCharge(@PathParam("loanId") @Parameter(description = "lo @Path("external-id/{loanExternalId}/charges/{loanChargeId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Loan Charge", operationId = "deleteLoanChargeByLoanExternalId", description = "Note: Currently, A Loan Charge may only be removed from Loans that are not yet approved.") + @AlternativeOperationId("deleteLoanCharge_2") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.DeleteLoansLoanIdChargesChargeIdResponse.class))) public String deleteLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @PathParam("loanChargeId") @Parameter(description = "loanChargeId") final Long loanChargeId) { @@ -372,6 +391,7 @@ public String deleteLoanCharge(@PathParam("loanExternalId") @Parameter(descripti @Path("external-id/{loanExternalId}/charges/external-id/{loanChargeExternalId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Loan Charge", operationId = "deleteLoanChargeByLoanAndChargeExternalId", description = "Note: Currently, A Loan Charge may only be removed from Loans that are not yet approved.") + @AlternativeOperationId("deleteLoanCharge_3") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanChargesApiResourceSwagger.DeleteLoansLoanIdChargesChargeIdResponse.class))) public String deleteLoanCharge(@PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId, @PathParam("loanChargeExternalId") @Parameter(description = "loanChargeExternalId") final String loanChargeExternalId) { 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 d2c1929ccd2..a5d6ae3a16c 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 @@ -52,6 +52,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.DateParam; import org.apache.fineract.infrastructure.core.api.jersey.Pagination; @@ -131,6 +132,7 @@ public class LoanTransactionsApiResource { + "\n" + "loans/1/transactions/template?command=creditBalanceRefund (returned 'amount' field will have the overpaid value)" + "\n" + "loans/1/transactions/template?command=charge-off" + "\n" + "loans/1/transactions/template?command=downPayment" + "\n" + "loans/1/transactions/template?command=interest-refund") + @AlternativeOperationId("retrieveTransactionTemplate") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTemplateResponse.class))) }) public String retrieveTransactionTemplate(@PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @@ -161,6 +163,7 @@ public String retrieveTransactionTemplate(@PathParam("loanId") @Parameter(descri + "\n" + "loans/1/transactions/template?command=creditBalanceRefund (returned 'amount' field will have the overpaid value)" + "\n" + "loans/1/transactions/template?command=charge-off" + "\n" + "loans/1/transactions/template?command=downPayment" + "\n" + "loans/1/transactions/template?command=interest-refund") + @AlternativeOperationId("retrieveTransactionTemplate_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTemplateResponse.class))) }) public String retrieveTransactionTemplate( @@ -182,6 +185,7 @@ public String retrieveTransactionTemplate( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Transaction Details", operationId = "retrieveOneLoanTransaction", description = "Retrieves a Transaction Details\n\n" + "Example Request:\n" + "\n" + "loans/5/transactions/3") + @AlternativeOperationId("retrieveTransaction") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTransactionIdResponse.class))) }) public String retrieveTransaction(@PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @@ -197,6 +201,7 @@ public String retrieveTransaction(@PathParam("loanId") @Parameter(description = @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Transaction Details", operationId = "retrieveOneLoanTransactionByExternalId", description = "Retrieves a Transaction Details\n\n" + "Example Request:\n" + "\n" + "loans/5/transactions/external-id/5dd80a7c-ccba-4446-b378-01eb6f53e871") + @AlternativeOperationId("retrieveTransactionByTransactionExternalId") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTransactionIdResponse.class))) }) public String retrieveTransactionByTransactionExternalId( @@ -213,6 +218,7 @@ public String retrieveTransactionByTransactionExternalId( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Transaction Details", operationId = "retrieveOneLoanTransactionByLoanExternalId", description = "Retrieves a Transaction Details\n\n" + "Example Request:\n" + "\n" + "loans/5/transactions/3") + @AlternativeOperationId("retrieveTransactionByLoanExternalIdAndTransactionId") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTransactionIdResponse.class))) }) public String retrieveTransactionByLoanExternalIdAndTransactionId( @@ -230,6 +236,7 @@ public String retrieveTransactionByLoanExternalIdAndTransactionId( @Operation(summary = "Retrieve a Transaction Details", operationId = "retrieveOneLoanTransactionByLoanExternalIdAndTransactionExternalId", description = "Retrieves a Transaction Details\n\n" + "Example Request:\n" + "\n" + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions/external-id/5dd80a7c-ccba-4446-b378-01eb6f53e871") + @AlternativeOperationId("retrieveTransactionByLoanExternalIdAndTransactionExternalId") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsTransactionIdResponse.class))) }) public String retrieveTransactionByLoanExternalIdAndTransactionExternalId( @@ -245,6 +252,7 @@ public String retrieveTransactionByLoanExternalIdAndTransactionExternalId( @Path("{loanId}/transactions") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Transactions", operationId = "retrieveAllLoanTransactions", description = "Retrieves transactions of a loan") + @AlternativeOperationId("retrieveTransactionsByLoanId") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsResponse.class))) }) public Page retrieveTransactionsByLoanId( @@ -261,6 +269,7 @@ public Page retrieveTransactionsByLoanId( @Path("external-id/{loanExternalId}/transactions") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Transactions", operationId = "retrieveAllLoanTransactionsByExternalId", description = "Retrieves transactions of a loan") + @AlternativeOperationId("retrieveTransactionsByExternalLoanId") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.GetLoansLoanIdTransactionsResponse.class))) }) public Page retrieveTransactionsByExternalLoanId( @@ -291,6 +300,7 @@ public Page retrieveTransactionsByExternalLoanId( + "loans/1/transactions?command=creditBalanceRefund" + " | Credit Balance Refund" + " | \n" + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions?command=charge-off" + " | Charge-off Loan" + " | \n" + "loans/1/transactions?command=downPayment" + " | Down Payment" + " | \n") + @AlternativeOperationId("executeLoanTransaction") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class))) }) @@ -326,6 +336,7 @@ public String executeLoanTransaction(@PathParam("loanId") @Parameter(description + " | \n" + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions?command=charge-off" + " | Charge-off Loan" + " | \n" + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854/transactions?command=downPayment" + " | Down Payment" + " | \n") + @AlternativeOperationId("executeLoanTransaction_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class))) }) @@ -360,6 +371,7 @@ public String adjustLoanTransaction(@PathParam("loanId") @Parameter(description @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Adjust a Transaction", operationId = "adjustLoanTransactionByLoanExternalId", description = "Note: there is no need to specify command={transactionType} parameter.\n\n" + "Mandatory Fields: transactionDate, transactionAmount") + @AlternativeOperationId("adjustLoanTransaction_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class))) }) @@ -378,6 +390,7 @@ public String adjustLoanTransaction( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Adjust a Transaction", operationId = "adjustLoanTransactionByTransactionExternalId", description = "Note: there is no need to specify command={transactionType} parameter.\n\n" + "Mandatory Fields: transactionDate, transactionAmount") + @AlternativeOperationId("adjustLoanTransaction_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class))) }) @@ -395,6 +408,7 @@ public String adjustLoanTransaction(@PathParam("loanId") @Parameter(description @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Adjust a Transaction", operationId = "adjustLoanTransactionByLoanAndTransactionExternalId", description = "Note: there is no need to specify command={transactionType} parameter.\n\n" + "Mandatory Fields: transactionDate, transactionAmount") + @AlternativeOperationId("adjustLoanTransaction_3") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsTransactionIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PostLoansLoanIdTransactionsResponse.class))) }) @@ -412,6 +426,7 @@ public String adjustLoanTransaction( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Waive Charge Transaction", operationId = "undoWaiveChargeLoanTransaction", description = "Undo a Waive Charge Transaction") + @AlternativeOperationId("undoWaiveCharge") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesResponse.class))) }) @@ -426,6 +441,7 @@ public String undoWaiveCharge(@PathParam("loanId") @Parameter(description = "loa @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Waive Charge Transaction", operationId = "undoWaiveChargeLoanTransactionByLoanExternalId", description = "Undo a Waive Charge Transaction") + @AlternativeOperationId("undoWaiveCharge_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesResponse.class))) }) @@ -441,6 +457,7 @@ public String undoWaiveCharge( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Waive Charge Transaction", operationId = "undoWaiveChargeLoanTransactionByTransactionExternalId", description = "Undo a Waive Charge Transaction") + @AlternativeOperationId("undoWaiveCharge_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesResponse.class))) }) @@ -455,6 +472,7 @@ public String undoWaiveCharge(@PathParam("loanId") @Parameter(description = "loa @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Undo a Waive Charge Transaction", operationId = "undoWaiveChargeLoanTransactionByLoanAndTransactionExternalId", description = "Undo a Waive Charge Transaction") + @AlternativeOperationId("undoWaiveCharge_3") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanTransactionsApiResourceSwagger.PutChargeTransactionChangesResponse.class))) }) @@ -785,6 +803,7 @@ private Long getResolvedLoanIdWithExistsCheck(final Long loanId, final ExternalI @Path("{loanId}/transactions/reage-preview") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Preview Re-Age Schedule", operationId = "previewReAgeLoanSchedule", description = "Generates a preview of the re-aged loan schedule based on the provided parameters without creating any transactions or modifying the loan.") + @AlternativeOperationId("previewReAgeSchedule") public LoanScheduleData previewReAgeSchedule(@PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @Valid @BeanParam final ReAgePreviewRequest reAgePreviewRequest) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -795,6 +814,7 @@ public LoanScheduleData previewReAgeSchedule(@PathParam("loanId") @Parameter(des @Path("external-id/{loanExternalId}/transactions/reage-preview") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Preview Re-Age Schedule", operationId = "previewReAgeLoanScheduleByLoanExternalId", description = "Generates a preview of the re-aged loan schedule based on the provided parameters without creating any transactions or modifying the loan.") + @AlternativeOperationId("previewReAgeSchedule_1") public LoanScheduleData previewReAgeSchedule( @PathParam("loanExternalId") @Parameter(description = "loanExternalId", required = true) final String loanExternalId, @Valid @BeanParam final ReAgePreviewRequest reAgePreviewRequest) { @@ -806,6 +826,7 @@ public LoanScheduleData previewReAgeSchedule( @Path("{loanId}/transactions/reamortization-preview") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Preview Re-Amortized Schedule", operationId = "previewReAmortizeLoanSchedule", description = "Generates a preview of the re-amortized loan schedule based on the provided parameters without creating any transactions or modifying the loan.") + @AlternativeOperationId("previewReAmortizationSchedule") public LoanScheduleData previewReAmortizationSchedule( @PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @Valid @BeanParam final ReAmortizationPreviewRequest reAmortizationPreviewRequest) { @@ -817,6 +838,7 @@ public LoanScheduleData previewReAmortizationSchedule( @Path("external-id/{loanExternalId}/transactions/reamortization-preview") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Preview Re-amortized Schedule", operationId = "previewReAmortizeLoanScheduleByLoanExternalId", description = "Generates a preview of the re-amortized loan schedule based on the provided parameters without creating any transactions or modifying the loan.") + @AlternativeOperationId("previewReAmortizationSchedule_1") public LoanScheduleData previewReAmortizationSchedule( @PathParam("loanExternalId") @Parameter(description = "loanExternalId", required = true) final String loanExternalId, @Valid @BeanParam final ReAmortizationPreviewRequest reAmortizationPreviewRequest) { 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 5086524fbec..bf01e5c2a8a 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 @@ -70,6 +70,7 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiFacingEnum; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; @@ -341,6 +342,7 @@ public String retrieveApprovalTemplate(@PathParam("loanId") @Parameter(descripti + "\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") + @AlternativeOperationId("template_10") @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, @@ -467,6 +469,7 @@ private Collection getAccountLinkingOptions(final LoanAcco + "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") + @AlternativeOperationId("retrieveLoan") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansLoanIdResponse.class))) }) public String retrieveLoan(@PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @@ -484,6 +487,7 @@ public String retrieveLoan(@PathParam("loanId") @Parameter(description = "loanId @Operation(summary = "List Loans", operationId = "retrieveAllLoans", 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") + @AlternativeOperationId("retrieveAll_27") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansResponse.class))) }) public String retrieveAll(@Context final UriInfo uriInfo, @@ -559,6 +563,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, + "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") + @AlternativeOperationId("calculateLoanScheduleOrSubmitLoanApplication") @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))) }) @@ -588,6 +593,7 @@ public String calculateLoanScheduleOrSubmitLoanApplication( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Modify a loan application", operationId = "updateLoanApplication", 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.") + @AlternativeOperationId("modifyLoanApplication") @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))) }) @@ -623,6 +629,7 @@ public String deleteLoanApplication(@PathParam("loanId") @Parameter(description + "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") + @AlternativeOperationId("stateTransitions") @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))) }) @@ -662,6 +669,7 @@ public String getGlimRepaymentTemplate(@PathParam("glimId") final Long glimId, @ + "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") + @AlternativeOperationId("glimStateTransitions") @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))) }) @@ -732,6 +740,7 @@ public String postLoanRepaymentTemplate(@FormDataParam("file") InputStream uploa @Path("{loanId}/delinquencytags") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve the Loan Delinquency Tag history using the Loan Id", operationId = "retrieveDelinquencyTagHistoryLoan", description = "") + @AlternativeOperationId("getDelinquencyTagHistory") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DelinquencyApiResourceSwagger.GetDelinquencyTagHistoryResponse.class)))) }) public String getDelinquencyTagHistory(@PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @@ -744,6 +753,7 @@ public String getDelinquencyTagHistory(@PathParam("loanId") @Parameter(descripti @Path("external-id/{loanExternalId}/template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Loan Approval Template", operationId = "retrieveApprovalTemplateByExternalId") + @AlternativeOperationId("retrieveApprovalTemplate_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansApprovalTemplateResponse.class))) }) public String retrieveApprovalTemplate( @@ -762,6 +772,7 @@ public String retrieveApprovalTemplate( + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854?associations=all\n" + "\n" + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854?associations=all&exclude=guarantors\n" + "\n" + "\n" + "loans/external-id/7dd80a7c-ycba-a446-t378-91eb6f53e854?fields=id,principal,annualInterestRate&associations=repaymentSchedule,transactions") + @AlternativeOperationId("retrieveLoan_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.GetLoansLoanIdResponse.class))) }) public String retrieveLoan( @@ -780,6 +791,7 @@ public String retrieveLoan( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Modify a loan application", operationId = "updateLoanApplicationByExternalId", 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.") + @AlternativeOperationId("modifyLoanApplication_1") @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))) }) @@ -794,6 +806,7 @@ public String modifyLoanApplication( @Path("external-id/{loanExternalId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Loan Application", operationId = "deleteLoanApplicationByExternalId", description = "Note: Only loans in \"Submitted and awaiting approval\" status can be deleted.") + @AlternativeOperationId("deleteLoanApplication_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.DeleteLoansLoanIdResponse.class))) }) public String deleteLoanApplication( @@ -817,6 +830,7 @@ public String deleteLoanApplication( + "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") + @AlternativeOperationId("stateTransitions_1") @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))) }) @@ -831,6 +845,7 @@ public String stateTransitions( @Path("external-id/{loanExternalId}/delinquencytags") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve the Loan Delinquency Tag history using the Loan Id", operationId = "retrieveDelinquencyTagHistoryLoanByExternalId", description = "") + @AlternativeOperationId("getDelinquencyTagHistory_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DelinquencyApiResourceSwagger.GetDelinquencyTagHistoryResponse.class)))) }) public String getDelinquencyTagHistory( @@ -843,6 +858,7 @@ public String getDelinquencyTagHistory( @Path("{loanId}/delinquency-actions") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve delinquency actions related to the loan", operationId = "retrieveDelinquencyActionsLoan", description = "") + @AlternativeOperationId("getLoanDelinquencyActions") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DelinquencyApiResourceSwagger.GetDelinquencyActionsResponse.class)))) }) public String getLoanDelinquencyActions(@PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @@ -854,6 +870,7 @@ public String getLoanDelinquencyActions(@PathParam("loanId") @Parameter(descript @Path("external-id/{loanExternalId}/delinquency-actions") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Retrieve delinquency actions related to the loan", operationId = "retrieveDelinquencyActionsLoanByExternalId", description = "") + @AlternativeOperationId("getLoanDelinquencyActions_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DelinquencyApiResourceSwagger.GetDelinquencyActionsResponse.class)))) }) public String getLoanDelinquencyActions( @@ -867,6 +884,7 @@ public String getLoanDelinquencyActions( @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Adds a new delinquency action for a loan", operationId = "createDelinquencyActionLoan", description = "") + @AlternativeOperationId("createLoanDelinquencyAction") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PostLoansDelinquencyActionRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PostLoansDelinquencyActionResponse.class))) }) @@ -880,6 +898,7 @@ public String createLoanDelinquencyAction(@PathParam("loanId") @Parameter(descri @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Adds a new delinquency action for a loan", operationId = "createDelinquencyActionLoanByExternalId", description = "") + @AlternativeOperationId("createLoanDelinquencyAction_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PostLoansDelinquencyActionRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = DelinquencyApiResourceSwagger.PostLoansDelinquencyActionResponse.class))) }) @@ -894,6 +913,7 @@ public String createLoanDelinquencyAction( @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Modifies the approved amount of the loan", operationId = "updateApprovedAmountLoan", description = "") + @AlternativeOperationId("modifyLoanApprovedAmount") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansApprovedAmountRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansApprovedAmountResponse.class))) }) @@ -908,6 +928,7 @@ public CommandProcessingResult modifyLoanApprovedAmount( @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Modifies the approved amount of the loan", operationId = "updateApprovedAmountLoanByExternalId", description = "") + @AlternativeOperationId("modifyLoanApprovedAmount_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansApprovedAmountRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansApprovedAmountResponse.class))) }) @@ -921,6 +942,7 @@ public CommandProcessingResult modifyLoanApprovedAmount( @Path("{loanId}/approved-amount") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Collects and returns the approved amount modification history for a given loan", operationId = "retrieveApprovedAmountHistoryLoan", description = "") + @AlternativeOperationId("getLoanApprovedAmountHistory") public List getLoanApprovedAmountHistory( @PathParam("loanId") @Parameter(description = "loanId", required = true) final Long loanId, @Context final UriInfo uriInfo) { return getLoanApprovedAmountHistory(loanId, ExternalId.empty()); @@ -930,6 +952,7 @@ public List getLoanApprovedAmountHistory( @Path("external-id/{loanExternalId}/approved-amount") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Collects and returns the approved amount modification history for a given loan", operationId = "retrieveApprovedAmountHistoryLoanByExternalId", description = "") + @AlternativeOperationId("getLoanApprovedAmountHistory_1") public List getLoanApprovedAmountHistory( @PathParam("loanExternalId") @Parameter(description = "loanExternalId", required = true) final String loanExternalId, @Context final UriInfo uriInfo) { @@ -941,6 +964,7 @@ public List getLoanApprovedAmountHistory( @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Modifies the available disbursement amount of the loan", operationId = "updateAvailableDisbursementAmountLoan", description = "Modifies the available disbursement amount of the loan, this indirectly modifies the approved amount that can be disbursed on the loan") + @AlternativeOperationId("modifyLoanAvailableDisbursementAmount") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansAvailableDisbursementAmountRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansAvailableDisbursementAmountResponse.class))) }) @@ -955,6 +979,7 @@ public CommandProcessingResult modifyLoanAvailableDisbursementAmount( @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Modifies the available disbursement amount of the loan", operationId = "updateAvailableDisbursementAmountLoanByExternalId", description = "Modifies the available disbursement amount of the loan, this indirectly modifies the approved amount that can be disbursed on the loan") + @AlternativeOperationId("modifyLoanAvailableDisbursementAmount_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansAvailableDisbursementAmountRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoansApiResourceSwagger.PutLoansAvailableDisbursementAmountResponse.class))) }) 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 8de23cadc06..14c06149a86 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 @@ -60,6 +60,7 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiFacingEnum; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; @@ -229,6 +230,7 @@ public String retrieveAllLoanProducts(@Context final UriInfo uriInfo) { @Produces({ MediaType.APPLICATION_JSON }) @Operation(operationId = "retrieveTemplateLoanProduct", 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") + @AlternativeOperationId("retrieveTemplate_11") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.GetLoanProductsTemplateResponse.class))) }) public String retrieveTemplate(@Context final UriInfo uriInfo, @@ -257,6 +259,7 @@ public String retrieveTemplate(@Context final UriInfo uriInfo, @Operation(summary = "Retrieve a Loan Product", operationId = "retrieveOneLoanProduct", 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") + @AlternativeOperationId("retrieveLoanProductDetails") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.GetLoanProductsProductIdResponse.class))) }) public String retrieveLoanProductDetails(@PathParam("productId") @Parameter(description = "productId") final Long productId, @@ -288,6 +291,7 @@ public String updateLoanProduct(@PathParam("productId") @Parameter(description = + "Example Requests:\n" + "\n" + "loanproducts/external-id/2075e308-d4a8-44d9-8203-f5a947b8c2f4\n" + "\n" + "\n" + "loanproducts/external-id/2075e308-d4a8-44d9-8203-f5a947b8c2f4?template=true\n" + "\n" + "\n" + "loanproducts/external-id/2075e308-d4a8-44d9-8203-f5a947b8c2f4?fields=name,description,numberOfRepayments") + @AlternativeOperationId("retrieveLoanProductDetails_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.GetLoanProductsProductIdResponse.class))) }) public String retrieveLoanProductDetails( @@ -311,6 +315,7 @@ public String retrieveLoanProductDetails( @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(operationId = "updateLoanProductByExternalId", summary = "Update a Loan Product", description = "Updates a Loan Product") + @AlternativeOperationId("updateLoanProduct_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.PutLoanProductsProductIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanProductsApiResourceSwagger.PutLoanProductsProductIdResponse.class))) }) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/api/ProductMixApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/api/ProductMixApiResource.java index 4a1635d54ac..a84fb68e23f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/api/ProductMixApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/api/ProductMixApiResource.java @@ -36,6 +36,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.portfolio.loanproduct.data.LoanProductData; import org.apache.fineract.portfolio.loanproduct.productmix.command.ProductMixCreateCommand; import org.apache.fineract.portfolio.loanproduct.productmix.command.ProductMixDeleteCommand; @@ -64,6 +65,7 @@ public class ProductMixApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Product Mix Template", operationId = "retrieveTemplateProductMix") + @AlternativeOperationId("retrieveTemplate_12") public ProductMixData retrieveTemplate(@PathParam("productId") final Long productId, @Context final UriInfo uriInfo) { var productMixData = productMixReadPlatformService.retrieveLoanProductMixDetails(productId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/api/MeetingsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/api/MeetingsApiResource.java index b36f631fbff..7e951406b1e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/api/MeetingsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/api/MeetingsApiResource.java @@ -34,6 +34,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.portfolio.calendar.data.CalendarData; import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType; @@ -76,6 +77,7 @@ public class MeetingsApiResource { @GET @Path("template") @Operation(summary = "Retrieve Meeting Template", operationId = "retrieveTemplateMeeting") + @AlternativeOperationId("template_11") public MeetingData template(@PathParam("entityType") final String entityType, @PathParam("entityId") final Long entityId, @QueryParam("calendarId") final Long calendarId) { @@ -110,6 +112,7 @@ public MeetingData template(@PathParam("entityType") final String entityType, @P @GET @Operation(summary = "List Meetings", operationId = "retrieveAllMeetings") + @AlternativeOperationId("retrieveMeetings") public Collection retrieveMeetings(@PathParam("entityType") final String entityType, @PathParam("entityId") final Long entityId, @QueryParam("limit") final Integer limit) { @@ -120,6 +123,7 @@ public Collection retrieveMeetings(@PathParam("entityType") final S @GET @Path("{meetingId}") @Operation(summary = "Retrieve a Meeting", operationId = "retrieveOneMeeting") + @AlternativeOperationId("retrieveMeeting") public MeetingData retrieveMeeting(@PathParam("meetingId") final Long meetingId, @PathParam("entityType") final String entityType, @PathParam("entityId") final Long entityId) { @@ -204,6 +208,7 @@ public MeetingDeleteResponse deleteMeeting(@PathParam("entityType") final String @Path("{meetingId}") @Consumes({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Meeting Attendance", operationId = "updateMeetingAttendance") + @AlternativeOperationId("performMeetingCommands") public MeetingAttendanceUpdateResponse updateMeetingAttendance(@PathParam("entityType") final String entityType, @PathParam("entityId") final Long entityId, @PathParam("meetingId") final Long meetingId, @QueryParam("command") final String commandParam, final MeetingAttendanceUpdateRequest request) { 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 42f4fd2fe60..f636513ed55 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 @@ -41,6 +41,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.ResourceNotFoundException; @@ -71,6 +72,7 @@ public class ProductsApiResource { @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Share Product Template", operationId = "retrieveTemplateShareProduct") + @AlternativeOperationId("retrieveTemplate_13") public String retrieveTemplate(@PathParam("type") @Parameter(description = "type") final String productType, @Context final UriInfo uriInfo) { String serviceName = productType + ProductsApiConstants.READPLATFORM_NAME; @@ -89,6 +91,7 @@ public String retrieveTemplate(@PathParam("type") @Parameter(description = "type @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Share Product", operationId = "retrieveOneShareProduct", description = "Retrieves a Share Product\n\n" + "Example Requests:\n" + "\n" + "products/share/1\n" + "\n" + "\n" + "products/share/1?template=true") + @AlternativeOperationId("retrieveProduct") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.GetProductsTypeProductIdResponse.class))) }) public String retrieveProduct(@PathParam("productId") @Parameter(description = "productId") final Long productId, @@ -108,6 +111,7 @@ public String retrieveProduct(@PathParam("productId") @Parameter(description = " @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Share Products", operationId = "retrieveAllShareProducts", description = "Lists Share Products\n\n" + "Mandatory Fields: limit, offset\n\n" + "Example Requests:\n" + "\n" + "shareproducts") + @AlternativeOperationId("retrieveAllProducts") @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, @@ -131,6 +135,7 @@ public String retrieveAllProducts(@PathParam("type") @Parameter(description = "t + "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") + @AlternativeOperationId("createProduct") @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))) }) @@ -148,6 +153,7 @@ public String createProduct(@PathParam("type") @Parameter(description = "type") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Handle Share Product commands", operationId = "handleCommandsShareProduct") + @AlternativeOperationId("handleCommands_3") 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, @@ -163,6 +169,7 @@ public String handleCommands(@PathParam("type") @Parameter(description = "type") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Share Product", operationId = "updateShareProduct", description = "Updates a Share Product") + @AlternativeOperationId("updateProduct") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.PutProductsTypeProductIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProductsApiResourceSwagger.PutProductsTypeProductIdResponse.class))) }) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java index 0782c6e0ef4..c18d11224da 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java @@ -37,6 +37,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -66,6 +67,7 @@ public class RateApiResource { @Path("{rateId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a rate", operationId = "retrieveOneRate") + @AlternativeOperationId("retrieveRate") public RateData retrieveRate(@PathParam("rateId") Long rateId) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); @@ -87,6 +89,7 @@ public CommandProcessingResult createRate(final RateRequest rateRequest) { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List all rates", operationId = "retrieveAllRates") + @AlternativeOperationId("getAllRates") public List getAllRates() { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/DepositAccountOnHoldFundTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/DepositAccountOnHoldFundTransactionsApiResource.java index f1b48d24489..31d654677ae 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/DepositAccountOnHoldFundTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/DepositAccountOnHoldFundTransactionsApiResource.java @@ -29,6 +29,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.UriInfo; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -56,6 +57,7 @@ public class DepositAccountOnHoldFundTransactionsApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve deposit account on hold fund transactions", operationId = "retrieveAllDepositAccountOnHoldFundTransactions") + @AlternativeOperationId("retrieveAll_28") public String retrieveAll(@PathParam("savingsId") final Long savingsId, @QueryParam("guarantorFundingId") final Long guarantorFundingId, @Context final UriInfo uriInfo, @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java index f1716b88fff..9e437527fca 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java @@ -45,6 +45,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; @@ -85,6 +86,7 @@ private boolean is(final String commandParam, final String commandValue) { @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Fixed Deposit Account Transaction Template", operationId = "retrieveTemplateFixedDepositAccountTransaction") + @AlternativeOperationId("retrieveTemplate_14") public String retrieveTemplate(@PathParam("fixedDepositAccountId") final Long fixedDepositAccountId, // @QueryParam("command") final String commandParam, @Context final UriInfo uriInfo) { @@ -120,6 +122,7 @@ public String retrieveAll(@PathParam("fixedDepositAccountId") final Long fixedDe @Path("{transactionId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a fixed deposit account transaction", operationId = "retrieveOneFixedDepositAccountTransaction") + @AlternativeOperationId("retrieveOne_18") public String retrieveOne(@PathParam("fixedDepositAccountId") final Long fixedDepositAccountId, @PathParam("transactionId") final Long transactionId, @Context final UriInfo uriInfo) { @@ -167,6 +170,7 @@ public String transaction(@PathParam("fixedDepositAccountId") final Long fixedDe @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Adjust Transaction | Undo transaction", operationId = "handleCommandsFixedDepositAccountTransaction", description = "Adjust Transaction:\n\nThis command modifies the given transaction.\n\n" + "Undo transaction:\n\nThis command reverses the given transaction.\n\n" + "Showing request/response for 'Adjust Transaction'") + @AlternativeOperationId("adjustTransaction") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountTransactionsApiResourceSwagger.PostFixedDepositAccountsFixedDepositAccountIdTransactionsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountTransactionsApiResourceSwagger.PostFixedDepositAccountsFixedDepositAccountIdTransactionsTransactionIdResponse.class))), 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 d2a4388cd1e..df191a358cc 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 @@ -56,6 +56,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.JsonQuery; @@ -122,6 +123,7 @@ public class FixedDepositAccountsApiResource { fixeddepositaccounts/template?clientId=1""") + @AlternativeOperationId("template_12") @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, @@ -152,6 +154,7 @@ public String template(@QueryParam("clientId") @Parameter(description = "clientI fixeddepositaccounts?fields=name""") + @AlternativeOperationId("retrieveAll_29") @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, @@ -187,6 +190,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("paged") @ Mandatory Fields: clientId or groupId, productId, submittedOnDate, depositAmount, depositPeriod, depositPeriodFrequencyId 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 )""") + @AlternativeOperationId("submitApplication") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsResponse.class))) public String submitApplication(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -212,6 +216,7 @@ public String submitApplication(@Parameter(hidden = true) final String apiReques fixeddepositaccounts/1 fixeddepositaccounts/1?associations=all""") + @AlternativeOperationId("retrieveOne_19") @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, @@ -338,6 +343,7 @@ private FixedDepositAccountData populateTemplateAndAssociations(final Long accou @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Modify a fixed deposit application", operationId = "updateFixedDepositAccount", 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") + @AlternativeOperationId("update_16") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PutFixedDepositAccountsAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PutFixedDepositAccountsAccountIdResponse.class))) public String update(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @@ -374,6 +380,7 @@ public String update(@PathParam("accountId") @Parameter(description = "accountId + "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", operationId = "handleCommandsFixedDepositAccount") + @AlternativeOperationId("handleCommands_4") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.PostFixedDepositAccountsAccountIdResponse.class))) public String handleCommands(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @@ -442,6 +449,7 @@ private boolean is(final String commandParam, final String commandValue) { @Path("{accountId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a fixed deposit application", operationId = "deleteFixedDepositAccount", 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.") + @AlternativeOperationId("delete_14") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositAccountsApiResourceSwagger.DeleteFixedDepositAccountsAccountIdResponse.class))) public String delete(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId) { 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 870cfafc068..4f7515d75c7 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 @@ -52,6 +52,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -123,6 +124,7 @@ public class FixedDepositProductsApiResource { Mandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId""") + @AlternativeOperationId("create_11") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PostFixedDepositProductsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PostFixedDepositProductsResponse.class))) public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -140,6 +142,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Fixed Deposit Product", operationId = "updateFixedDepositProduct", description = "Updates a Fixed Deposit Product") + @AlternativeOperationId("update_17") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PutFixedDepositProductsProductIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.PutFixedDepositProductsProductIdResponse.class))) public String update(@PathParam("productId") @Parameter(description = "productId") final Long productId, @@ -165,6 +168,7 @@ public String update(@PathParam("productId") @Parameter(description = "productId fixeddepositproducts?fields=name""") + @AlternativeOperationId("retrieveAll_30") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.GetFixedDepositProductsResponse.class)))) public String retrieveAll(@Context final UriInfo uriInfo) { @@ -194,6 +198,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { fixeddepositproducts/1?fields=name,description""") + @AlternativeOperationId("retrieveOne_20") @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) { @@ -236,6 +241,7 @@ public String retrieveOne(@PathParam("productId") @Parameter(description = "prod @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Fixed Deposit Product Template", operationId = "retrieveTemplateFixedDepositProduct") + @AlternativeOperationId("retrieveTemplate_15") public String retrieveTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.FIXED_DEPOSIT_PRODUCT_RESOURCE_NAME); @@ -336,6 +342,7 @@ private FixedDepositProductData handleTemplateRelatedData(final FixedDepositProd @Path("{productId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Fixed Deposit Product", operationId = "deleteFixedDepositProduct", description = "Deletes a Fixed Deposit Product") + @AlternativeOperationId("delete_15") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FixedDepositProductsApiResourceSwagger.DeleteFixedDepositProductsProductIdResponse.class))) public String delete(@PathParam("productId") @Parameter(description = "productId") final Long productId) { 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 e7b050cdfbd..67e11bb366c 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 @@ -45,6 +45,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; @@ -90,6 +91,7 @@ private boolean is(final String commandParam, final String commandValue) { + "\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") + @AlternativeOperationId("retrieveTemplate_16") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTemplateResponse.class))) }) public String retrieveTemplate( @@ -131,6 +133,7 @@ public String retrieveTemplate( @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Recurring Deposit Account Transaction", operationId = "retrieveOneRecurringDepositAccountTransaction", description = "Retrieves Recurring Deposit Account Transaction\n\n" + "Example Requests:\n" + "\n" + "recurringdepositaccounts/1/transactions/1") + @AlternativeOperationId("retrieveOne_21") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.GetRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse.class))) }) public String retrieveOne( @@ -156,6 +159,7 @@ public String retrieveOne( @Operation(summary = "Deposit Transaction | Withdrawal Transaction", operationId = "transactionRecurringDepositAccountTransaction", 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") + @AlternativeOperationId("transaction_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsResponse.class))) }) @@ -191,6 +195,7 @@ public String transaction( @Operation(summary = "Adjust Transaction | Undo transaction", operationId = "handleCommandsRecurringDepositAccountTransaction", 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'") + @AlternativeOperationId("handleTransactionCommands") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountTransactionsApiResourceSwagger.PostRecurringDepositAccountsRecurringDepositAccountIdTransactionsTransactionIdResponse.class))) }) 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 32a17390cfd..c3e96b789bd 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 @@ -55,6 +55,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.JsonQuery; @@ -107,6 +108,7 @@ public class RecurringDepositAccountsApiResource { @Operation(summary = "Retrieve recurring Deposit Account Template", operationId = "retrieveTemplateRecurringDepositAccount", 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") + @AlternativeOperationId("template_13") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsTemplateResponse.class))) }) public String template(@QueryParam("clientId") @Parameter(description = "clientId") final Long clientId, @@ -129,6 +131,7 @@ public String template(@QueryParam("clientId") @Parameter(description = "clientI @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Recurring deposit applications/accounts", operationId = "retrieveAllRecurringDepositAccounts", description = "Lists Recurring deposit applications/accounts\n\n" + "Example Requests:\n" + "\n" + "recurringdepositaccounts\n" + "\n" + "\n" + "recurringdepositaccounts?fields=name") + @AlternativeOperationId("retrieveAll_31") @ApiResponses({ @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, @@ -165,6 +168,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("paged") @ + "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") + @AlternativeOperationId("submitApplication_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsResponse.class))) }) @@ -183,6 +187,7 @@ public String submitApplication(@Parameter(hidden = true) final String apiReques @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a recurring deposit application/account", operationId = "retrieveOneRecurringDepositAccount", description = "Retrieves a recurring deposit application/account\n\n" + "Example Requests :\n" + "\n" + "recurringdepositaccounts/1\n" + "\n" + "\n" + "recurringdepositaccounts/1?associations=all") + @AlternativeOperationId("retrieveOne_22") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.GetRecurringDepositAccountsAccountIdResponse.class))) }) public String retrieveOne(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @@ -259,6 +264,7 @@ private RecurringDepositAccountData populateTemplateAndAssociations(final Long a @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Modify a recurring deposit application", operationId = "updateRecurringDepositAccount", 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") + @AlternativeOperationId("update_18") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PutRecurringDepositAccountsAccountIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PutRecurringDepositAccountsAccountIdResponse.class))) }) @@ -301,6 +307,7 @@ public String update(@PathParam("accountId") @Parameter(description = "accountId + "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'", operationId = "handleCommandsRecurringDepositAccount") + @AlternativeOperationId("handleCommands_5") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsAccountIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.PostRecurringDepositAccountsAccountIdResponse.class))) }) @@ -374,6 +381,7 @@ private boolean is(final String commandParam, final String commandValue) { @Path("{accountId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a recurring deposit application", operationId = "deleteRecurringDepositAccount", 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.") + @AlternativeOperationId("delete_16") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositAccountsApiResourceSwagger.DeleteRecurringDepositAccountsResponse.class))) }) public String delete(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId) { @@ -389,6 +397,7 @@ public String delete(@PathParam("accountId") @Parameter(description = "accountId @Path("{accountId}/template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve recurring deposit account closure template", operationId = "accountClosureTemplateRecurringDepositAccount") + @AlternativeOperationId("accountClosureTemplate_1") public String accountClosureTemplate(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @QueryParam("command") @Parameter(description = "command") final String commandParam, @Context final UriInfo uriInfo) { 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 4347c2fc677..4d566c91862 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 @@ -53,6 +53,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -118,6 +119,7 @@ public class RecurringDepositProductsApiResource { + "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, accountingRule, depositAmount, charts\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, minDepositAmount, maxDepositAmount, withHoldTax, taxGroupId") + @AlternativeOperationId("create_12") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsResponse.class))) }) @@ -136,6 +138,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Recurring Deposit Product", operationId = "updateRecurringDepositProduct", description = "Updates a Recurring Deposit Product") + @AlternativeOperationId("update_19") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PutRecurringDepositProductsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PutRecurringDepositProductsResponse.class))) }) @@ -155,6 +158,7 @@ public String update(@PathParam("productId") @Parameter(description = "productId @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Recuring Deposit Products", operationId = "retrieveAllRecurringDepositProducts", description = "Lists Recuring Deposit Products\n\n" + "Example Requests:\n" + "\n" + "recurringdepositproducts\n" + "\n" + "\n" + "recurringdepositproducts?fields=name") + @AlternativeOperationId("retrieveAll_32") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.GetRecurringDepositProductsResponse.class)))) }) public String retrieveAll(@Context final UriInfo uriInfo) { @@ -176,6 +180,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @Operation(summary = "Retrieve a Recurring Deposit Product", operationId = "retrieveOneRecurringDepositProduct", 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") + @AlternativeOperationId("retrieveOne_23") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.GetRecurringDepositProductsProductIdResponse.class))) }) public String retrieveOne(@PathParam("productId") @Parameter(description = "productId") final Long productId, @@ -219,6 +224,7 @@ public String retrieveOne(@PathParam("productId") @Parameter(description = "prod @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Recurring Deposit Product Template", operationId = "retrieveTemplateRecurringDepositProduct") + @AlternativeOperationId("retrieveTemplate_17") public String retrieveTemplate(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(DepositsApiConstants.RECURRING_DEPOSIT_PRODUCT_RESOURCE_NAME); @@ -315,6 +321,7 @@ private RecurringDepositProductData handleTemplateRelatedData(final RecurringDep @Path("{productId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Recurring Deposit Product", operationId = "deleteRecurringDepositProduct", description = "Deletes a Recurring Deposit Product") + @AlternativeOperationId("delete_17") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.DeleteRecurringDepositProductsProductIdResponse.class))) }) public String delete(@PathParam("productId") @Parameter(description = "productId") final Long productId) { 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 f736c2f650c..de6a37c14b5 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 @@ -51,6 +51,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; @@ -115,6 +116,7 @@ public String retrieveAllSavingsAccountCharges( @Operation(summary = "Retrieve Savings Charges Template", operationId = "retrieveTemplateSavingsAccountCharge", 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") + @AlternativeOperationId("retrieveTemplate_18") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesTemplateResponse.class))) }) public String retrieveTemplate(@PathParam("savingsAccountId") @Parameter(description = "savingsAccountId") final Long savingsAccountId, @@ -137,6 +139,7 @@ public String retrieveTemplate(@PathParam("savingsAccountId") @Parameter(descrip @Operation(summary = "Retrieve a Savings account Charge", operationId = "retrieveOneSavingsAccountCharge", 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") + @AlternativeOperationId("retrieveSavingsAccountCharge") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.GetSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) public String retrieveSavingsAccountCharge( @@ -160,6 +163,7 @@ public String retrieveSavingsAccountCharge( @Operation(summary = "Create a Savings account Charge", operationId = "createSavingsAccountCharge", 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") + @AlternativeOperationId("addSavingsAccountCharge") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesResponse.class))) }) @@ -206,6 +210,7 @@ public String updateSavingsAccountCharge( + "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'") + @AlternativeOperationId("payOrWaiveSavingsAccountCharge") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountChargesApiResourceSwagger.PostSavingsAccountsSavingsAccountIdChargesSavingsAccountChargeIdResponse.class))) }) 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 9af1d198edc..373acfd7369 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 @@ -46,6 +46,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.domain.ExternalId; @@ -89,6 +90,7 @@ public class SavingsAccountTransactionsApiResource { @Path("{savingsId}/transactions/template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a savings account transaction template", operationId = "retrieveTemplateSavingsAccountTransaction") + @AlternativeOperationId("retrieveTemplate_19") public String retrieveTemplate(@PathParam("savingsId") final Long savingsId, // @QueryParam("command") final String commandParam, @Context final UriInfo uriInfo) { @@ -123,6 +125,7 @@ private String retrieveTemplate(final Long savingsId, final String savingsExtern @Path("{savingsId}/transactions/{transactionId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a savings account transaction", operationId = "retrieveOneSavingsAccountTransaction") + @AlternativeOperationId("retrieveOne_24") public String retrieveOne(@PathParam("savingsId") final Long savingsId, @PathParam("transactionId") final Long transactionId, @Context final UriInfo uriInfo) { return retrieveOne(savingsId, null, transactionId, null, uriInfo); @@ -178,6 +181,7 @@ public String retrieveOne(@PathParam("savingsExternalId") final String savingsEx @Path("{savingsId}/transactions/search") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Search Savings Account Transactions", operationId = "searchSavingsAccountTransactions") + @AlternativeOperationId("searchTransactions") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountTransactionsApiResourceSwagger.SavingsAccountTransactionsSearchResponse.class))) public String searchTransactions(@PathParam("savingsId") @Parameter(description = "savings account id") final Long savingsId, @QueryParam("fromDate") @Parameter(description = "minimum value date (inclusive)", example = "2023-08-08") final String fromDate, @@ -247,6 +251,7 @@ private String searchTransactions(final Long savingsId, final String savingsExte @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Advanced search Savings Account Transactions", operationId = "advancedQuerySavingsAccountTransactions") + @AlternativeOperationId("advancedQuery_1") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = List.class))) public String advancedQuery(@PathParam("savingsId") @Parameter(description = "savingsId") final Long savingsId, PagedLocalRequest queryRequest, @Context final UriInfo uriInfo) { @@ -277,6 +282,7 @@ private String advancedQuery(final Long savingsId, final String savingsExternalI @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a savings account transaction", operationId = "createSavingsAccountTransaction") + @AlternativeOperationId("transaction_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountTransactionsApiResourceSwagger.PostSavingsAccountTransactionsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountTransactionsApiResourceSwagger.PostSavingsAccountTransactionsResponse.class))) public String transaction(@PathParam("savingsId") final Long savingsId, @QueryParam("command") final String commandParam, @@ -323,6 +329,7 @@ private String transaction(final Long savingsId, final String savingsExternalIdS @Operation(summary = "Undo/Reverse/Modify/Release Amount transaction API", operationId = "adjustSavingsAccountTransaction", description = "Undo/Reverse/Modify/Release Amount transaction API\n\n" + "Example Requests:\n" + "\n" + "\n" + "savingsaccounts/{savingsId}/transactions/{transactionId}?command=reverse\n" + "\n" + "Accepted command = undo, reverse, modify, releaseAmount") + @AlternativeOperationId("adjustTransaction_1") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountTransactionsApiResourceSwagger.PostSavingsAccountBulkReversalTransactionsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SavingsAccountTransactionsApiResourceSwagger.PostSavingsAccountBulkReversalTransactionsRequest.class)))) public String adjustTransaction(@PathParam("savingsId") final Long savingsId, @PathParam("transactionId") final Long transactionId, 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 66805d08f6c..69eb16e4c3e 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 @@ -51,6 +51,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -101,6 +102,7 @@ public class SavingsAccountsApiResource { @Operation(summary = "Retrieve Savings Account Template", operationId = "retrieveSavingsAccountTemplate", 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") + @AlternativeOperationId("template_14") @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, @@ -121,6 +123,7 @@ public String template(@QueryParam("clientId") @Parameter(description = "clientI @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List savings applications/accounts", operationId = "retrieveAllSavingsAccounts", description = "Lists savings applications/accounts\n\n" + "Example Requests:\n" + "\n" + "savingsaccounts\n" + "\n" + "\n" + "savingsaccounts?fields=name") + @AlternativeOperationId("retrieveAll_33") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.GetSavingsAccountsResponse.class))) public String retrieveAll(@Context final UriInfo uriInfo, @QueryParam("externalId") @Parameter(description = "externalId") final String externalId, @@ -152,6 +155,7 @@ public String retrieveAll(@Context final UriInfo uriInfo, + "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") + @AlternativeOperationId("submitApplication_2") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsResponse.class))) public String submitApplication(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -180,6 +184,7 @@ public String submitGSIMApplication(final String apiRequestBodyAsJson) { @Path("{accountId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a savings account", operationId = "retrieveSavingsAccount") + @AlternativeOperationId("retrieveOne_25") public SavingsAccountData retrieveOne(@PathParam("accountId") final Long accountId, @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, @DefaultValue("all") @QueryParam("chargeStatus") final String chargeStatus, @@ -192,6 +197,7 @@ public SavingsAccountData retrieveOne(@PathParam("accountId") final Long account @Path("/external-id/{externalId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a savings account by external ID", operationId = "retrieveSavingsAccountByExternalId") + @AlternativeOperationId("retrieveOne_26") public SavingsAccountData retrieveOne(@PathParam("externalId") final String externalId, @DefaultValue("false") @QueryParam("staffInSelectedOfficeOnly") final boolean staffInSelectedOfficeOnly, @DefaultValue("all") @QueryParam("chargeStatus") final String chargeStatus, @@ -209,6 +215,7 @@ public SavingsAccountData retrieveOne(@PathParam("externalId") final String exte + "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'") + @AlternativeOperationId("update_20") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdResponse.class))) public String update(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @@ -227,6 +234,7 @@ public String update(@PathParam("accountId") @Parameter(description = "accountId + "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'") + @AlternativeOperationId("update_21") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PutSavingsAccountsAccountIdResponse.class))) public String update(@PathParam("externalId") @Parameter(description = "externalId") final String externalId, @@ -340,6 +348,7 @@ public String handleGSIMCommands(@PathParam("parentAccountId") final Long parent + "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'", operationId = "handleCommandsSavingsAccount") + @AlternativeOperationId("handleCommands_6") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdResponse.class))) public String handleCommands(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId, @@ -385,6 +394,7 @@ public String handleCommands(@PathParam("accountId") @Parameter(description = "a + "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'", operationId = "handleCommandsSavingsAccountByExternalId") + @AlternativeOperationId("handleCommands_7") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.PostSavingsAccountsAccountIdResponse.class))) public String handleCommands(@PathParam("externalId") @Parameter(description = "externalId") final String externalId, @@ -402,6 +412,7 @@ private boolean is(final String commandParam, final String commandValue) { @Path("{accountId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a savings application", operationId = "deleteSavingsAccount", 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.") + @AlternativeOperationId("delete_18") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.DeleteSavingsAccountsAccountIdResponse.class))) public String delete(@PathParam("accountId") @Parameter(description = "accountId") final Long accountId) { @@ -412,6 +423,7 @@ public String delete(@PathParam("accountId") @Parameter(description = "accountId @Path("/external-id/{externalId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a savings application by externalId", operationId = "deleteSavingsAccountByExternalId", 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.") + @AlternativeOperationId("delete_19") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsAccountsApiResourceSwagger.DeleteSavingsAccountsAccountIdResponse.class))) public String delete(@PathParam("externalId") @Parameter(description = "externalId") final String externalId) { 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 a0ceb51a91f..d3297002844 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 @@ -53,6 +53,7 @@ import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; @@ -107,6 +108,7 @@ public class SavingsProductsApiResource { + "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,accountMapping, lienAllowed, maxAllowedLienLimit") + @AlternativeOperationId("create_13") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PostSavingsProductsRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PostSavingsProductsResponse.class))) public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -123,6 +125,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a Savings Product", operationId = "updateSavingsProduct", description = "Updates a Savings Product") + @AlternativeOperationId("update_22") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PutSavingsProductsProductIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.PutSavingsProductsProductIdResponse.class))) public String update(@PathParam("productId") @Parameter(description = "productId") final Long productId, @@ -141,6 +144,7 @@ public String update(@PathParam("productId") @Parameter(description = "productId @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Savings Products", operationId = "retrieveAllSavingsProducts", description = "Lists Savings Products\n\n" + "Example Requests:\n" + "\n" + "savingsproducts\n" + "\n" + "savingsproducts?fields=name") + @AlternativeOperationId("retrieveAll_34") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.GetSavingsProductsResponse.class)))) public String retrieveAll(@Context final UriInfo uriInfo) { @@ -158,6 +162,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @Operation(summary = "Retrieve a Savings Product", operationId = "retrieveOneSavingsProduct", 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") + @AlternativeOperationId("retrieveOne_27") @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) { @@ -199,6 +204,7 @@ public String retrieveOne(@PathParam("productId") @Parameter(description = "prod @Operation(summary = "Retrieve Savings Product Template", operationId = "retrieveTemplateSavingsProduct", 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" + "Account Mapping:\n" + "\n" + "savingsproducts/template") + @AlternativeOperationId("retrieveTemplate_20") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.GetSavingsProductsTemplateResponse.class))) public String retrieveTemplate(@Context final UriInfo uriInfo) { @@ -288,6 +294,7 @@ private SavingsProductData handleTemplateRelatedData(final SavingsProductData sa @Path("{productId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a Savings Product", operationId = "deleteSavingsProduct", description = "Deletes a Savings Product") + @AlternativeOperationId("delete_20") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SavingsProductsApiResourceSwagger.DeleteSavingsProductsProductIdResponse.class))) public String delete(@PathParam("productId") @Parameter(description = "productId") final Long productId) { 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 924ac532f84..aba07b45597 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 @@ -35,6 +35,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; @@ -67,6 +68,7 @@ public class ShareDividendApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List all share dividends", operationId = "retrieveAllShareDividends") + @AlternativeOperationId("retrieveAll_39") public String retrieveAll(@PathParam("productId") final Long productId, @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, @QueryParam("status") final Integer status) { @@ -85,6 +87,7 @@ public String retrieveAll(@PathParam("productId") final Long productId, @QueryPa @Path("{dividendId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a share dividend", operationId = "retrieveOneShareDividend") + @AlternativeOperationId("retrieveDividendDetails") public String retrieveDividendDetails(@PathParam("dividendId") final Long dividendId, @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, @QueryParam("accountNo") final String accountNo, @@ -105,6 +108,7 @@ public String retrieveDividendDetails(@PathParam("dividendId") final Long divide @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create a share dividend", operationId = "createShareDividend") + @AlternativeOperationId("createDividendDetail") public String createDividendDetail(@PathParam("productId") final Long productId, final String apiRequestBodyAsJson) { this.platformSecurityContext.authenticatedUser(); CommandWrapper commandWrapper = new CommandWrapperBuilder().createShareProductDividendPayoutCommand(productId) @@ -118,6 +122,7 @@ public String createDividendDetail(@PathParam("productId") final Long productId, @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update a share dividend", operationId = "updateShareDividend") + @AlternativeOperationId("updateDividendDetail") public String updateDividendDetail(@PathParam("productId") final Long productId, @PathParam("dividendId") final Long dividendId, @QueryParam("command") final String commandParam, final String apiRequestBodyAsJson) { CommandWrapper commandWrapper; @@ -136,6 +141,7 @@ public String updateDividendDetail(@PathParam("productId") final Long productId, @Path("{dividendId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Delete a share dividend", operationId = "deleteShareDividend") + @AlternativeOperationId("deleteDividendDetail") public String deleteDividendDetail(@PathParam("productId") final Long productId, @PathParam("dividendId") final Long dividendId) { this.platformSecurityContext.authenticatedUser(); final CommandWrapper commandWrapper = new CommandWrapperBuilder().deleteShareProductDividendPayoutCommand(productId, dividendId) 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 20ef3015e29..cee9ad3cc10 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 @@ -35,6 +35,7 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.client.domain.Client; import org.apache.fineract.portfolio.client.domain.ClientRepositoryWrapper; @@ -79,8 +80,9 @@ public List findBySurvey(@PathParam("surveyId") @Parameter(descri @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Transactional - @Operation(summary = "Create a Scorecard entry", description = "Add a new entry to a survey.\n" + "\n" + "Mandatory Fields\n" - + "clientId, createdOn, questionId, responseId, staffId") + @Operation(operationId = "createScorecard", summary = "Create a Scorecard entry", description = "Add a new entry to a survey.\n" + "\n" + + "Mandatory Fields\n" + "clientId, createdOn, questionId, responseId, staffId") + @AlternativeOperationId("createScorecard_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) public void createScorecard(@PathParam("surveyId") @Parameter(description = "Enter surveyId") final Long surveyId, @Parameter(description = "scorecardData") final ScorecardData scorecardData) { @@ -107,6 +109,8 @@ public List findBySurveyAndClient(@PathParam("surveyId") @Paramet @Path("clients/{clientId}") @Produces({ MediaType.APPLICATION_JSON }) @Transactional + @Operation(operationId = "findByClient") + @AlternativeOperationId("findByClient_1") public List findByClient(@PathParam("clientId") final Long clientId) { this.securityContext.authenticatedUser(); 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 0b352cf269e..99f3e26f6a2 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 @@ -40,6 +40,7 @@ import java.util.HashMap; import java.util.List; import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.spm.data.SurveyData; @@ -62,6 +63,7 @@ public class SpmApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Transactional @Operation(summary = "List all Surveys", operationId = "fetchAllSurveys", description = "") + @AlternativeOperationId("fetchAllSurveys_1") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SurveyData.class)))) }) public List fetchAllSurveys(@QueryParam("isActive") final Boolean isActive) { 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 c02f550052c..500958aa65f 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 @@ -43,6 +43,7 @@ import java.util.function.Supplier; import lombok.RequiredArgsConstructor; import org.apache.fineract.command.core.CommandDispatcher; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.template.command.TemplateCreateCommand; import org.apache.fineract.template.command.TemplateDeleteCommand; import org.apache.fineract.template.command.TemplateUpdateCommand; @@ -78,7 +79,7 @@ public class TemplatesApiResource { private final CommandDispatcher dispatcher; @GET - @Operation(summary = "Retrieve all UGDs", description = """ + @Operation(operationId = "retrieveAllTemplates", summary = "Retrieve all UGDs", description = """ It is possible to get specific UGDs by entity and type: templates?type=0&entity=0 @@ -93,6 +94,7 @@ public class TemplatesApiResource { - Document: 0 - E-Mail (not yet): 1 - SMS: 2""") + @AlternativeOperationId("retrieveAll_40") public List retrieveAllTemplates( @DefaultValue("-1") @QueryParam("typeId") @Parameter(description = "typeId") final int typeId, @DefaultValue("-1") @QueryParam("entityId") @Parameter(description = "entityId") final int entityId) { @@ -105,7 +107,7 @@ public List retrieveAllTemplates( @GET @Path(PARAM_TEMPLATE) - @Operation(summary = "Retrieve UGD Details Template", description = """ + @Operation(operationId = "retrieveTemplateDetails", 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: - name @@ -118,6 +120,7 @@ public List retrieveAllTemplates( templates/template """) + @AlternativeOperationId("template_20") public TemplateData retrieveTemplateDetails() { // TODO: why?!? The original code was also limited to return only the ID attribute... // which we don't have; the parser will remove all null values @@ -126,16 +129,19 @@ public TemplateData retrieveTemplateDetails() { @GET @Path("{templateId}") - @Operation(summary = "Retrieve a UGD", description = """ + @Operation(operationId = "retrieveOneTemplate", summary = "Retrieve a UGD", description = """ Example Requests: - templates/1""") + @AlternativeOperationId("retrieveOne_30") public TemplateData retrieveOneTemplate(@PathParam("templateId") @Parameter(description = "templateId") final Long templateId) { return templateService.findOneById(templateId); } @GET @Path("{templateId}/template") + @Operation(operationId = "retrieveTemplateById") + @AlternativeOperationId("getTemplateByTemplate") public TemplateData retrieveTemplateById(@PathParam("templateId") final Long templateId) { return templateService.findOneById(templateId); } 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 c08fbdf9fa7..6d2fbf05dc6 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 @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -69,6 +70,7 @@ public class PasswordPreferencesApiResource { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PasswordPreferencesApiResourceSwagger.GetPasswordPreferencesTemplateResponse.class))) }) @Operation(summary = "List Password Preferences", operationId = "retrieveAllPasswordPreferences", description = "Returns the password policies and their current status (active/inactive).", tags = { "Password preferences" }) + @AlternativeOperationId("retrieve_1") public String retrieve(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(PasswordPreferencesApiConstants.ENTITY_NAME); @@ -86,6 +88,7 @@ public String retrieve(@Context final UriInfo uriInfo) { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update password preferences", operationId = "updatePasswordPreferences", tags = { "Password preferences" }, description = "") + @AlternativeOperationId("update_25") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = PasswordPreferencesApiResourceSwagger.PutPasswordPreferencesTemplateRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) public String update(@Parameter(hidden = true) final String apiRequestBodyAsJson) { @@ -105,6 +108,7 @@ public String update(@Parameter(hidden = true) final String apiRequestBodyAsJson @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Application Password validation policies", operationId = "retrieveTemplatePasswordPreferences", tags = { "Password preferences" }, description = "ARGUMENTS\n" + "Example Requests:\n" + "\n" + "passwordpreferences") + @AlternativeOperationId("template_21") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PasswordPreferencesApiResourceSwagger.GetPasswordPreferencesTemplateResponse.class)))) }) public String template(@Context final UriInfo uriInfo) { 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 99d9772b15d..3b28b93caa4 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 @@ -43,6 +43,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -103,6 +104,7 @@ public String retrieveAllPermissions(@Context final UriInfo uriInfo) { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Enable/Disable Permissions for Maker Checker", operationId = "updatePermissions", tags = { "Permissions" }, description = "") + @AlternativeOperationId("updatePermissionsDetails") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = PermissionsApiResourceSwagger.PutPermissionsRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CommandProcessingResult.class))) }) 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 694f3b23c54..0e94b628a9d 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 @@ -49,6 +49,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -136,6 +137,7 @@ public String createRole(@Parameter(hidden = true) final String apiRequestBodyAs @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve a Role", operationId = "retrieveOneRole", tags = { "Roles" }, description = "Example Requests:\n" + "\n" + "roles/1\n" + "\n" + "\n" + "roles/1?fields=name") + @AlternativeOperationId("retrieveRole") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.GetRolesRoleIdResponse.class))) }) public String retrieveRole(@PathParam("roleId") @Parameter(description = "roleId") final Long roleId, @Context final UriInfo uriInfo) { @@ -165,6 +167,7 @@ public String retrieveRole(@PathParam("roleId") @Parameter(description = "roleId "Roles" }, 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") + @AlternativeOperationId("actionsOnRoles") @Parameters({ @Parameter(description = "No Request Body", name = "No Request Body") }) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RolesApiResourceSwagger.PostRolesRoleIdResponse.class))) }) 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 63bd84879e4..f4d34b11b1a 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 @@ -52,6 +52,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.UploadRequest; @@ -92,6 +93,7 @@ public class UsersApiResource { @GET @Operation(summary = "Retrieve list of users", operationId = "retrieveAllUsers", tags = { "Users" }, description = "Example Requests:\n" + "\n" + "users\n" + "\n" + "\n" + "users?fields=id,username,email,officeName") + @AlternativeOperationId("retrieveAll_41") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = UsersApiResourceSwagger.GetUsersResponse.class)))) }) @Produces({ MediaType.APPLICATION_JSON }) @@ -109,6 +111,7 @@ public String retrieveAll(@Context final UriInfo uriInfo) { @Path("{userId}") @Operation(summary = "Retrieve a User", operationId = "retrieveOneUser", tags = { "Users" }, description = "Example Requests:\n" + "\n" + "users/1\n" + "\n" + "\n" + "users/1?template=true\n" + "\n" + "\n" + "users/1?fields=username,officeName") + @AlternativeOperationId("retrieveOne_31") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.GetUsersUserIdResponse.class))) }) @Produces({ MediaType.APPLICATION_JSON }) @@ -132,6 +135,7 @@ public String retrieveOne(@PathParam("userId") @Parameter(description = "userId" @Operation(summary = "Retrieve User Details Template", operationId = "retrieveTemplateUser", tags = { "Users" }, 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") + @AlternativeOperationId("template_22") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.GetUsersTemplateResponse.class))) }) @Produces({ MediaType.APPLICATION_JSON }) @@ -151,6 +155,7 @@ public String template(@Context final UriInfo uriInfo) { + "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,isLoginRetriesEnabled") + @AlternativeOperationId("create_15") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PostUsersRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PostUsersResponse.class))) }) @@ -171,6 +176,7 @@ public String create(@Parameter(hidden = true) final String apiRequestBodyAsJson @PUT @Path("{userId}") @Operation(summary = "Update a User", operationId = "updateUser", tags = { "Users" }, description = "Updates the user") + @AlternativeOperationId("update_26") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PutUsersUserIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.PutUsersUserIdResponse.class))) }) @@ -193,6 +199,7 @@ public String update(@PathParam("userId") @Parameter(description = "userId") fin @Path("{userId}/pwd") @Operation(summary = "Change the password of a User", operationId = "changePasswordUser", tags = { "Users" }, description = "When updating a password you must provide the repeatPassword parameter also.") + @AlternativeOperationId("changePassword") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.ChangePwdUsersUserIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.ChangePwdUsersUserIdResponse.class))) }) @@ -215,6 +222,7 @@ public String changePassword(@PathParam("userId") @Parameter(description = "user @Path("{userId}") @Operation(summary = "Delete a User", operationId = "deleteUser", tags = { "Users" }, description = "Removes the user and the associated roles and permissions.") + @AlternativeOperationId("delete_23") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UsersApiResourceSwagger.DeleteUsersUserIdResponse.class))) }) @Produces({ MediaType.APPLICATION_JSON }) @@ -234,6 +242,7 @@ public String delete(@PathParam("userId") @Parameter(description = "userId") fin @Produces("application/vnd.ms-excel") @Operation(summary = "Download users template", operationId = "getBulkTemplateUser", description = "Returns an Excel template for bulk importing users.", tags = { "Users" }) + @AlternativeOperationId("getUserTemplate") public Response getUserTemplate(@QueryParam("officeId") final Long officeId, @QueryParam("staffId") final Long staffId, @QueryParam("dateFormat") final String dateFormat) { return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.USERS.toString(), officeId, staffId, dateFormat); @@ -246,6 +255,7 @@ public Response getUserTemplate(@QueryParam("officeId") final Long officeId, @Qu @Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) }) @Operation(summary = "Upload users template", operationId = "postBulkTemplateUser", description = "Uploads a filled Excel template to create multiple users in bulk.", tags = { "Users" }) + @AlternativeOperationId("postUsersTemplate") public String postUsersTemplate(@FormDataParam("file") InputStream uploadedInputStream, @FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale, @FormDataParam("dateFormat") final String dateFormat) { diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReaderTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReaderTest.java new file mode 100644 index 00000000000..724c9f7b51f --- /dev/null +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/openapi/FineractOperationIdReaderTest.java @@ -0,0 +1,140 @@ +/** + * 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.openapi; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.Paths; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import java.util.Map; +import java.util.Set; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; +import org.junit.jupiter.api.Test; + +class FineractOperationIdReaderTest { + + @Test + void addsAlternativeOperationIdExtension() { + OpenAPI openAPI = new FineractOperationIdReader().read(Set.of(ResourceWithAlternativeOperationId.class), Map.of()); + + Object alternativeOperationId = openAPI.getPaths().get("/test").getGet().getExtensions() + .get(FineractOperationIdReader.ALTERNATIVE_OPERATION_ID_EXTENSION); + + assertEquals("retrieveTestByLegacyName", alternativeOperationId); + } + + @Test + void addsAlternativeOperationIdExtensionForImplicitOperationId() { + OpenAPI openAPI = new FineractOperationIdReader().read(Set.of(ResourceWithImplicitOperationIdAlternative.class), Map.of()); + + Object alternativeOperationId = openAPI.getPaths().get("/implicit").getGet().getExtensions() + .get(FineractOperationIdReader.ALTERNATIVE_OPERATION_ID_EXTENSION); + + assertEquals("retrieveImplicitTestByLegacyName", alternativeOperationId); + } + + @Test + void rejectsInvalidAlternativeOperationId() { + IllegalStateException exception = assertThrows(IllegalStateException.class, + () -> new FineractOperationIdReader().read(Set.of(ResourceWithInvalidAlternativeOperationId.class), Map.of())); + + assertTrue(exception.getMessage().contains("valid Java method name")); + } + + @Test + void allowsAlternativeOperationIdMatchingAnotherOperationId() { + OpenAPI openAPI = new FineractOperationIdReader() + .read(Set.of(ResourceWithAlternativeOperationIdConflict.class, ResourceWithImplicitOperationId.class), Map.of()); + + Object alternativeOperationId = openAPI.getPaths().get("/conflict").getGet().getExtensions() + .get(FineractOperationIdReader.ALTERNATIVE_OPERATION_ID_EXTENSION); + + assertEquals("retrieveImplicitConflict", alternativeOperationId); + } + + @Test + void rejectsDuplicateFinalOperationIds() { + OpenAPI openAPI = new OpenAPI().paths(new Paths() + .addPathItem("/first", new PathItem().get(new io.swagger.v3.oas.models.Operation().operationId("duplicateOperation"))) + .addPathItem("/second", new PathItem().post(new io.swagger.v3.oas.models.Operation().operationId("duplicateOperation")))); + + IllegalStateException exception = assertThrows(IllegalStateException.class, + () -> FineractOperationIdReader.OperationIdValidator.validate(openAPI)); + + assertTrue(exception.getMessage().contains("Duplicate OpenAPI operationIds")); + } + + @Path("/test") + public static class ResourceWithAlternativeOperationId { + + @GET + @Operation(operationId = "retrieveTest") + @AlternativeOperationId("retrieveTestByLegacyName") + public String retrieveTest() { + return "test"; + } + } + + @Path("/implicit") + public static class ResourceWithImplicitOperationIdAlternative { + + @GET + @AlternativeOperationId("retrieveImplicitTestByLegacyName") + public String retrieveImplicitTest() { + return "implicit"; + } + } + + @Path("/invalid") + public static class ResourceWithInvalidAlternativeOperationId { + + @GET + @Operation(operationId = "retrieveInvalid") + @AlternativeOperationId("class") + public String retrieveInvalid() { + return "invalid"; + } + } + + @Path("/conflict") + public static class ResourceWithAlternativeOperationIdConflict { + + @GET + @Operation(operationId = "retrieveConflict") + @AlternativeOperationId("retrieveImplicitConflict") + public String retrieveConflict() { + return "conflict"; + } + } + + @Path("/implicit-conflict") + public static class ResourceWithImplicitOperationId { + + @GET + public String retrieveImplicitConflict() { + return "implicit-conflict"; + } + } +} diff --git a/fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java b/fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java index de75e85029d..b52dea3432e 100644 --- a/fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java +++ b/fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java @@ -39,6 +39,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -75,6 +76,7 @@ public CommandProcessingResult createFloatingRate(@Parameter(hidden = true) fina @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "List Floating Rates", operationId = "retrieveAllFloatingRates", description = "Lists Floating Rates") + @AlternativeOperationId("retrieveAll_22") @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.GetFloatingRatesResponse.class)))) public List retrieveAll() { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME); @@ -85,6 +87,7 @@ public List retrieveAll() { @Path("{floatingRateId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Floating Rate", operationId = "retrieveOneFloatingRate", description = "Retrieves Floating Rate") + @AlternativeOperationId("retrieveOne_13") public FloatingRateData retrieveOne(@PathParam("floatingRateId") @Parameter(description = "floatingRateId") final Long floatingRateId) { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME); return floatingRatesReadPlatformService.retrieveOne(floatingRateId); diff --git a/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorApiResource.java b/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorApiResource.java index 1ea8a2e6fb2..7488fa62c6e 100644 --- a/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorApiResource.java +++ b/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorApiResource.java @@ -18,6 +18,7 @@ */ package org.apache.fineract.infrastructure.security.api; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.GET; @@ -34,6 +35,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.core.serialization.ToApiJsonSerializer; @@ -97,6 +99,8 @@ public String validate(@QueryParam("token") final String token) { @Path("invalidate") @POST @Produces({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "updateConfiguration") + @AlternativeOperationId("updateConfiguration_2") public String updateConfiguration(final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().invalidateTwoFactorAccessToken().withJson(apiRequestBodyAsJson) .build(); diff --git a/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorConfigurationApiResource.java b/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorConfigurationApiResource.java index 9745a3e26cb..0f47e32fbd7 100644 --- a/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorConfigurationApiResource.java +++ b/fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/TwoFactorConfigurationApiResource.java @@ -18,6 +18,7 @@ */ package org.apache.fineract.infrastructure.security.api; +import io.swagger.v3.oas.annotations.Operation; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET; import jakarta.ws.rs.PUT; @@ -29,6 +30,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -51,6 +53,8 @@ public class TwoFactorConfigurationApiResource { private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService; @GET + @Operation(operationId = "retrieveAll_4") + @AlternativeOperationId("retrieveAll_9") public String retrieveAll() { this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); Map configurationMap = configurationService.retrieveAll(); @@ -59,6 +63,8 @@ public String retrieveAll() { @PUT @Consumes({ MediaType.APPLICATION_JSON }) + @Operation(operationId = "updateConfiguration_1") + @AlternativeOperationId("updateConfiguration_3") public String updateConfiguration(final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder().updateTwoFactorConfiguration().withJson(apiRequestBodyAsJson) .build(); diff --git a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java index 11e6fe2abd7..40b545cce8a 100644 --- a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java +++ b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxComponentApiResource.java @@ -40,6 +40,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -75,6 +76,7 @@ public List retrieveAllTaxComponents() { @Path("{taxComponentId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Tax Component", operationId = "retrieveOneTaxComponent", description = "Retrieve Tax Component") + @AlternativeOperationId("retrieveTaxComponent") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.GetTaxesComponentsResponse.class))) }) public TaxComponentData retrieveTaxComponent( @@ -87,6 +89,7 @@ public TaxComponentData retrieveTaxComponent( @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Tax Component Template", operationId = "retrieveTemplateTaxComponent") + @AlternativeOperationId("retrieveTemplate_21") public TaxComponentData retrieveTemplate() { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); return readPlatformService.retrieveTaxComponentTemplate(); @@ -112,6 +115,7 @@ public CommandProcessingResult createTaxComponent(@Parameter(hidden = true) TaxC @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Update Tax Component", operationId = "updateTaxComponent", description = "Updates Tax component. Debit and credit account details cannot be modified. All the future tax components would be replaced with the new percentage.") + @AlternativeOperationId("updateTaxCompoent") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.PutTaxesComponentsTaxComponentIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxComponentApiResourceSwagger.PutTaxesComponentsTaxComponentIdResponse.class))) }) diff --git a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java index 4e72ae98bb3..e808aa32aab 100644 --- a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java +++ b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/api/TaxGroupApiResource.java @@ -41,6 +41,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.annotation.AlternativeOperationId; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -78,6 +79,7 @@ public List retrieveAllTaxGroups() { @Path("{taxGroupId}") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Tax Group", operationId = "retrieveOneTaxGroup", description = "Retrieve Tax Group") + @AlternativeOperationId("retrieveTaxGroup") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TaxGroupApiResourceSwagger.GetTaxesGroupResponse.class))) public TaxGroupData retrieveTaxGroup(@PathParam("taxGroupId") @Parameter(description = "taxGroupId") final Long taxGroupId, @Context final UriInfo uriInfo) { @@ -91,6 +93,7 @@ public TaxGroupData retrieveTaxGroup(@PathParam("taxGroupId") @Parameter(descrip @Path("template") @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Retrieve Tax Group Template", operationId = "retrieveTemplateTaxGroup") + @AlternativeOperationId("retrieveTemplate_22") public TaxGroupData retrieveTemplate() { context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS); return readPlatformService.retrieveTaxGroupTemplate(); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java index 4031caeb5de..180e7ea201e 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java @@ -133,7 +133,7 @@ protected void runAt(String date, Runnable runnable) { try { globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE, new PutGlobalConfigurationsRequest().enabled(true)); - businessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE) + BusinessDateHelper.updateBusinessDate(new BusinessDateUpdateRequest().type(BusinessDateUpdateRequest.TypeEnum.BUSINESS_DATE) .date(date).dateFormat(DATETIME_PATTERN).locale("en")); runnable.run(); } finally {