Skip to content

Commit 23c7c7a

Browse files
committed
FINERACT-1222: Add Swagger tags for Journal Entries
Signed-off-by: Anhelina <angelinazmitrevic2@gmail.com>
1 parent 10c8562 commit 23c7c7a

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/api/JournalEntriesApiResource.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
import jakarta.ws.rs.Consumes;
2929
import jakarta.ws.rs.GET;
3030
import jakarta.ws.rs.POST;
31+
import io.swagger.v3.oas.annotations.Operation;
32+
import io.swagger.v3.oas.annotations.tags.Tag;
3133
import jakarta.ws.rs.Path;
34+
3235
import jakarta.ws.rs.PathParam;
3336
import jakarta.ws.rs.Produces;
3437
import jakarta.ws.rs.QueryParam;
@@ -98,7 +101,7 @@ public class JournalEntriesApiResource {
98101

99102
@GET
100103
@Produces({ MediaType.APPLICATION_JSON })
101-
@Operation(summary = "List Journal Entries", operationId = "retrieveAllJournalEntries", description = "The list capability of journal entries can support pagination and sorting.\n\n"
104+
@Operation(summary = "List Journal Entries", operationId = "retrieveAllJournalEntries", tags = {"Journal Entries"}, description = "The list capability of journal entries can support pagination and sorting.\n\n"
102105
+ "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n"
103106
+ "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n"
104107
+ "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + "journalentries?offset=10&limit=50\n"
@@ -165,7 +168,7 @@ public String retrieveAll(@Context final UriInfo uriInfo,
165168
@GET
166169
@Path("{journalEntryId}")
167170
@Produces({ MediaType.APPLICATION_JSON })
168-
@Operation(summary = "Retrieve a single Entry", description = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n"
171+
@Operation(summary = "Retrieve a single Entry", tags = {"Journal Entries"}, description = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n"
169172
+ "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + "journalentries/1?runningBalance=true\n" + "\n"
170173
+ "journalentries/1?transactionDetails=true")
171174
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.JournalEntryTransactionItem.class)))
@@ -188,7 +191,7 @@ public String retrieveJournalEntryById(
188191
@POST
189192
@Consumes({ MediaType.APPLICATION_JSON })
190193
@Produces({ MediaType.APPLICATION_JSON })
191-
@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"
194+
@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"
192195
+ "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"
193196
+ "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n "
194197
+ "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n"
@@ -218,7 +221,7 @@ public String createGLJournalEntry(@Parameter(hidden = true) final String jsonRe
218221
@Path("{transactionId}")
219222
@Consumes({ MediaType.APPLICATION_JSON })
220223
@Produces({ MediaType.APPLICATION_JSON })
221-
@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"
224+
@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"
222225
+ "Mandatory Fields\n" + "officeId")
223226
@RequestBody(content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class)))
224227
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class)))
@@ -240,6 +243,9 @@ public String createReversalJournalEntry(@Parameter(hidden = true) final String
240243
@GET
241244
@Path("provisioning")
242245
@Produces({ MediaType.APPLICATION_JSON })
246+
@Operation(summary = "Retrieve Journal Entries for Provisioning",
247+
description = "Returns journal entries related to provisioning entries based on entry ID.",
248+
tags = {"Journal Entries"})
243249
public String retrieveJournalEntries(@QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
244250
@QueryParam("entryId") final Long entryId, @Context final UriInfo uriInfo) {
245251
this.context.authenticatedUser();
@@ -254,6 +260,7 @@ public String retrieveJournalEntries(@QueryParam("offset") final Integer offset,
254260
@GET
255261
@Path("openingbalance")
256262
@Produces({ MediaType.APPLICATION_JSON })
263+
@Operation(summary = "Retrieve Opening Balance", description = "Returns the opening balance for a specific office and currency.", tags = {"Journal Entries"})
257264
public String retrieveOpeningBalance(@Context final UriInfo uriInfo, @QueryParam("officeId") final Long officeId,
258265
@QueryParam("currencyCode") final String currencyCode) {
259266

@@ -271,6 +278,7 @@ private boolean is(final String commandParam, final String commandValue) {
271278
@GET
272279
@Path("downloadtemplate")
273280
@Produces("application/vnd.ms-excel")
281+
@Operation(summary = "Download journal entries template", description = "Returns an Excel template for bulk importing journal entries.", tags = {"Journal Entries"})
274282
public Response getJournalEntriesTemplate(@QueryParam("officeId") final Long officeId,
275283
@QueryParam("dateFormat") final String dateFormat) {
276284
return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.GL_JOURNAL_ENTRIES.toString(), officeId, null, dateFormat);
@@ -281,6 +289,7 @@ public Response getJournalEntriesTemplate(@QueryParam("officeId") final Long off
281289
@Consumes(MediaType.MULTIPART_FORM_DATA)
282290
@RequestBody(description = "Upload journal entries template", content = {
283291
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
292+
@Operation(summary = "Upload journal entries template", description = "Uploads a filled Excel template to create multiple journal entries in bulk.", tags = {"Journal Entries"})
284293
public String postJournalEntriesTemplate(@FormDataParam("file") InputStream uploadedInputStream,
285294
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
286295
@FormDataParam("dateFormat") final String dateFormat) {

0 commit comments

Comments
 (0)