From 4735bee5e2aeb6ae2f1f0397442bf2f631700e4b Mon Sep 17 00:00:00 2001 From: Anhelina Date: Fri, 1 May 2026 16:18:32 +0300 Subject: [PATCH] FINERACT-1222: Add Swagger tags for Journal Entries --- .../api/JournalEntriesApiResource.java | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) 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 c955afa66a0..dde8c0483f3 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 @@ -98,12 +98,14 @@ public class JournalEntriesApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) - @Operation(summary = "List Journal Entries", operationId = "retrieveAllJournalEntries", description = "The list capability of journal entries can support pagination and sorting.\n\n" - + "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n" - + "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n" - + "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + "journalentries?offset=10&limit=50\n" - + "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n" + "journalentries?runningBalance=true\n" + "\n" - + "journalentries?transactionDetails=true\n" + "\n" + "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24") + @Operation(summary = "List Journal Entries", operationId = "retrieveAllJournalEntries", tags = { + "Journal Entries" }, description = "The list capability of journal entries can support pagination and sorting.\n\n" + + "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n" + + "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n" + + "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + + "journalentries?offset=10&limit=50\n" + "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n" + + "journalentries?runningBalance=true\n" + "\n" + "journalentries?transactionDetails=true\n" + "\n" + + "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24") @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, @@ -165,9 +167,9 @@ public String retrieveAll(@Context final UriInfo uriInfo, @GET @Path("{journalEntryId}") @Produces({ MediaType.APPLICATION_JSON }) - @Operation(summary = "Retrieve a single Entry", description = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n" - + "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + "journalentries/1?runningBalance=true\n" + "\n" - + "journalentries/1?transactionDetails=true") + @Operation(summary = "Retrieve a single Entry", tags = { "Journal Entries" }, description = "Example Requests:\n" + "\n" + + "journalentries/1\n" + "\n" + "\n" + "\n" + "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + + "journalentries/1?runningBalance=true\n" + "\n" + "journalentries/1?transactionDetails=true") @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.JournalEntryTransactionItem.class))) public String retrieveJournalEntryById( @PathParam("journalEntryId") @Parameter(description = "journalEntryId") final Long journalEntryId, @@ -188,11 +190,12 @@ public String retrieveJournalEntryById( @POST @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @Operation(summary = "Create \"Balanced\" Journal Entries", description = "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \n" - + "Compound Journal entries may have \"n\" debits and \"m\" credits where both \"m\" and \"n\" are greater than 0 and the net sum or all debits and credits are equal \n\n" - + "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n " - + "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n" - + "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber") + @Operation(summary = "Create \"Balanced\" Journal Entries", tags = { + "Journal Entries" }, description = "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \n" + + "Compound Journal entries may have \"n\" debits and \"m\" credits where both \"m\" and \"n\" are greater than 0 and the net sum or all debits and credits are equal \n\n" + + "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n " + + "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n" + + "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber") @RequestBody(content = @Content(schema = @Schema(implementation = JournalEntryCommand.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesResponse.class))) public String createGLJournalEntry(@Parameter(hidden = true) final String jsonRequestBody, @@ -218,8 +221,9 @@ public String createGLJournalEntry(@Parameter(hidden = true) final String jsonRe @Path("{transactionId}") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - @Operation(summary = "Update Running balances for Journal Entries", description = "This API calculates the running balances for office. If office ID not provided this API calculates running balances for all offices. \n" - + "Mandatory Fields\n" + "officeId") + @Operation(summary = "Update Running balances for Journal Entries", tags = { + "Journal Entries" }, description = "This API calculates the running balances for office. If office ID not provided this API calculates running balances for all offices. \n" + + "Mandatory Fields\n" + "officeId") @RequestBody(content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class))) @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class))) public String createReversalJournalEntry(@Parameter(hidden = true) final String jsonRequestBody, @@ -240,6 +244,8 @@ public String createReversalJournalEntry(@Parameter(hidden = true) final String @GET @Path("provisioning") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(summary = "Retrieve Journal Entries for Provisioning", description = "Returns journal entries related to provisioning entries based on entry ID.", tags = { + "Journal Entries" }) public String retrieveJournalEntries(@QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit, @QueryParam("entryId") final Long entryId, @Context final UriInfo uriInfo) { this.context.authenticatedUser(); @@ -254,6 +260,8 @@ public String retrieveJournalEntries(@QueryParam("offset") final Integer offset, @GET @Path("openingbalance") @Produces({ MediaType.APPLICATION_JSON }) + @Operation(summary = "Retrieve Opening Balance", description = "Returns the opening balance for a specific office and currency.", tags = { + "Journal Entries" }) public String retrieveOpeningBalance(@Context final UriInfo uriInfo, @QueryParam("officeId") final Long officeId, @QueryParam("currencyCode") final String currencyCode) { @@ -271,6 +279,8 @@ private boolean is(final String commandParam, final String commandValue) { @GET @Path("downloadtemplate") @Produces("application/vnd.ms-excel") + @Operation(summary = "Download journal entries template", description = "Returns an Excel template for bulk importing journal entries.", tags = { + "Journal Entries" }) public Response getJournalEntriesTemplate(@QueryParam("officeId") final Long officeId, @QueryParam("dateFormat") final String dateFormat) { return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.GL_JOURNAL_ENTRIES.toString(), officeId, null, dateFormat); @@ -281,6 +291,8 @@ public Response getJournalEntriesTemplate(@QueryParam("officeId") final Long off @Consumes(MediaType.MULTIPART_FORM_DATA) @RequestBody(description = "Upload journal entries template", content = { @Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) }) + @Operation(summary = "Upload journal entries template", description = "Uploads a filled Excel template to create multiple journal entries in bulk.", tags = { + "Journal Entries" }) public String postJournalEntriesTemplate(@FormDataParam("file") InputStream uploadedInputStream, @FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale, @FormDataParam("dateFormat") final String dateFormat) {