Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.apache.fineract.test.stepdef.loan;

public enum PostWorkingCapitalLoanProductsRequest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,14 @@ public class StaffApiResource {
private final CommandPipeline commandPipeline;

@GET
@Operation(summary = "Retrieve Staff", operationId = "retrieveAllStaff", description = """
Returns the list of staff members.

Example Requests:

- /staff
- /staff?status=ACTIVE
- /staff?status=INACTIVE
- /staff?status=ALL

By default it Returns all the ACTIVE Staff. Otherwise a status can be provided like e.g. status=INACTIVE,
then it returns all INACTIVE staff or status=ALL returns both ACTIVE and INACTIVE staff.
""")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Retrieve Staff", operationId = "retrieveAllStaff", description = "Returns the list of staff members.\n" + "\n"
+ "Example Requests:\n" + "\n" + "staff\n\n\n\n" + "\n" + "Retrieve a Staff by status\n" + "\n"
+ "Returns the details of a Staff based on status.\n" + "\n" + "By default it Returns all the ACTIVE Staff.\n" + "\n"
+ "If status=INACTIVE, then it returns all INACTIVE Staff.\n" + "\n"
+ "and for status=ALL, it Returns both ACTIVE and INACTIVE Staff.\n" + "\n" + "Example Requests:\n" + "\n"
+ "staff?status=active")
public List<StaffData> retrieveAll(@QueryParam("officeId") @Parameter(description = "officeId") final Long officeId,
@DefaultValue("false") @QueryParam("staffInOfficeHierarchy") @Parameter(description = "staffInOfficeHierarchy") final boolean staffInOfficeHierarchy,
@DefaultValue("false") @QueryParam("loanOfficersOnly") @Parameter(description = "loanOfficersOnly") final boolean loanOfficersOnly,
Expand All @@ -100,13 +95,10 @@ public List<StaffData> retrieveAll(@QueryParam("officeId") @Parameter(descriptio

@GET
@Path("{staffId}")
@Operation(summary = "Retrieve a Staff Member", operationId = "retrieveOneStaff", description = """
Returns the details of a Staff Member.

Example Requests:

- /staff/1
""")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Retrieve a Staff Member", operationId = "retrieveOneStaff", description = "Returns the details of a Staff Member.\n"
+ "\n" + "Example Requests:\n" + "\n" + "staff/1")
public StaffData retrieveOne(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId,
@DefaultValue("false") @QueryParam("template") @Parameter(description = "template", hidden = true) boolean template) {
StaffData staff = readPlatformService.retrieveStaff(staffId);
Expand Down Expand Up @@ -159,7 +151,7 @@ public StaffCreateResponse createStaff(@RequestBody(required = true) @Valid Staf

@PUT
@Path("{staffId}")
@Operation(summary = "Update a Staff Member", description = "Updates the details of a staff member.")
@Operation(summary = "Update a Staff Member", operationId = "updateStaff", description = "Updates the details of a staff member.")
public StaffUpdateResponse updateStaff(@PathParam("staffId") @Parameter(description = "staffId") final Long staffId,
@RequestBody(required = true) @Valid StaffUpdateRequest request) {
request.setId(staffId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.HashMap;
import org.apache.fineract.client.feign.FineractFeignClient;
import org.apache.fineract.client.models.StaffCreateRequest;
import org.apache.fineract.client.models.StaffCreateResponse;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -60,7 +59,7 @@ void setupStaff() {
request.setDateFormat("yyyy-MM-dd");
request.setLocale("en_US");

StaffCreateResponse response = ok(() -> fineractClient().staff().createStaff(request));
CreateStaffResponse response = ok(() -> fineractClient().staff().createStaff(request));
assertThat(response).isNotNull();
assertThat(response.getResourceId()).isNotNull();
staffId = response.getResourceId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Optional;
import org.apache.fineract.client.models.StaffCreateRequest;
import org.apache.fineract.client.models.StaffData;
import org.apache.fineract.integrationtests.common.Utils;
import org.junit.jupiter.api.Order;
Expand Down Expand Up @@ -53,7 +52,7 @@ public Long getStaffId() {
}

Long create() {
return ok(fineractClient().staff.createStaff(new StaffCreateRequest().officeId(1L).firstname(Utils.randomFirstNameGenerator())
return ok(fineractClient().staff.createStaff(new StaffRequest().officeId(1L).firstname(Utils.randomFirstNameGenerator())
.lastname(Utils.randomLastNameGenerator()).externalId(Utils.randomStringGenerator("", 12))
.joiningDate(LocalDate.now(ZoneId.of("UTC")).toString()).dateFormat("yyyy-MM-dd").locale("en_US"))).getResourceId();
}
Expand Down
Loading