Skip to content

Commit c50113a

Browse files
Aman-Mittaladamsaghy
authored andcommitted
FINERACT-2346: Minor SonarQube fixes
1 parent 3b62d56 commit c50113a

File tree

17 files changed

+171
-148
lines changed

17 files changed

+171
-148
lines changed

custom/acme/loan/starter/src/test/java/com/acme/fineract/loan/starter/AcmeBusinessStepDefinitions.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public AcmeBusinessStepDefinitions() {
5151
});
5252

5353
When("/^The user retrieves the step service with step class (.*) and name (.*)$/", (String stepClass, String stepName) -> {
54-
contextRunner.run((ctx) -> {
54+
contextRunner.run(ctx -> {
5555
this.businessStepService = ctx.getBean(COBBusinessStepService.class);
5656

5757
this.businessStep = ctx.getBean((Class<COBBusinessStep<Loan>>) Class.forName(stepClass));
@@ -64,7 +64,6 @@ public AcmeBusinessStepDefinitions() {
6464
Then("/^The step service should have a result$/", () -> {
6565
assertThat(this.businessStep).isNotNull();
6666
assertThat(this.result).isNotNull();
67-
// log.warn(">>>>>>>>>>>>>>>>>> RESULT: {}", this.result);
6867
});
6968
}
7069
}

fineract-accounting/src/main/java/org/apache/fineract/accounting/closure/api/GLClosuresApiResource.java

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@
5757

5858
@Path("/v1/glclosures")
5959
@Component
60-
@Tag(name = "Accounting Closure", description = "An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date\n"
61-
+ "\n" + "Field Descriptions\n" + "closingDate\n" + "The date for which the accounting closure is defined\n" + "officeId\n"
62-
+ "The identifer of the branch for which accounting has been closed\n" + "comments\n"
63-
+ "Description associated with an Accounting closure")
60+
@Tag(name = "Accounting Closure", description = """
61+
An accounting closure indicates that no more journal entries may be logged (or reversed) in the system, either manually or via the portfolio with an entry date prior to the defined closure date
62+
63+
Field Descriptions
64+
closingDate
65+
The date for which the accounting closure is defined
66+
officeId
67+
The identifer of the branch for which accounting has been closed
68+
comments
69+
Description associated with an Accounting closure
70+
""")
6471
@RequiredArgsConstructor
6572
public class GLClosuresApiResource {
6673

@@ -76,9 +83,11 @@ public class GLClosuresApiResource {
7683
@GET
7784
@Consumes({ MediaType.APPLICATION_JSON })
7885
@Produces({ MediaType.APPLICATION_JSON })
79-
@Operation(summary = "List Accounting closures", description = "Example Requests:\n" + "\n" + "glclosures")
80-
@ApiResponses({
81-
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class)))) })
86+
@Operation(summary = "List Accounting closures", description = """
87+
Example Requests:
88+
89+
glclosures""")
90+
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))))
8291
public List<GLClosureData> retrieveAllClosures(@QueryParam("officeId") @Parameter(name = "officeId") final Long officeId) {
8392

8493
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION);
@@ -89,10 +98,14 @@ public List<GLClosureData> retrieveAllClosures(@QueryParam("officeId") @Paramete
8998
@Path("{glClosureId}")
9099
@Consumes({ MediaType.APPLICATION_JSON })
91100
@Produces({ MediaType.APPLICATION_JSON })
92-
@Operation(summary = "Retrieve an Accounting Closure", description = "Example Requests:\n" + "\n" + "glclosures/1\n" + "\n" + "\n"
93-
+ "/glclosures/1?fields=officeName,closingDate")
94-
@ApiResponses({
95-
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class))) })
101+
@Operation(summary = "Retrieve an Accounting Closure", description = """
102+
Example Requests:
103+
104+
glclosures/1
105+
106+
107+
/glclosures/1?fields=officeName,closingDate""")
108+
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.GetGlClosureResponse.class)))
96109
public GLClosureData retreiveClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
97110
@Context final UriInfo uriInfo) {
98111
context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSION);
@@ -127,8 +140,7 @@ public CommandProcessingResult createGLClosure(@Parameter(hidden = true) GLClosu
127140
@Produces({ MediaType.APPLICATION_JSON })
128141
@Operation(summary = "Update an Accounting closure", description = "Once an accounting closure is created, only the comments associated with it may be edited")
129142
@RequestBody(content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresRequest.class)))
130-
@ApiResponses({
131-
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class))) })
143+
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.PutGlClosuresResponse.class)))
132144
public CommandProcessingResult updateGLClosure(@PathParam("glClosureId") @Parameter(description = "glClosureId") final Long glClosureId,
133145
@Parameter(hidden = true) GLClosureRequest glClosureRequest) {
134146
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateGLClosure(glClosureId)
@@ -141,8 +153,7 @@ public CommandProcessingResult updateGLClosure(@PathParam("glClosureId") @Parame
141153
@Consumes({ MediaType.APPLICATION_JSON })
142154
@Produces({ MediaType.APPLICATION_JSON })
143155
@Operation(summary = "Delete an accounting closure", description = "Note: Only the latest accounting closure associated with a branch may be deleted.")
144-
@ApiResponses({
145-
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class))) })
156+
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GLClosuresApiResourceSwagger.DeleteGlClosuresResponse.class)))
146157
public CommandProcessingResult deleteGLClosure(
147158
@PathParam("glClosureId") @Parameter(description = "glclosureId") final Long glClosureId) {
148159
final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteGLClosure(glClosureId).build();

fineract-branch/src/main/java/org/apache/fineract/organisation/teller/api/TellerApiResource.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,11 @@ public TellerData findTeller(@PathParam("tellerId") @Parameter(description = "te
9797
@POST
9898
@Consumes({ MediaType.APPLICATION_JSON })
9999
@Produces(MediaType.APPLICATION_JSON)
100-
@Operation(summary = "Create teller", description = "Mandatory Fields\n" + "Teller name, OfficeId, Description, Start Date, Status\n"
101-
+ "Optional Fields\n" + "End Date")
100+
@Operation(summary = "Create teller", description = """
101+
Mandatory Fields
102+
Teller name, OfficeId, Description, Start Date, Status
103+
Optional Fields
104+
End Date""")
102105
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersRequest.class)))
103106
@ApiResponses({
104107
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersResponse.class))) })
@@ -185,9 +188,14 @@ public CashierData getCashierTemplate(@PathParam("tellerId") @Parameter(descript
185188
@Path("{tellerId}/cashiers")
186189
@Consumes({ MediaType.APPLICATION_JSON })
187190
@Produces(MediaType.APPLICATION_JSON)
188-
@Operation(summary = "Create Cashiers", description = "Mandatory Fields: \n"
189-
+ "Cashier/staff, Fromm Date, To Date, Full Day or From time and To time\n" + "\n\n\n" + "Optional Fields: \n"
190-
+ "Description/Notes")
191+
@Operation(summary = "Create Cashiers", description = """
192+
Mandatory Fields:\s
193+
Cashier/staff, Fromm Date, To Date, Full Day or From time and To time
194+
195+
196+
197+
Optional Fields:\s
198+
Description/Notes""")
191199
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersRequest.class)))
192200
@ApiResponses({
193201
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = TellerApiResourceSwagger.PostTellersTellerIdCashiersResponse.class))) })

0 commit comments

Comments
 (0)