Skip to content

Commit d38e50d

Browse files
committed
FINERACT-1222: Add Swagger tags for Journal Entries
1 parent 10c8562 commit d38e50d

2 files changed

Lines changed: 31 additions & 45 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) {

gradle.properties

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one
3-
# or more contributor license agreements. See the NOTICE file
4-
# distributed with this work for additional information
5-
# regarding copyright ownership. The ASF licenses this file
6-
# to you under the Apache License, Version 2.0 (the
7-
# "License"); you may not use this file except in compliance
8-
# with the License. You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing,
13-
# software distributed under the License is distributed on an
14-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
# KIND, either express or implied. See the License for the
16-
# specific language governing permissions and limitations
17-
# under the License.
18-
#
19-
org.gradle.jvmargs=-Xmx12g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=null
20-
buildType=BUILD
21-
org.gradle.caching=true
22-
org.gradle.parallel=true
23-
# Keep worker concurrency below CPU count to avoid heap spikes from parallel project tasks
24-
# and forked Java compilation running alongside Avro code generation.
25-
org.gradle.workers.max=4
26-
org.gradle.daemon.idletimeout=10800000
27-
# Temporarily disabled until we fix configuration cache compatibility
28-
#org.gradle.configuration-cache=true
29-
org.gradle.vfs.watch=true
1+
org.gradle.jvmargs=-Xmx14g -XX:MaxMetaspaceSize=512m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.management/javax.management=ALL-UNNAMED --add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED
2+
3+

0 commit comments

Comments
 (0)