Skip to content

Commit 08d2e00

Browse files
committed
FINERACT-1222: Add Swagger tags for Journal Entries
1 parent ca738eb commit 08d2e00

1 file changed

Lines changed: 28 additions & 16 deletions

File tree

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

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ public class JournalEntriesApiResource {
9898

9999
@GET
100100
@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"
102-
+ "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n"
103-
+ "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n"
104-
+ "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n" + "journalentries?offset=10&limit=50\n"
105-
+ "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n" + "journalentries?runningBalance=true\n" + "\n"
106-
+ "journalentries?transactionDetails=true\n" + "\n" + "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24")
101+
@Operation(summary = "List Journal Entries", operationId = "retrieveAllJournalEntries", tags = {
102+
"Journal Entries" }, description = "The list capability of journal entries can support pagination and sorting.\n\n"
103+
+ "Example Requests:\n" + "\n" + "journalentries\n" + "\n" + "journalentries?transactionId=PB37X8Y21EQUY4S\n" + "\n"
104+
+ "journalentries?officeId=1&manualEntriesOnly=true&fromDate=1 July 2013&toDate=15 July 2013&dateFormat=dd MMMM yyyy&locale=en\n"
105+
+ "\n" + "journalentries?fields=officeName,glAccountName,transactionDate\n" + "\n"
106+
+ "journalentries?offset=10&limit=50\n" + "\n" + "journalentries?orderBy=transactionId&sortOrder=DESC\n" + "\n"
107+
+ "journalentries?runningBalance=true\n" + "\n" + "journalentries?transactionDetails=true\n" + "\n"
108+
+ "journalentries?loanId=12\n" + "\n" + "journalentries?savingsId=24")
107109
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.GetJournalEntriesTransactionIdResponse.class)))
108110
public String retrieveAll(@Context final UriInfo uriInfo,
109111
@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
@@ -165,9 +167,9 @@ public String retrieveAll(@Context final UriInfo uriInfo,
165167
@GET
166168
@Path("{journalEntryId}")
167169
@Produces({ MediaType.APPLICATION_JSON })
168-
@Operation(summary = "Retrieve a single Entry", description = "Example Requests:\n" + "\n" + "journalentries/1\n" + "\n" + "\n" + "\n"
169-
+ "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n" + "journalentries/1?runningBalance=true\n" + "\n"
170-
+ "journalentries/1?transactionDetails=true")
170+
@Operation(summary = "Retrieve a single Entry", tags = { "Journal Entries" }, description = "Example Requests:\n" + "\n"
171+
+ "journalentries/1\n" + "\n" + "\n" + "\n" + "journalentries/1?fields=officeName,glAccountId,entryType,amount\n" + "\n"
172+
+ "journalentries/1?runningBalance=true\n" + "\n" + "journalentries/1?transactionDetails=true")
171173
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.JournalEntryTransactionItem.class)))
172174
public String retrieveJournalEntryById(
173175
@PathParam("journalEntryId") @Parameter(description = "journalEntryId") final Long journalEntryId,
@@ -188,11 +190,12 @@ public String retrieveJournalEntryById(
188190
@POST
189191
@Consumes({ MediaType.APPLICATION_JSON })
190192
@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"
192-
+ "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"
193-
+ "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n "
194-
+ "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n"
195-
+ "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber")
193+
@Operation(summary = "Create \"Balanced\" Journal Entries", tags = {
194+
"Journal Entries" }, description = "Note: A Balanced (simple) Journal entry would have atleast one \"Debit\" and one \"Credit\" entry whose amounts are equal \n"
195+
+ "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"
196+
+ "\n" + "Mandatory Fields\n" + "officeId, transactionDate\n\n" + "\ncredits- glAccountId, amount, comments\n\n "
197+
+ "\ndebits- glAccountId, amount, comments\n\n " + "\n" + "Optional Fields\n"
198+
+ "paymentTypeId, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber")
196199
@RequestBody(content = @Content(schema = @Schema(implementation = JournalEntryCommand.class)))
197200
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesResponse.class)))
198201
public String createGLJournalEntry(@Parameter(hidden = true) final String jsonRequestBody,
@@ -218,8 +221,9 @@ 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"
222-
+ "Mandatory Fields\n" + "officeId")
224+
@Operation(summary = "Update Running balances for Journal Entries", tags = {
225+
"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"
226+
+ "Mandatory Fields\n" + "officeId")
223227
@RequestBody(content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdRequest.class)))
224228
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = JournalEntriesApiResourceSwagger.PostJournalEntriesTransactionIdResponse.class)))
225229
public String createReversalJournalEntry(@Parameter(hidden = true) final String jsonRequestBody,
@@ -240,6 +244,8 @@ public String createReversalJournalEntry(@Parameter(hidden = true) final String
240244
@GET
241245
@Path("provisioning")
242246
@Produces({ MediaType.APPLICATION_JSON })
247+
@Operation(summary = "Retrieve Journal Entries for Provisioning", description = "Returns journal entries related to provisioning entries based on entry ID.", tags = {
248+
"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,8 @@ 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 = {
264+
"Journal Entries" })
257265
public String retrieveOpeningBalance(@Context final UriInfo uriInfo, @QueryParam("officeId") final Long officeId,
258266
@QueryParam("currencyCode") final String currencyCode) {
259267

@@ -271,6 +279,8 @@ private boolean is(final String commandParam, final String commandValue) {
271279
@GET
272280
@Path("downloadtemplate")
273281
@Produces("application/vnd.ms-excel")
282+
@Operation(summary = "Download journal entries template", description = "Returns an Excel template for bulk importing journal entries.", tags = {
283+
"Journal Entries" })
274284
public Response getJournalEntriesTemplate(@QueryParam("officeId") final Long officeId,
275285
@QueryParam("dateFormat") final String dateFormat) {
276286
return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.GL_JOURNAL_ENTRIES.toString(), officeId, null, dateFormat);
@@ -281,6 +291,8 @@ public Response getJournalEntriesTemplate(@QueryParam("officeId") final Long off
281291
@Consumes(MediaType.MULTIPART_FORM_DATA)
282292
@RequestBody(description = "Upload journal entries template", content = {
283293
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
294+
@Operation(summary = "Upload journal entries template", description = "Uploads a filled Excel template to create multiple journal entries in bulk.", tags = {
295+
"Journal Entries" })
284296
public String postJournalEntriesTemplate(@FormDataParam("file") InputStream uploadedInputStream,
285297
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
286298
@FormDataParam("dateFormat") final String dateFormat) {

0 commit comments

Comments
 (0)